Skip to content

Commit e7bacfb

Browse files
fix(api): fix discriminator propertyName for ResponseFormatJsonSchema
1 parent d227b2c commit e7bacfb

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-812a10f8fb54c584efc914422b574cb3f43dc238b5733b13f6a0b2308b7d9910.yml
3-
openapi_spec_hash: 0222041ba12a5ff6b94924a834fa91a2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a4bb37d110a22c2888f53e21281434686a6fffa3e672a40f2503ad9bd2759063.yml
3+
openapi_spec_hash: 2d59eefb494dff4eea8c3d008c7e2070
44
config_hash: 50ee3382a63c021a9f821a935950e926

lib/openai/models/chat/completion_create_params.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,14 @@ module Modality
564564
module ResponseFormat
565565
extend OpenAI::Internal::Type::Union
566566

567+
discriminator :type
568+
567569
# Default response format. Used to generate text responses.
568-
variant -> { OpenAI::ResponseFormatText }
570+
variant :text, -> { OpenAI::ResponseFormatText }
569571

570572
# JSON Schema response format. Used to generate structured JSON responses.
571573
# Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
572-
variant -> { OpenAI::ResponseFormatJSONSchema }
574+
variant :json_schema, -> { OpenAI::ResponseFormatJSONSchema }
573575

574576
# An {OpenAI::BaseModel} can be provided and implicitly converted into {OpenAI::Models::ResponseFormatJSONSchema}.
575577
# See examples for more details.
@@ -581,7 +583,7 @@ module ResponseFormat
581583
# Using `json_schema` is recommended for models that support it. Note that the
582584
# model will not generate JSON without a system or user message instructing it
583585
# to do so.
584-
variant -> { OpenAI::ResponseFormatJSONObject }
586+
variant :json_object, -> { OpenAI::ResponseFormatJSONObject }
585587

586588
# @!method self.variants
587589
# @return [Array(OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject)]

0 commit comments

Comments
 (0)