Module: OpenAI::Models::Responses::ResponseFormatTextConfig

Extended by:
Internal::Type::Union
Defined in:
lib/openai/models/responses/response_format_text_config.rb,
sig/openai/models/responses/response_format_text_config.rbs

Overview

An object specifying the format that the model must output.

Configuring { "type": "json_schema" } enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.

The default format is { "type": "text" } with no additional options.

Not recommended for gpt-4o and newer models:

Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Instance Method Details

#self?.variants::Array[OpenAI::Models::Responses::response_format_text_config]

Returns:

  • (::Array[OpenAI::Models::Responses::response_format_text_config])


12
# File 'sig/openai/models/responses/response_format_text_config.rbs', line 12

def self?.variants: -> ::Array[OpenAI::Models::Responses::response_format_text_config]