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>,
}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
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StreamOptions
impl Debug for StreamOptions
Source§impl Default for StreamOptions
impl Default for StreamOptions
Source§fn default() -> StreamOptions
fn default() -> StreamOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StreamOptions
impl<'de> Deserialize<'de> for StreamOptions
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 StreamOptions
impl RefUnwindSafe for StreamOptions
impl Send for StreamOptions
impl Sync for StreamOptions
impl Unpin for StreamOptions
impl UnsafeUnpin for StreamOptions
impl UnwindSafe for StreamOptions
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