Enum AssistantsApiResponseFormatOption

Source
pub enum AssistantsApiResponseFormatOption {
    Text(ResponseFormatText),
    Object(ResponseFormatJsonObject),
    Schema(ResponseFormatJsonSchema),
}
Expand description

§on openapi.yaml

AssistantsApiResponseFormatOption:
  description: >
    Specifies the format that the model must output. Compatible with
    [GPT-4o](/docs/models#gpt-4o), [GPT-4
    Turbo](/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models
    since `gpt-3.5-turbo-1106`.


    Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
    Structured Outputs which ensures the model will match your supplied JSON
    schema. Learn more in the [Structured Outputs
    guide](/docs/guides/structured-outputs).


    Setting to `{ "type": "json_object" }` enables JSON mode, which ensures
    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.
  oneOf:
    - type: string
      description: |
        `auto` is the default value
      enum:
        - auto
      x-stainless-const: true
    - $ref: "#/components/schemas/ResponseFormatText"
    - $ref: "#/components/schemas/ResponseFormatJsonObject"
    - $ref: "#/components/schemas/ResponseFormatJsonSchema"

Variants§

Trait Implementations§

Source§

impl Debug for AssistantsApiResponseFormatOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AssistantsApiResponseFormatOption

Source§

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 Serialize for AssistantsApiResponseFormatOption

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,