pub struct LlmConfig {
pub provider: String,
pub model: String,
pub api_key: SecretString,
pub base_url: Option<String>,
pub headers: HashMap<String, String>,
pub session_id_header: Option<String>,
pub session_id: Option<String>,
pub retry_config: Option<RetryConfig>,
pub temperature: Option<f32>,
pub max_tokens: Option<usize>,
pub thinking_budget: Option<usize>,
pub disable_temperature: bool,
}Expand description
LLM client configuration
Fields§
§provider: String§model: String§api_key: SecretString§base_url: Option<String>§headers: HashMap<String, String>§session_id_header: Option<String>§session_id: Option<String>§retry_config: Option<RetryConfig>§temperature: Option<f32>Sampling temperature (0.0–1.0). None uses the provider default.
max_tokens: Option<usize>Maximum tokens to generate. None uses the client default.
thinking_budget: Option<usize>Extended thinking budget in tokens (Anthropic only).
disable_temperature: boolWhen true, temperature is never sent to the API (e.g., o1 models).
Implementations§
Source§impl LlmConfig
impl LlmConfig
pub fn new( provider: impl Into<String>, model: impl Into<String>, api_key: impl Into<String>, ) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_session_id_header(self, header_name: impl Into<String>) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_retry_config(self, retry_config: RetryConfig) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_max_tokens(self, max_tokens: usize) -> Self
pub fn with_thinking_budget(self, budget: usize) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LlmConfig
impl RefUnwindSafe for LlmConfig
impl Send for LlmConfig
impl Sync for LlmConfig
impl Unpin for LlmConfig
impl UnsafeUnpin for LlmConfig
impl UnwindSafe for LlmConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more