pub struct ChatCompletionRequest {Show 15 fields
pub model: String,
pub messages: Vec<ChatMessage>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub max_tokens: Option<u32>,
pub stop: Option<Value>,
pub presence_penalty: Option<f64>,
pub frequency_penalty: Option<f64>,
pub logit_bias: Option<HashMap<String, f64>>,
pub user: Option<String>,
pub n: Option<u32>,
pub tools: Option<Vec<ToolDefinition>>,
pub tool_choice: Option<Value>,
pub response_format: Option<ResponseFormat>,
pub stream: Option<bool>,
}Expand description
Chat Completions request (commonly used subset).
This model intentionally uses flexible types (e.g., serde_json::Value for stop)
to accept both strings and arrays where the API allows it.
Fields§
§model: String§messages: Vec<ChatMessage>§temperature: Option<f64>§top_p: Option<f64>§max_tokens: Option<u32>§stop: Option<Value>Accepts a single string or an array of strings.
presence_penalty: Option<f64>§frequency_penalty: Option<f64>§logit_bias: Option<HashMap<String, f64>>§user: Option<String>§n: Option<u32>§tools: Option<Vec<ToolDefinition>>§tool_choice: Option<Value>§response_format: Option<ResponseFormat>§stream: Option<bool>Trait Implementations§
Source§impl Clone for ChatCompletionRequest
impl Clone for ChatCompletionRequest
Source§fn clone(&self) -> ChatCompletionRequest
fn clone(&self) -> ChatCompletionRequest
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 ChatCompletionRequest
impl Debug for ChatCompletionRequest
Source§impl<'de> Deserialize<'de> for ChatCompletionRequest
impl<'de> Deserialize<'de> for ChatCompletionRequest
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 ChatCompletionRequest
impl RefUnwindSafe for ChatCompletionRequest
impl Send for ChatCompletionRequest
impl Sync for ChatCompletionRequest
impl Unpin for ChatCompletionRequest
impl UnwindSafe for ChatCompletionRequest
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