pub struct ChatCompletionRequest {Show 17 fields
pub model: String,
pub messages: Vec<ChatCompletionRequestMessage>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub max_tokens: Option<i32>,
pub n: Option<i32>,
pub stop: Option<Vec<String>>,
pub stream: Option<bool>,
pub system_prompt: Option<String>,
pub user: Option<String>,
pub tools: Option<Vec<ChatCompletionTool>>,
pub tool_choice: Option<ToolChoiceOption>,
pub response_format: Option<ChatCompletionResponseFormat>,
pub seed: Option<i64>,
pub logit_bias: Option<Value>,
pub logprobs: Option<bool>,
pub top_logprobs: Option<i32>,
}Expand description
Fields§
§model: StringID of the model to use.
messages: Vec<ChatCompletionRequestMessage>A list of messages comprising the conversation so far.
temperature: Option<f32>What sampling temperature to use, between 0 and 2.
top_p: Option<f32>An alternative to sampling with temperature, called nucleus sampling.
max_tokens: Option<i32>The maximum number of tokens to generate in the chat completion.
n: Option<i32>Number of chat completion choices to generate for each input message.
stop: Option<Vec<String>>Up to 4 sequences where the API will stop generating further tokens.
stream: Option<bool>Whether to stream back partial progress.
system_prompt: Option<String>The system prompt that helps guide the behavior of the model.
user: Option<String>A unique identifier representing your end-user.
tools: Option<Vec<ChatCompletionTool>>A list of tools the model may call.
tool_choice: Option<ToolChoiceOption>Controls which (if any) tool the model calls.
response_format: Option<ChatCompletionResponseFormat>An object specifying the format that the model must output.
seed: Option<i64>This feature is in Beta.
logit_bias: Option<Value>Adjusts the likelihood of specified tokens appearing in the completion.
logprobs: Option<bool>Log probability of the most likely tokens.
top_logprobs: Option<i32>The number of most likely tokens to return at each token position.
Implementations§
Source§impl ChatCompletionRequest
impl ChatCompletionRequest
Sourcepub fn former() -> ChatCompletionRequestFormer<ChatCompletionRequestFormerDefinition<(), ChatCompletionRequest, ReturnPreformed>>
pub fn former() -> ChatCompletionRequestFormer<ChatCompletionRequestFormerDefinition<(), ChatCompletionRequest, ReturnPreformed>>
Provides a mechanism to initiate the formation process with a default completion behavior.
Trait Implementations§
Source§impl Clone for ChatCompletionRequest
impl Clone for ChatCompletionRequest
Source§fn clone(&self) -> ChatCompletionRequest
fn clone(&self) -> ChatCompletionRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl<__Context, __Formed, __End> EntityToDefinition<__Context, __Formed, __End> for ChatCompletionRequestwhere
__End: FormingEnd<ChatCompletionRequestFormerDefinitionTypes<__Context, __Formed>>,
impl<__Context, __Formed, __End> EntityToDefinition<__Context, __Formed, __End> for ChatCompletionRequestwhere
__End: FormingEnd<ChatCompletionRequestFormerDefinitionTypes<__Context, __Formed>>,
Source§type Definition = ChatCompletionRequestFormerDefinition<__Context, __Formed, __End>
type Definition = ChatCompletionRequestFormerDefinition<__Context, __Formed, __End>
FormerDefinition associated with this entity. Read moreSource§type Types = ChatCompletionRequestFormerDefinitionTypes<__Context, __Formed>
type Types = ChatCompletionRequestFormerDefinitionTypes<__Context, __Formed>
FormerDefinitionTypes associated with this entity. Read moreSource§impl<__Context, __Formed> EntityToDefinitionTypes<__Context, __Formed> for ChatCompletionRequest
impl<__Context, __Formed> EntityToDefinitionTypes<__Context, __Formed> for ChatCompletionRequest
Source§impl<Definition> EntityToFormer<Definition> for ChatCompletionRequestwhere
Definition: FormerDefinition<Storage = ChatCompletionRequestFormerStorage>,
impl<Definition> EntityToFormer<Definition> for ChatCompletionRequestwhere
Definition: FormerDefinition<Storage = ChatCompletionRequestFormerStorage>,
Source§impl PartialEq for ChatCompletionRequest
impl PartialEq for ChatCompletionRequest
Source§impl Serialize for ChatCompletionRequest
impl Serialize for ChatCompletionRequest
Source§impl Validate for ChatCompletionRequest
Implement Validate for ChatCompletionRequest
impl Validate for ChatCompletionRequest
Implement Validate for ChatCompletionRequest
impl StructuralPartialEq for ChatCompletionRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Entry is defined by the Collection trait.