pub trait CompletionClient {
type Model: CompletionModel;
// Required method
fn completion_model(&self, model_name: impl Into<String>) -> Self::Model;
}Expand description
Factory for CompletionModel handles bound to a provider
account / endpoint.
A CompletionClient typically holds the HTTP client, credentials,
and base URL; calling Self::completion_model fixes a specific
model identifier so it can be passed to the engine. Adapters with
multiple model families (e.g. Anthropic’s chat models, Azure’s Chat
Completions deployments) implement one client and produce one model
type.
Required Associated Types§
Sourcetype Model: CompletionModel
type Model: CompletionModel
Concrete CompletionModel this client produces.
Required Methods§
Sourcefn completion_model(&self, model_name: impl Into<String>) -> Self::Model
fn completion_model(&self, model_name: impl Into<String>) -> Self::Model
Build a model handle for model_name (Anthropic model id,
Azure deployment name, etc.). Implementations clone whatever
state the model needs out of the client.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.