#[non_exhaustive]pub struct CreateChatCompletionRequest {
pub model: String,
pub messages: Vec<ChatMessage>,
pub max_completion_tokens: Option<u32>,
pub temperature: Option<f32>,
pub extra: BTreeMap<String, Value>,
}Expand description
EN: Request body for POST /v1/chat/completions.
中文:POST /v1/chat/completions 的请求体。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.model: StringEN: Model id used to create the chat completion. 中文:用于创建 chat completion 的模型 ID。
messages: Vec<ChatMessage>EN: Chat messages for the completion. 中文:用于 completion 的聊天消息。
max_completion_tokens: Option<u32>EN: Optional upper bound for generated completion tokens. 中文:可选的生成 completion token 上限。
temperature: Option<f32>EN: Optional sampling temperature. 中文:可选的采样温度。
extra: BTreeMap<String, Value>EN: Forward-compatible optional fields not yet covered by handwritten types. 中文:手写类型尚未覆盖的前向兼容可选字段。
Implementations§
Source§impl CreateChatCompletionRequest
impl CreateChatCompletionRequest
Sourcepub fn builder() -> CreateChatCompletionRequestBuilder
pub fn builder() -> CreateChatCompletionRequestBuilder
EN: Starts building a chat-completion request. 中文:开始构建 chat completion 请求。
Trait Implementations§
Source§impl Clone for CreateChatCompletionRequest
impl Clone for CreateChatCompletionRequest
Source§fn clone(&self) -> CreateChatCompletionRequest
fn clone(&self) -> CreateChatCompletionRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CreateChatCompletionRequest
impl Debug for CreateChatCompletionRequest
Source§impl PartialEq for CreateChatCompletionRequest
impl PartialEq for CreateChatCompletionRequest
Source§fn eq(&self, other: &CreateChatCompletionRequest) -> bool
fn eq(&self, other: &CreateChatCompletionRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CreateChatCompletionRequest
Auto Trait Implementations§
impl Freeze for CreateChatCompletionRequest
impl RefUnwindSafe for CreateChatCompletionRequest
impl Send for CreateChatCompletionRequest
impl Sync for CreateChatCompletionRequest
impl Unpin for CreateChatCompletionRequest
impl UnsafeUnpin for CreateChatCompletionRequest
impl UnwindSafe for CreateChatCompletionRequest
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