pub struct ChatOptions {
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub top_p: Option<f32>,
pub stop: Option<Vec<String>>,
pub system: Option<String>,
}Expand description
Chat completion options
Fields§
§temperature: Option<f32>Temperature (0.0 - 1.0)
max_tokens: Option<u32>Maximum tokens to generate
top_p: Option<f32>Top-p sampling
stop: Option<Vec<String>>Stop sequences
system: Option<String>System prompt
Implementations§
Source§impl ChatOptions
impl ChatOptions
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
Set temperature
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Set max tokens
Sourcepub fn deterministic(max_tokens: u32) -> Self
pub fn deterministic(max_tokens: u32) -> Self
Deterministic classification/routing (temp=0, few tokens)
Trait Implementations§
Source§impl Clone for ChatOptions
impl Clone for ChatOptions
Source§fn clone(&self) -> ChatOptions
fn clone(&self) -> ChatOptions
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 ChatOptions
impl Debug for ChatOptions
Source§impl Default for ChatOptions
impl Default for ChatOptions
Source§impl<'de> Deserialize<'de> for ChatOptions
impl<'de> Deserialize<'de> for ChatOptions
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 ChatOptions
impl RefUnwindSafe for ChatOptions
impl Send for ChatOptions
impl Sync for ChatOptions
impl Unpin for ChatOptions
impl UnsafeUnpin for ChatOptions
impl UnwindSafe for ChatOptions
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