pub struct ModelRegistry {
models: BTreeMap<String, RegisteredModel>,
}Fields§
§models: BTreeMap<String, RegisteredModel>Implementations§
Source§impl ModelRegistry
impl ModelRegistry
Sourcepub fn from_config(models: &BTreeMap<String, ModelDefinition>) -> Result<Self>
pub fn from_config(models: &BTreeMap<String, ModelDefinition>) -> Result<Self>
Configured fake models return a clearly labelled synthetic final answer. Tests can instead register a FakeModel with a scripted sequence.
Sourcepub fn from_config_with_catalog(
models: &BTreeMap<String, ModelDefinition>,
catalog: &ModelProviderCatalog,
) -> Result<Self>
pub fn from_config_with_catalog( models: &BTreeMap<String, ModelDefinition>, catalog: &ModelProviderCatalog, ) -> Result<Self>
Construct configured models from factories explicitly trusted by the host.
pub fn register( &mut self, alias: &str, provider_name: &str, model_name: &str, provider: Arc<dyn ModelProvider>, ) -> Result<()>
fn register_with_implementation( &mut self, alias: &str, provider_name: &str, model_name: &str, implementation: ModelProviderImplementation, provider: Arc<dyn ModelProvider>, ) -> Result<()>
Sourcepub fn identity(&self, alias: &str) -> Result<(&str, &str)>
pub fn identity(&self, alias: &str) -> Result<(&str, &str)>
Stable, non-secret binding used to validate persisted runtime checkpoints.
Sourcepub fn implementation_identity(
&self,
alias: &str,
) -> Result<&ModelProviderImplementation>
pub fn implementation_identity( &self, alias: &str, ) -> Result<&ModelProviderImplementation>
Stable adapter identity available for future checkpoint compatibility.
pub async fn generate( &self, alias: &str, request: &ModelRequest, ) -> Result<ModelResponse>
Sourcepub async fn generate_recorded(
&self,
store: &AgentRunStore,
run_id: &str,
alias: &str,
request: &ModelRequest,
) -> Result<ModelResponse>
pub async fn generate_recorded( &self, store: &AgentRunStore, run_id: &str, alias: &str, request: &ModelRequest, ) -> Result<ModelResponse>
Persist lifecycle metadata around one model call. Run completion remains the caller’s responsibility. Cancellation leaves an unmatched requested event; safe reconciliation belongs to the future resume layer.
pub async fn generate_recorded_with_budget( &self, store: &AgentRunStore, run_id: &str, alias: &str, request: &ModelRequest, ) -> Result<RecordedModelResponse>
Trait Implementations§
Source§impl Default for ModelRegistry
impl Default for ModelRegistry
Source§fn default() -> ModelRegistry
fn default() -> ModelRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ModelRegistry
impl !UnwindSafe for ModelRegistry
impl Freeze for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().