pub struct ChatRequest {
pub model: String,
pub messages: Vec<ChatMessage>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub stream: Option<bool>,
pub tools: Option<Vec<Value>>,
pub top_p: Option<f32>,
pub frequency_penalty: Option<f32>,
pub presence_penalty: Option<f32>,
}Expand description
A chat completion request
Fields§
§model: StringThe model to use for completion
messages: Vec<ChatMessage>The conversation messages
temperature: Option<f32>Sampling temperature (0.0 to 2.0)
max_tokens: Option<u32>Maximum number of tokens to generate
stream: Option<bool>Whether to stream the response
tools: Option<Vec<Value>>Tools available for the model to call
top_p: Option<f32>Top-p sampling parameter
frequency_penalty: Option<f32>Frequency penalty
presence_penalty: Option<f32>Presence penalty
Trait Implementations§
Source§impl Clone for ChatRequest
impl Clone for ChatRequest
Source§fn clone(&self) -> ChatRequest
fn clone(&self) -> ChatRequest
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 ChatRequest
impl Debug for ChatRequest
Auto Trait Implementations§
impl Freeze for ChatRequest
impl RefUnwindSafe for ChatRequest
impl Send for ChatRequest
impl Sync for ChatRequest
impl Unpin for ChatRequest
impl UnsafeUnpin for ChatRequest
impl UnwindSafe for ChatRequest
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