pub struct ChatRequest {Show 18 fields
pub model: String,
pub messages: Vec<ChatMessage>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub response_format: Option<Value>,
pub max_completion_tokens: Option<u32>,
pub tools: Option<Value>,
pub tool_choice: Option<Value>,
pub parallel_tool_calls: Option<bool>,
pub stop: Option<Value>,
pub top_p: Option<f32>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub seed: Option<u64>,
pub user: Option<String>,
pub metadata: Option<Value>,
pub reasoning_effort: Option<Value>,
pub thinking: Option<Value>,
}Fields§
§model: String§messages: Vec<ChatMessage>§temperature: Option<f32>§max_tokens: Option<u32>§response_format: Option<Value>§max_completion_tokens: Option<u32>§tools: Option<Value>§tool_choice: Option<Value>§parallel_tool_calls: Option<bool>§stop: Option<Value>§top_p: Option<f32>§presence_penalty: Option<f32>§frequency_penalty: Option<f32>§seed: Option<u64>§user: Option<String>§metadata: Option<Value>§reasoning_effort: Option<Value>§thinking: Option<Value>Implementations§
Source§impl ChatRequest
impl ChatRequest
pub fn new(model: impl Into<String>) -> Self
pub fn message( self, role: impl Into<String>, content: impl Into<String>, ) -> Self
pub fn message_with_content( self, role: impl Into<String>, content: ChatMessageContent, ) -> Self
pub fn temperature(self, temperature: f32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
pub fn response_format(self, format: Value) -> Self
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
Source§impl<'de> Deserialize<'de> for ChatRequest
impl<'de> Deserialize<'de> for ChatRequest
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 ChatRequest
impl RefUnwindSafe for ChatRequest
impl Send for ChatRequest
impl Sync for ChatRequest
impl Unpin 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