#[non_exhaustive]pub struct CreateChatCompletionRequestBuilder { /* private fields */ }Expand description
EN: Builder for chat-completion requests. 中文:Chat completion 请求构建器。
Implementations§
Source§impl CreateChatCompletionRequestBuilder
impl CreateChatCompletionRequestBuilder
Sourcepub fn message(self, message: ChatMessage) -> Self
pub fn message(self, message: ChatMessage) -> Self
EN: Appends a chat message. 中文:追加一条聊天消息。
Sourcepub fn max_completion_tokens(self, max_completion_tokens: u32) -> Self
pub fn max_completion_tokens(self, max_completion_tokens: u32) -> Self
EN: Sets the generated completion token limit. 中文:设置生成 completion token 上限。
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
EN: Sets the sampling temperature. 中文:设置采样温度。
Sourcepub fn extra(self, name: impl Into<String>, value: Value) -> Self
pub fn extra(self, name: impl Into<String>, value: Value) -> Self
EN: Adds a forward-compatible JSON field. 中文:添加前向兼容的 JSON 字段。
Sourcepub fn build(self) -> Result<CreateChatCompletionRequest, LingerError>
pub fn build(self) -> Result<CreateChatCompletionRequest, LingerError>
EN: Builds and validates the request. 中文:构建并校验请求。
Trait Implementations§
Source§impl Clone for CreateChatCompletionRequestBuilder
impl Clone for CreateChatCompletionRequestBuilder
Source§fn clone(&self) -> CreateChatCompletionRequestBuilder
fn clone(&self) -> CreateChatCompletionRequestBuilder
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 Default for CreateChatCompletionRequestBuilder
impl Default for CreateChatCompletionRequestBuilder
Source§fn default() -> CreateChatCompletionRequestBuilder
fn default() -> CreateChatCompletionRequestBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CreateChatCompletionRequestBuilder
impl RefUnwindSafe for CreateChatCompletionRequestBuilder
impl Send for CreateChatCompletionRequestBuilder
impl Sync for CreateChatCompletionRequestBuilder
impl Unpin for CreateChatCompletionRequestBuilder
impl UnsafeUnpin for CreateChatCompletionRequestBuilder
impl UnwindSafe for CreateChatCompletionRequestBuilder
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