#[non_exhaustive]pub struct ChatOptions {
pub logit_bias: BTreeMap<String, i32>,
pub prediction: Option<Prediction>,
pub logprobs: Option<bool>,
pub top_logprobs: Option<u8>,
pub frequency_penalty: Option<f64>,
pub presence_penalty: Option<f64>,
pub modalities: Vec<Modality>,
pub audio: Option<AudioOutput>,
pub web_search_options: Option<WebSearchOptions>,
}Expand description
The fields only Chat Completions takes (https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.logit_bias: BTreeMap<String, i32>Bias per token id, from -100 to 100.
prediction: Option<Prediction>Predicted output, which speeds up a regeneration that mostly repeats it.
logprobs: Option<bool>Whether the reply carries each output token’s log probability.
top_logprobs: Option<u8>How many of the most likely tokens to report per position, 0 to 20.
frequency_penalty: Option<f64>Penalizes tokens by how often they already appear, -2.0 to 2.0.
presence_penalty: Option<f64>Penalizes tokens that already appear, -2.0 to 2.0.
modalities: Vec<Modality>The output modalities, for models that also speak.
audio: Option<AudioOutput>The spoken output, when modalities holds audio.
web_search_options: Option<WebSearchOptions>Web search, for the search models.
Implementations§
Source§impl ChatOptions
impl ChatOptions
Sourcepub fn logit_bias(self, token: u32, bias: i32) -> Self
pub fn logit_bias(self, token: u32, bias: i32) -> Self
Bias token id token by bias.
Sourcepub fn prediction(self, content: impl Into<String>) -> Self
pub fn prediction(self, content: impl Into<String>) -> Self
Predict the output as content.
Sourcepub fn top_logprobs(self, count: u8) -> Self
pub fn top_logprobs(self, count: u8) -> Self
Report the count most likely tokens per position.
Sourcepub fn frequency_penalty(self, penalty: f64) -> Self
pub fn frequency_penalty(self, penalty: f64) -> Self
Set the frequency penalty.
Sourcepub fn presence_penalty(self, penalty: f64) -> Self
pub fn presence_penalty(self, penalty: f64) -> Self
Set the presence penalty.
Sourcepub fn modalities(self, modalities: impl IntoIterator<Item = Modality>) -> Self
pub fn modalities(self, modalities: impl IntoIterator<Item = Modality>) -> Self
Answer in modalities.
Sourcepub fn audio(self, voice: impl Into<String>, format: AudioFormat) -> Self
pub fn audio(self, voice: impl Into<String>, format: AudioFormat) -> Self
Speak with voice in format.
Sourcepub fn web_search_options(self, options: WebSearchOptions) -> Self
pub fn web_search_options(self, options: WebSearchOptions) -> Self
Search the web with options.
Trait Implementations§
Source§impl Clone for ChatOptions
impl Clone for ChatOptions
Source§impl Debug for ChatOptions
impl Debug for ChatOptions
Source§impl Default for ChatOptions
impl Default for ChatOptions
Source§impl PartialEq for ChatOptions
impl PartialEq for ChatOptions
Source§impl Serialize for ChatOptions
impl Serialize for ChatOptions
impl StructuralPartialEq for ChatOptions
Auto Trait Implementations§
impl Freeze for ChatOptions
impl RefUnwindSafe for ChatOptions
impl Send for ChatOptions
impl Sync for ChatOptions
impl Unpin for ChatOptions
impl UnsafeUnpin for ChatOptions
impl UnwindSafe for ChatOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more