pub struct CreateChatCompletion {Show 14 fields
pub model: Model,
pub messages: Vec<Message>,
pub max_tokens: Option<u64>,
pub temperature: f32,
pub top_p: f32,
pub return_citations: bool,
pub search_domain_filter: Option<Vec<String>>,
pub return_images: bool,
pub return_related_questions: bool,
pub search_recency_filter: RecencyFilter,
pub top_k: u16,
pub stream: bool,
pub presence_penalty: u8,
pub frequency_penalty: f32,
}Fields§
§model: ModelThe name of the model that will complete your prompt.
messages: Vec<Message>The conversation messages.
max_tokens: Option<u64>The maximum number of completion tokens returned by the API. The total number of tokens requested in max_tokens plus the number of prompt tokens sent in messages must not exceed the context window token limit of model requested. If left unspecified, then the model will generate tokens until either it reaches its stop token or the end of its context window.
temperature: f32The amount of randomness in the response, valued between 0 inclusive and 2 exclusive. Higher values are more random, and lower values are more deterministic.
Defaults to 0.2.
top_p: f32The nucleus sampling threshold, valued between 0 and 1 inclusive. For each subsequent token, the model considers the results of the tokens with top_p probability mass.
Defaults to 0.9.
return_citations: boolDetermines whether or not a request to an online model should return citations.
Defaults to false.
search_domain_filter: Option<Vec<String>>Given a list of domains, limit the citations used by the online model to URLs from the specified domains. Currently limited to only 3 domains for whitelisting and blacklisting. For blacklisting add a - to the beginning of the domain string.
return_images: boolDetermines whether or not a request to an online model should return images.
Defaults to false.
Determines whether or not a request to an online model should return related questions.
Defaults to false.
search_recency_filter: RecencyFilterReturns search results within the specified time interval - does not apply to images.
top_k: u16The number of tokens to keep for highest top-k filtering, specified as an integer between 0 and 2048 inclusive. If set to 0, top-k filtering is disabled.
Defaults to 0.
stream: boolDetermines whether or not to incrementally stream the response with server-sent events.
Defaults to false.
presence_penalty: u8A value between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics. Incompatible with frequency_penalty.
Defaults to 0.
frequency_penalty: f32A multiplicative penalty greater than 0. Values greater than 1.0 penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. A value of 1.0 means no penalty. Incompatible with presence_penalty.
Defaults to 1.
Implementations§
Source§impl CreateChatCompletion
impl CreateChatCompletion
pub fn new(model: Model, messages: Vec<Message>) -> Self
pub fn with_model(self, model: Model) -> Self
pub fn with_stream(self, stream: bool) -> Self
pub fn with_max_tokens(self, max_tokens: u64) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_top_k(self, top_k: u16) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
pub fn with_frequency_penalty(self, frequency_penalty: f32) -> Self
pub fn with_presence_penalty(self, presence_penalty: u8) -> Self
pub fn with_images(self, return_images: bool) -> Self
pub fn with_citations(self, return_citations: bool) -> Self
pub fn with_search_domain_filter( self, search_domain_filter: Vec<String>, ) -> Self
pub fn with_recency_filter(self, recency_filter: RecencyFilter) -> Self
Trait Implementations§
Source§impl Clone for CreateChatCompletion
impl Clone for CreateChatCompletion
Source§fn clone(&self) -> CreateChatCompletion
fn clone(&self) -> CreateChatCompletion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more