pub struct ClientConfig {
pub provider: Provider,
pub base_url: String,
pub api_key: String,
pub timeout: Duration,
pub model: String,
pub max_tokens: u32,
}Expand description
Configuration for the LLM client.
Fields§
§provider: Provider§base_url: String§api_key: String§timeout: Duration§model: String§max_tokens: u32Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn anthropic(api_key: impl Into<String>, model: impl Into<String>) -> Self
pub fn anthropic(api_key: impl Into<String>, model: impl Into<String>) -> Self
Create config for the Anthropic API.
Sourcepub fn openai_compatible(
base_url: impl Into<String>,
api_key: impl Into<String>,
model: impl Into<String>,
) -> Self
pub fn openai_compatible( base_url: impl Into<String>, api_key: impl Into<String>, model: impl Into<String>, ) -> Self
Create config for an OpenAI-compatible API (OpenRouter, OpenAI, Ollama, etc.).
pub fn timeout(self, timeout: Duration) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
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 moreAuto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin 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