pub struct ImageProviderConfig {
pub name: Option<String>,
pub base_url: String,
pub api_key: String,
pub protocol: ImageProtocol,
pub mode: ImageCallMode,
pub models: Vec<ImageModelConfig>,
pub poll_interval_secs: u64,
pub poll_timeout_secs: u64,
}Expand description
An image generation provider (one API endpoint with multiple models).
Fields§
§name: Option<String>Display name for the provider (optional).
base_url: StringAPI base URL. For DashScope this includes the /api/v1 prefix
(e.g. https://dashscope.aliyuncs.com/api/v1). For OpenAI-compatible
providers, include the /v1 prefix (e.g. https://api.openai.com/v1).
This mirrors how chat providers configure base_url - the client
only appends the endpoint path, not a version prefix.
api_key: StringAPI key (supports ${ENV_VAR} substitution).
protocol: ImageProtocolProtocol used by this provider (default: openai).
mode: ImageCallModeCall mode, only effective for Dashscope protocol (default: sync).
models: Vec<ImageModelConfig>Available models under this provider.
poll_interval_secs: u64Polling interval in seconds for async mode (default: 3).
poll_timeout_secs: u64Total polling timeout in seconds for async mode (default: 300).
Trait Implementations§
Source§impl Clone for ImageProviderConfig
impl Clone for ImageProviderConfig
Source§fn clone(&self) -> ImageProviderConfig
fn clone(&self) -> ImageProviderConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageProviderConfig
impl Debug for ImageProviderConfig
Source§impl<'de> Deserialize<'de> for ImageProviderConfig
impl<'de> Deserialize<'de> for ImageProviderConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ImageProviderConfig
impl RefUnwindSafe for ImageProviderConfig
impl Send for ImageProviderConfig
impl Sync for ImageProviderConfig
impl Unpin for ImageProviderConfig
impl UnsafeUnpin for ImageProviderConfig
impl UnwindSafe for ImageProviderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more