Class: OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig
- Defined in:
- lib/openai/models/responses/response_format_text_json_schema_config.rb,
sig/openai/models/responses/response_format_text_json_schema_config.rbs
Instance Attribute Summary collapse
-
#description ⇒ String?
A description of what the response format is for, used by the model to determine how to respond in the format.
-
#name ⇒ String
The name of the response format.
-
#schema ⇒ ::Hash[Symbol, top]
The schema for the response format, described as a JSON Schema object.
-
#strict ⇒ Boolean?
Whether to enable strict schema adherence when generating the output.
-
#type ⇒ :json_schema
The type of response format being defined.
Attributes inherited from Internal::Type::BaseModel
Instance Method Summary collapse
- #initialize(name:, schema:, description: nil, strict: nil, type: :json_schema) ⇒ Object constructor
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(name:, schema:, description: nil, strict: nil, type: :json_schema) ⇒ Object
|
|
# File 'lib/openai/models/responses/response_format_text_json_schema_config.rb', line 52
|
Instance Attribute Details
#description ⇒ String?
A description of what the response format is for, used by the model to determine how to respond in the format.
40 |
# File 'lib/openai/models/responses/response_format_text_json_schema_config.rb', line 40 optional :description, String |
#name ⇒ String
The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
12 |
# File 'lib/openai/models/responses/response_format_text_json_schema_config.rb', line 12 required :name, String |
#schema ⇒ ::Hash[Symbol, top]
The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
19 20 21 22 23 24 25 26 27 |
# File 'lib/openai/models/responses/response_format_text_json_schema_config.rb', line 19 required( :schema, union: -> { OpenAI::UnionOf[ OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], OpenAI::StructuredOutput::JsonSchemaConverter ] } ) |
#strict ⇒ Boolean?
Whether to enable strict schema adherence when generating the output. If set to
true, the model will always follow the exact schema defined in the schema
field. Only a subset of JSON Schema is supported when strict is true. To
learn more, read the
Structured Outputs guide.
50 |
# File 'lib/openai/models/responses/response_format_text_json_schema_config.rb', line 50 optional :strict, OpenAI::Internal::Type::Boolean, nil?: true |
#type ⇒ :json_schema
The type of response format being defined. Always json_schema.
33 |
# File 'lib/openai/models/responses/response_format_text_json_schema_config.rb', line 33 required :type, const: :json_schema |
Instance Method Details
#to_hash ⇒ {
65 |
# File 'sig/openai/models/responses/response_format_text_json_schema_config.rbs', line 65
def to_hash: -> {
|