pub struct ClientConfig {
pub provider: ProviderConfig,
pub model: ModelConfig,
pub http: HttpConfig,
pub retry: RetryConfig,
pub headers: HashMap<String, String>,
}Expand description
Main client configuration
Fields§
§provider: ProviderConfigProvider configuration
model: ModelConfigModel configuration
http: HttpConfigHTTP configuration
retry: RetryConfigRetry configuration
headers: HashMap<String, String>Custom headers
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn builder() -> ClientConfigBuilder
pub fn builder() -> ClientConfigBuilder
Create a new configuration builder
Sourcepub fn from_env() -> RsllmResult<Self>
pub fn from_env() -> RsllmResult<Self>
Load configuration from environment variables
Supports both generic and provider-specific environment variables:
- RSLLM_BASE_URL: Generic base URL (overridden by provider-specific)
- RSLLM_OPENAI_BASE_URL: OpenAI-specific base URL
- RSLLM_OLLAMA_BASE_URL: Ollama-specific base URL
- RSLLM_CLAUDE_BASE_URL: Claude-specific base URL
- RSLLM_MODEL: Generic model name
- RSLLM_OPENAI_MODEL: OpenAI-specific model
- RSLLM_OLLAMA_MODEL: Ollama-specific model
- RSLLM_CLAUDE_MODEL: Claude-specific model
Sourcepub fn validate(&self) -> RsllmResult<()>
pub fn validate(&self) -> RsllmResult<()>
Validate the configuration
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
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 ClientConfig
impl Debug for ClientConfig
Source§impl Default for ClientConfig
impl Default for ClientConfig
Source§impl<'de> Deserialize<'de> for ClientConfig
impl<'de> Deserialize<'de> for ClientConfig
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 ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
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