pub struct LLMProviderConfig {
pub api_key: String,
pub base_url: Option<String>,
pub model: String,
pub timeout_seconds: u64,
pub max_retries: u32,
pub headers: HashMap<String, String>,
pub options: HashMap<String, Value>,
}
Expand description
Configuration for an LLM provider
Fields§
§api_key: String
API key or credentials
base_url: Option<String>
Base URL for API requests
model: String
Default model to use
timeout_seconds: u64
Request timeout in seconds
max_retries: u32
Maximum retry attempts
headers: HashMap<String, String>
Custom headers
options: HashMap<String, Value>
Provider-specific options
Implementations§
Source§impl LLMProviderConfig
impl LLMProviderConfig
Sourcepub fn new(api_key: impl Into<String>, model: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>, model: impl Into<String>) -> Self
Create a new provider config
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Set base URL
Sourcepub fn with_timeout(self, timeout_seconds: u64) -> Self
pub fn with_timeout(self, timeout_seconds: u64) -> Self
Set timeout
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Set max retries
Sourcepub fn with_header(self, key: String, value: String) -> Self
pub fn with_header(self, key: String, value: String) -> Self
Add custom header
Sourcepub fn with_option(self, key: String, value: Value) -> Self
pub fn with_option(self, key: String, value: Value) -> Self
Add custom option
Trait Implementations§
Source§impl Clone for LLMProviderConfig
impl Clone for LLMProviderConfig
Source§fn clone(&self) -> LLMProviderConfig
fn clone(&self) -> LLMProviderConfig
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 LLMProviderConfig
impl Debug for LLMProviderConfig
Source§impl Default for LLMProviderConfig
impl Default for LLMProviderConfig
Source§impl<'de> Deserialize<'de> for LLMProviderConfig
impl<'de> Deserialize<'de> for LLMProviderConfig
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 LLMProviderConfig
impl RefUnwindSafe for LLMProviderConfig
impl Send for LLMProviderConfig
impl Sync for LLMProviderConfig
impl Unpin for LLMProviderConfig
impl UnwindSafe for LLMProviderConfig
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