pub trait ImageGenerationClient: ProviderClient + Clone {
type ImageGenerationModel: ImageGenerationModel;
// Required method
fn image_generation_model(&self, model: &str) -> Self::ImageGenerationModel;
}
Expand description
A provider client with image generation capabilities. Clone is required for conversions between client types.
Required Associated Types§
Sourcetype ImageGenerationModel: ImageGenerationModel
type ImageGenerationModel: ImageGenerationModel
The ImageGenerationModel used by the Client
Required Methods§
Sourcefn image_generation_model(&self, model: &str) -> Self::ImageGenerationModel
fn image_generation_model(&self, model: &str) -> Self::ImageGenerationModel
Create an image generation model with the given name.
§Example with OpenAI
use rig::prelude::*;
use rig::providers::openai::{Client, self};
// Initialize the OpenAI client
let openai = Client::new("your-open-ai-api-key");
let gpt4 = openai.image_generation_model(openai::DALL_E_3);
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.