pub trait CompletionClient {
type CompletionModel: CompletionModel<Client = Self>;
// Provided method
fn completion_model(
&self,
model: impl Into<String>,
) -> Self::CompletionModel { ... }
}Expand description
A provider client with completion capabilities. Clone is required for conversions between client types.
Required Associated Types§
Sourcetype CompletionModel: CompletionModel<Client = Self>
type CompletionModel: CompletionModel<Client = Self>
The type of CompletionModel used by the client.
Provided Methods§
Sourcefn completion_model(&self, model: impl Into<String>) -> Self::CompletionModel
fn completion_model(&self, model: impl Into<String>) -> Self::CompletionModel
Create a completion model with the given model.
§Example with OpenAI
use rig_core::prelude::*;
use rig_core::providers::openai::{Client, self};
// Initialize the OpenAI client
let openai = Client::new("your-open-ai-api-key")?;
let gpt = openai.completion_model(openai::GPT_5_2);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".