pub struct StreamOptions {
pub temperature: Option<f64>,
pub max_tokens: Option<usize>,
pub api_key: Option<String>,
pub cache_retention: Option<CacheRetention>,
pub session_id: Option<String>,
pub headers: HashMap<String, String>,
pub thinking_level: Option<ThinkingLevel>,
pub thinking_budgets: Option<ThinkingBudgets>,
pub provider_options: Option<ProviderOptions>,
}Expand description
Provider trait, streaming options, and provider registry. Options for streaming requests
Fields§
§temperature: Option<f64>Sampling temperature (0.0 to 2.0)
max_tokens: Option<usize>Maximum tokens to generate
api_key: Option<String>API key (overrides environment variable) This field is excluded from serialization and Debug output to prevent leakage.
cache_retention: Option<CacheRetention>Cache retention preference
session_id: Option<String>Session ID for providers that support session-based caching
headers: HashMap<String, String>Custom HTTP headers to include
thinking_level: Option<ThinkingLevel>Thinking/reasoning level
thinking_budgets: Option<ThinkingBudgets>Custom token budgets for thinking levels
provider_options: Option<ProviderOptions>Per-provider options for fine-grained control.
Each provider reads only its own section. For example, the Anthropic
provider reads provider_options.anthropic, OpenAI reads
provider_options.openai. This allows a single request to carry
options for multiple providers without conflicts.
Implementations§
Source§impl StreamOptions
impl StreamOptions
Sourcepub fn temperature(self, temp: f64) -> Self
pub fn temperature(self, temp: f64) -> Self
Set temperature
Sourcepub fn max_tokens(self, tokens: usize) -> Self
pub fn max_tokens(self, tokens: usize) -> Self
Set max tokens
Sourcepub fn cache_retention(self, retention: CacheRetention) -> Self
pub fn cache_retention(self, retention: CacheRetention) -> Self
Set cache retention
Sourcepub fn session_id(self, id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
Set session ID
Sourcepub fn thinking_level(self, level: ThinkingLevel) -> Self
pub fn thinking_level(self, level: ThinkingLevel) -> Self
Set thinking level
Trait Implementations§
Source§impl Clone for StreamOptions
impl Clone for StreamOptions
Source§fn clone(&self) -> StreamOptions
fn clone(&self) -> StreamOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more