pub struct ProviderConfig {
pub name: String,
pub base_url: String,
pub api_key: Option<String>,
pub default_model: Option<String>,
pub retry_config: RetryConfig,
pub timeout: Duration,
pub capabilities: Capabilities,
}Expand description
Provider configuration.
Fields§
§name: StringProvider name
base_url: StringBase URL for API
api_key: Option<String>API key (optional for some providers)
default_model: Option<String>Default model
retry_config: RetryConfigRetry configuration
timeout: DurationRequest timeout
capabilities: CapabilitiesProvider capabilities
Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn new(name: impl Into<String>, base_url: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, base_url: impl Into<String>) -> Self
Create a new provider configuration.
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
Set the API key.
Sourcepub fn with_default_model(self, model: impl Into<String>) -> Self
pub fn with_default_model(self, model: impl Into<String>) -> Self
Set the default model.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the timeout.
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§fn clone(&self) -> ProviderConfig
fn clone(&self) -> ProviderConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 ProviderConfig
impl Debug for ProviderConfig
Source§impl<'de> Deserialize<'de> for ProviderConfig
impl<'de> Deserialize<'de> for ProviderConfig
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
Source§impl PartialEq for ProviderConfig
impl PartialEq for ProviderConfig
Source§impl Serialize for ProviderConfig
impl Serialize for ProviderConfig
impl StructuralPartialEq for ProviderConfig
Auto Trait Implementations§
impl Freeze for ProviderConfig
impl RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl UnwindSafe for ProviderConfig
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