pub struct CompletionRequest {Show 15 fields
pub model: String,
pub messages: Vec<Message>,
pub temperature: Option<f32>,
pub tool_choice: Option<String>,
pub top_p: Option<f32>,
pub n: Option<i32>,
pub stream: Option<bool>,
pub stop: Option<Vec<String>>,
pub max_tokens: Option<i32>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub logit_bias: Option<HashMap<String, f32>>,
pub user: Option<String>,
pub tools: Option<Vec<Tool>>,
pub parallel_tool_calls: Option<bool>,
}
Fields§
§model: String
ID of the model to use
messages: Vec<Message>
A list of messages comprising the conversation so far
temperature: Option<f32>
What sampling temperature to use, between 0 and 2
tool_choice: Option<String>
Tool choice - can be “none”, “auto” or a specific tool
top_p: Option<f32>
An alternative to sampling with temperature
n: Option<i32>
How many chat completion choices to generate for each input message
stream: Option<bool>
Whether to stream back partial progress
stop: Option<Vec<String>>
Up to 4 sequences where the API will stop generating further tokens
max_tokens: Option<i32>
The maximum number of tokens to generate in the chat completion
presence_penalty: Option<f32>
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far
frequency_penalty: Option<f32>
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far
logit_bias: Option<HashMap<String, f32>>
Modify the likelihood of specified tokens appearing in the completion
user: Option<String>
A unique identifier representing your end-user
tools: Option<Vec<Tool>>
Available tools/functions that the model can use
parallel_tool_calls: Option<bool>
Enable parallel tool calls