pub struct ChatCompletionCreateParams {
pub model: Option<String>,
pub messages: Vec<ChatCompletionMessage>,
pub temperature: Option<f32>,
pub n: Option<u32>,
pub max_tokens: Option<u32>,
pub tools: Vec<ChatToolDefinition>,
pub tool_choice: Option<ChatToolChoice>,
pub stream: Option<bool>,
}Expand description
表示聊天补全请求参数。
Fields§
§model: Option<String>模型 ID。
messages: Vec<ChatCompletionMessage>历史消息。
temperature: Option<f32>温度。
n: Option<u32>候选数量。
max_tokens: Option<u32>最大 token 数。
tools: Vec<ChatToolDefinition>工具定义。
tool_choice: Option<ChatToolChoice>工具选择策略。
stream: Option<bool>流式开关。
Trait Implementations§
Source§impl Clone for ChatCompletionCreateParams
impl Clone for ChatCompletionCreateParams
Source§fn clone(&self) -> ChatCompletionCreateParams
fn clone(&self) -> ChatCompletionCreateParams
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 ChatCompletionCreateParams
impl Debug for ChatCompletionCreateParams
Source§impl Default for ChatCompletionCreateParams
impl Default for ChatCompletionCreateParams
Source§fn default() -> ChatCompletionCreateParams
fn default() -> ChatCompletionCreateParams
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChatCompletionCreateParams
impl<'de> Deserialize<'de> for ChatCompletionCreateParams
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 ChatCompletionCreateParams
impl RefUnwindSafe for ChatCompletionCreateParams
impl Send for ChatCompletionCreateParams
impl Sync for ChatCompletionCreateParams
impl Unpin for ChatCompletionCreateParams
impl UnsafeUnpin for ChatCompletionCreateParams
impl UnwindSafe for ChatCompletionCreateParams
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