Skip to main content

ProviderModel

Trait ProviderModel 

Source
pub trait ProviderModel: Model {
    // Required method
    fn provider(&self) -> &str;

    // Provided method
    fn model_ref(&self, model: impl Into<String>) -> ModelRef
       where Self: Sized { ... }
}
Expand description

Stable provider identity carried by a concrete model adapter.

Implementing this trait in addition to Model lets higher runtime layers construct provider-qualified model references and attach Agent, routing, retry, circuit-breaker, observability, budget, and workflow behavior without provider-specific orchestration code.

Required Methods§

Source

fn provider(&self) -> &str

Returns the canonical provider namespace used by this adapter.

Provided Methods§

Source

fn model_ref(&self, model: impl Into<String>) -> ModelRef
where Self: Sized,

Qualifies one model name with this adapter’s provider identity.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§