ImageGenerationClient

Trait ImageGenerationClient 

Source
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§

Source

type ImageGenerationModel: ImageGenerationModel

The ImageGenerationModel used by the Client

Required Methods§

Source

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.

Implementors§