pub enum AssistantsApiResponseFormatOption {
Auto,
None,
Format(AssistantsApiResponseFormat),
}
Expand description
Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106
.
Setting to { "type": "json_object" }
enables JSON mode, which guarantees the message the model generates is valid JSON.
Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason="length"
, which indicates the generation exceeded max_tokens
or the conversation exceeded the max context length.
Variants§
Trait Implementations§
source§impl Clone for AssistantsApiResponseFormatOption
impl Clone for AssistantsApiResponseFormatOption
source§fn clone(&self) -> AssistantsApiResponseFormatOption
fn clone(&self) -> AssistantsApiResponseFormatOption
Returns a copy 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 Default for AssistantsApiResponseFormatOption
impl Default for AssistantsApiResponseFormatOption
source§fn default() -> AssistantsApiResponseFormatOption
fn default() -> AssistantsApiResponseFormatOption
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for AssistantsApiResponseFormatOption
impl<'de> Deserialize<'de> for AssistantsApiResponseFormatOption
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for AssistantsApiResponseFormatOption
impl PartialEq for AssistantsApiResponseFormatOption
source§fn eq(&self, other: &AssistantsApiResponseFormatOption) -> bool
fn eq(&self, other: &AssistantsApiResponseFormatOption) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AssistantsApiResponseFormatOption
Auto Trait Implementations§
impl Freeze for AssistantsApiResponseFormatOption
impl RefUnwindSafe for AssistantsApiResponseFormatOption
impl Send for AssistantsApiResponseFormatOption
impl Sync for AssistantsApiResponseFormatOption
impl Unpin for AssistantsApiResponseFormatOption
impl UnwindSafe for AssistantsApiResponseFormatOption
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)