Method: OpenAI::Helpers::StructuredOutput::BaseModel.optional

Defined in:
lib/openai/helpers/structured_output/base_model.rb

.optionalvoid

Raises:

  • (RuntimeError)


68
69
70
71
72
73
# File 'lib/openai/helpers/structured_output/base_model.rb', line 68

def optional(...)
  # rubocop:disable Layout/LineLength
  message = "`optional` is not supported for structured output APIs, use `#required` with `nil?: true` instead"
  # rubocop:enable Layout/LineLength
  raise RuntimeError.new(message)
end