pub struct ChatCompletions {Show 17 fields
pub messages: Vec<Message>,
pub model: String,
pub store: bool,
pub metadata: Option<Value>,
pub logit_bias: Option<Value>,
pub logprobs: bool,
pub top_logprobs: Option<usize>,
pub max_tokens: Option<usize>,
pub max_completion_tokens: Option<usize>,
pub n: Option<usize>,
pub presence_penalty: Option<f32>,
pub response_format: Option<ResponseFormat>,
pub seed: Option<u32>,
pub service_tier: Option<String>,
pub stop: Option<Stop>,
pub stream: bool,
pub user: Option<String>,
}
Expand description
Chat completions structure.
For reference, see: https://platform.openai.com/docs/api-reference/chat
To construct this structure easily use the default trait:
let request = mini_openai::ChatCompletions {
messages: vec![
mini_openai::Message{
role: mini_openai::ROLE_SYSTEM.into(),
content: "Who are you?".into()
}
],
..Default::default()
};
Fields§
§messages: Vec<Message>
§model: String
§store: bool
§metadata: Option<Value>
§logit_bias: Option<Value>
§logprobs: bool
§top_logprobs: Option<usize>
§max_tokens: Option<usize>
§max_completion_tokens: Option<usize>
§n: Option<usize>
§presence_penalty: Option<f32>
§response_format: Option<ResponseFormat>
§seed: Option<u32>
§service_tier: Option<String>
§stop: Option<Stop>
§stream: bool
Must be ‘false’: Only non-streaming is supported.
user: Option<String>
Trait Implementations§
Source§impl Clone for ChatCompletions
impl Clone for ChatCompletions
Source§fn clone(&self) -> ChatCompletions
fn clone(&self) -> ChatCompletions
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 ChatCompletions
impl Debug for ChatCompletions
Source§impl Default for ChatCompletions
impl Default for ChatCompletions
Auto Trait Implementations§
impl Freeze for ChatCompletions
impl RefUnwindSafe for ChatCompletions
impl Send for ChatCompletions
impl Sync for ChatCompletions
impl Unpin for ChatCompletions
impl UnwindSafe for ChatCompletions
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