From c729b69a6bf4839b0deb1d4c6eeeb3c6e9077728 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 20:33:19 +0000 Subject: [PATCH] chore(api): updates to supported Voice IDs --- .stats.yml | 4 +- .../models/audio/speech_create_params.rb | 50 +++++++++++++++---- .../chat/chat_completion_audio_param.rb | 43 +++++++++++++--- .../responses/input_item_list_params.rb | 14 +++++- lib/openai/models/responses/response.rb | 4 +- .../responses/response_create_params.rb | 4 +- ...response_format_text_json_schema_config.rb | 22 ++++---- lib/openai/resources/audio/speech.rb | 6 +-- lib/openai/resources/responses.rb | 8 +-- lib/openai/resources/responses/input_items.rb | 3 ++ .../models/audio/speech_create_params.rbi | 22 ++++---- .../chat/chat_completion_audio_param.rbi | 15 +++--- .../responses/input_item_list_params.rbi | 12 ++++- rbi/lib/openai/models/responses/response.rbi | 4 +- .../responses/response_create_params.rbi | 4 +- ...esponse_format_text_json_schema_config.rbi | 19 +++---- rbi/lib/openai/resources/audio/speech.rbi | 6 +-- rbi/lib/openai/resources/responses.rbi | 8 +-- .../resources/responses/input_items.rbi | 4 ++ .../models/audio/speech_create_params.rbs | 21 ++++++-- .../chat/chat_completion_audio_param.rbs | 30 +++++++++-- .../responses/input_item_list_params.rbs | 8 +++ ...esponse_format_text_json_schema_config.rbs | 10 ++-- .../resources/responses/input_items.rbs | 1 + 24 files changed, 226 insertions(+), 96 deletions(-) diff --git a/.stats.yml b/.stats.yml index 766090ae..940027f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 80 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml -openapi_spec_hash: 0c255269b89767eae26f4d4dc22d3cbd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml +openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e config_hash: d36e491b0afc4f79e3afad4b3c9bec70 diff --git a/lib/openai/models/audio/speech_create_params.rb b/lib/openai/models/audio/speech_create_params.rb index 1c0a806a..2c0c03cc 100644 --- a/lib/openai/models/audio/speech_create_params.rb +++ b/lib/openai/models/audio/speech_create_params.rb @@ -23,12 +23,12 @@ class SpeechCreateParams < OpenAI::BaseModel # @!attribute voice # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the - # voices are available in the + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). # - # @return [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] - required :voice, enum: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice } + # @return [String, Symbol] + required :voice, union: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice } # @!attribute [r] instructions # Control the voice of your generated audio with additional instructions. Does not @@ -66,7 +66,7 @@ class SpeechCreateParams < OpenAI::BaseModel # @!parse # # @param input [String] # # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] - # # @param voice [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] + # # @param voice [String, Symbol] # # @param instructions [String] # # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat] # # @param speed [Float] @@ -92,14 +92,17 @@ module Model end # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the - # voices are available in the + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). module Voice - extend OpenAI::Enum + extend OpenAI::Union + + # @!group ALLOY = :alloy ASH = :ash + BALLAD = :ballad CORAL = :coral ECHO = :echo FABLE = :fable @@ -107,12 +110,37 @@ module Voice NOVA = :nova SAGE = :sage SHIMMER = :shimmer + VERSE = :verse - finalize! + # @!endgroup + + variant String + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ALLOY + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ASH + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::BALLAD + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::CORAL + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ECHO + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::FABLE + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ONYX + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::NOVA + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::SAGE + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::SHIMMER + + variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::VERSE # @!parse - # # @return [Array] - # def self.values; end + # # @return [Array(String, Symbol)] + # def self.variants; end end # The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, diff --git a/lib/openai/models/chat/chat_completion_audio_param.rb b/lib/openai/models/chat/chat_completion_audio_param.rb index 7de20292..f3800a67 100644 --- a/lib/openai/models/chat/chat_completion_audio_param.rb +++ b/lib/openai/models/chat/chat_completion_audio_param.rb @@ -15,8 +15,8 @@ class ChatCompletionAudioParam < OpenAI::BaseModel # The voice the model uses to respond. Supported voices are `alloy`, `ash`, # `ballad`, `coral`, `echo`, `sage`, and `shimmer`. # - # @return [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] - required :voice, enum: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice } + # @return [String, Symbol] + required :voice, union: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice } # @!parse # # Parameters for audio output. Required when audio output is requested with @@ -24,7 +24,7 @@ class ChatCompletionAudioParam < OpenAI::BaseModel # # [Learn more](https://platform.openai.com/docs/guides/audio). # # # # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format] - # # @param voice [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] + # # @param voice [String, Symbol] # # # def initialize(format_:, voice:, **) = super @@ -51,22 +51,51 @@ module Format # The voice the model uses to respond. Supported voices are `alloy`, `ash`, # `ballad`, `coral`, `echo`, `sage`, and `shimmer`. module Voice - extend OpenAI::Enum + extend OpenAI::Union + + # @!group ALLOY = :alloy ASH = :ash BALLAD = :ballad CORAL = :coral ECHO = :echo + FABLE = :fable + ONYX = :onyx + NOVA = :nova SAGE = :sage SHIMMER = :shimmer VERSE = :verse - finalize! + # @!endgroup + + variant String + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ALLOY + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ASH + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::BALLAD + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::CORAL + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ECHO + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::FABLE + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ONYX + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::NOVA + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::SAGE + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::SHIMMER + + variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::VERSE # @!parse - # # @return [Array] - # def self.values; end + # # @return [Array(String, Symbol)] + # def self.variants; end end end end diff --git a/lib/openai/models/responses/input_item_list_params.rb b/lib/openai/models/responses/input_item_list_params.rb index d55641a5..d50fc83d 100644 --- a/lib/openai/models/responses/input_item_list_params.rb +++ b/lib/openai/models/responses/input_item_list_params.rb @@ -28,6 +28,17 @@ class InputItemListParams < OpenAI::BaseModel # # @return [String] # attr_writer :before + # @!attribute [r] include + # Additional fields to include in the response. See the `include` parameter for + # Response creation above for more information. + # + # @return [Array, nil] + optional :include, -> { OpenAI::ArrayOf[enum: OpenAI::Models::Responses::ResponseIncludable] } + + # @!parse + # # @return [Array] + # attr_writer :include + # @!attribute [r] limit # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. @@ -55,11 +66,12 @@ class InputItemListParams < OpenAI::BaseModel # @!parse # # @param after [String] # # @param before [String] + # # @param include [Array] # # @param limit [Integer] # # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order] # # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] # # - # def initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}, **) = super + # def initialize(after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}, **) = super # def initialize: (Hash | OpenAI::BaseModel) -> void diff --git a/lib/openai/models/responses/response.rb b/lib/openai/models/responses/response.rb index 35ed1c06..296c2d41 100644 --- a/lib/openai/models/responses/response.rb +++ b/lib/openai/models/responses/response.rb @@ -33,8 +33,8 @@ class Response < OpenAI::BaseModel # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. # # @return [String, nil] required :instructions, String, nil?: true diff --git a/lib/openai/models/responses/response_create_params.rb b/lib/openai/models/responses/response_create_params.rb index 7557e478..a4469d5c 100644 --- a/lib/openai/models/responses/response_create_params.rb +++ b/lib/openai/models/responses/response_create_params.rb @@ -50,8 +50,8 @@ class ResponseCreateParams < OpenAI::BaseModel # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. # # @return [String, nil] optional :instructions, String, nil?: true diff --git a/lib/openai/models/responses/response_format_text_json_schema_config.rb b/lib/openai/models/responses/response_format_text_json_schema_config.rb index 34aefbc9..06e3bf5e 100644 --- a/lib/openai/models/responses/response_format_text_json_schema_config.rb +++ b/lib/openai/models/responses/response_format_text_json_schema_config.rb @@ -4,6 +4,13 @@ module OpenAI module Models module Responses class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel + # @!attribute name + # 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. + # + # @return [String] + required :name, String + # @!attribute schema # The schema for the response format, described as a JSON Schema object. Learn how # to build JSON schemas [here](https://json-schema.org/). @@ -28,17 +35,6 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel # # @return [String] # attr_writer :description - # @!attribute [r] name - # 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. - # - # @return [String, nil] - optional :name, String - - # @!parse - # # @return [String] - # attr_writer :name - # @!attribute strict # 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` @@ -54,13 +50,13 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel # # more about # # [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). # # + # # @param name [String] # # @param schema [Hash{Symbol=>Object}] # # @param description [String] - # # @param name [String] # # @param strict [Boolean, nil] # # @param type [Symbol, :json_schema] # # - # def initialize(schema:, description: nil, name: nil, strict: nil, type: :json_schema, **) = super + # def initialize(name:, schema:, description: nil, strict: nil, type: :json_schema, **) = super # def initialize: (Hash | OpenAI::BaseModel) -> void end diff --git a/lib/openai/resources/audio/speech.rb b/lib/openai/resources/audio/speech.rb index b5b584fe..cbffafe3 100644 --- a/lib/openai/resources/audio/speech.rb +++ b/lib/openai/resources/audio/speech.rb @@ -13,9 +13,9 @@ class Speech # @option params [String, Symbol, OpenAI::Models::Audio::SpeechModel] :model One of the available [TTS models](https://platform.openai.com/docs/models#tts): # `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. # - # @option params [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] :voice The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the - # voices are available in the + # @option params [String, Symbol] :voice The voice to use when generating the audio. Supported voices are `alloy`, `ash`, + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). # # @option params [String] :instructions Control the voice of your generated audio with additional instructions. Does not diff --git a/lib/openai/resources/responses.rb b/lib/openai/resources/responses.rb index f12fe46e..e0a7bc26 100644 --- a/lib/openai/resources/responses.rb +++ b/lib/openai/resources/responses.rb @@ -49,8 +49,8 @@ class Responses # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. # # @option params [Integer, nil] :max_output_tokens An upper bound for the number of tokens that can be generated for a response, # including visible output tokens and @@ -185,8 +185,8 @@ def create(params) # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. # # @option params [Integer, nil] :max_output_tokens An upper bound for the number of tokens that can be generated for a response, # including visible output tokens and diff --git a/lib/openai/resources/responses/input_items.rb b/lib/openai/resources/responses/input_items.rb index ff8ff1d0..ece1f2a1 100644 --- a/lib/openai/resources/responses/input_items.rb +++ b/lib/openai/resources/responses/input_items.rb @@ -14,6 +14,9 @@ class InputItems # # @option params [String] :before An item ID to list items before, used in pagination. # + # @option params [Array] :include Additional fields to include in the response. See the `include` parameter for + # Response creation above for more information. + # # @option params [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. # diff --git a/rbi/lib/openai/models/audio/speech_create_params.rbi b/rbi/lib/openai/models/audio/speech_create_params.rbi index f5f11b88..014716e8 100644 --- a/rbi/lib/openai/models/audio/speech_create_params.rbi +++ b/rbi/lib/openai/models/audio/speech_create_params.rbi @@ -17,10 +17,10 @@ module OpenAI attr_accessor :model # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the - # voices are available in the + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). - sig { returns(OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol) } + sig { returns(T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol)) } attr_accessor :voice # Control the voice of your generated audio with additional instructions. Does not @@ -51,7 +51,7 @@ module OpenAI params( input: String, model: T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol), - voice: OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol, + voice: T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol), instructions: String, response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol, speed: Float, @@ -68,7 +68,7 @@ module OpenAI { input: String, model: T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol), - voice: OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol, + voice: T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol), instructions: String, response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol, speed: Float, @@ -90,17 +90,18 @@ module OpenAI end # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the - # voices are available in the + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). module Voice - extend OpenAI::Enum + extend OpenAI::Union TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice) } OrSymbol = T.type_alias { T.any(Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) } ALLOY = T.let(:alloy, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) ASH = T.let(:ash, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) + BALLAD = T.let(:ballad, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) CORAL = T.let(:coral, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) ECHO = T.let(:echo, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) FABLE = T.let(:fable, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) @@ -108,9 +109,10 @@ module OpenAI NOVA = T.let(:nova, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) SAGE = T.let(:sage, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) SHIMMER = T.let(:shimmer, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) + VERSE = T.let(:verse, OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::Models::Audio::SpeechCreateParams::Voice::TaggedSymbol]) } - def self.values + sig { override.returns([String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol]) } + def self.variants end end diff --git a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi b/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi index 1b96a01d..abac1261 100644 --- a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi @@ -11,7 +11,7 @@ module OpenAI # The voice the model uses to respond. Supported voices are `alloy`, `ash`, # `ballad`, `coral`, `echo`, `sage`, and `shimmer`. - sig { returns(OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol) } + sig { returns(T.any(String, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol)) } attr_accessor :voice # Parameters for audio output. Required when audio output is requested with @@ -20,7 +20,7 @@ module OpenAI sig do params( format_: OpenAI::Models::Chat::ChatCompletionAudioParam::Format::OrSymbol, - voice: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol + voice: T.any(String, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol) ) .returns(T.attached_class) end @@ -32,7 +32,7 @@ module OpenAI .returns( { format_: OpenAI::Models::Chat::ChatCompletionAudioParam::Format::OrSymbol, - voice: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol + voice: T.any(String, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol) } ) end @@ -62,7 +62,7 @@ module OpenAI # The voice the model uses to respond. Supported voices are `alloy`, `ash`, # `ballad`, `coral`, `echo`, `sage`, and `shimmer`. module Voice - extend OpenAI::Enum + extend OpenAI::Union TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice) } OrSymbol = @@ -73,12 +73,15 @@ module OpenAI BALLAD = T.let(:ballad, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) CORAL = T.let(:coral, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) ECHO = T.let(:echo, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) + FABLE = T.let(:fable, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) + ONYX = T.let(:onyx, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) + NOVA = T.let(:nova, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) SAGE = T.let(:sage, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) SHIMMER = T.let(:shimmer, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) VERSE = T.let(:verse, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol]) } - def self.values + sig { override.returns([String, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol]) } + def self.variants end end end diff --git a/rbi/lib/openai/models/responses/input_item_list_params.rbi b/rbi/lib/openai/models/responses/input_item_list_params.rbi index be14d1bd..36ee8426 100644 --- a/rbi/lib/openai/models/responses/input_item_list_params.rbi +++ b/rbi/lib/openai/models/responses/input_item_list_params.rbi @@ -21,6 +21,14 @@ module OpenAI sig { params(before: String).void } attr_writer :before + # Additional fields to include in the response. See the `include` parameter for + # Response creation above for more information. + sig { returns(T.nilable(T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol])) } + attr_reader :include + + sig { params(include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol]).void } + attr_writer :include + # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } @@ -43,13 +51,14 @@ module OpenAI params( after: String, before: String, + include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol], limit: Integer, order: OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol, request_options: T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash) ) .returns(T.attached_class) end - def self.new(after: nil, before: nil, limit: nil, order: nil, request_options: {}) + def self.new(after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}) end sig do @@ -58,6 +67,7 @@ module OpenAI { after: String, before: String, + include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol], limit: Integer, order: OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol, request_options: OpenAI::RequestOptions diff --git a/rbi/lib/openai/models/responses/response.rbi b/rbi/lib/openai/models/responses/response.rbi index 140d38a3..db73d16a 100644 --- a/rbi/lib/openai/models/responses/response.rbi +++ b/rbi/lib/openai/models/responses/response.rbi @@ -35,8 +35,8 @@ module OpenAI # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. sig { returns(T.nilable(String)) } attr_accessor :instructions diff --git a/rbi/lib/openai/models/responses/response_create_params.rbi b/rbi/lib/openai/models/responses/response_create_params.rbi index ace43a29..3204e5db 100644 --- a/rbi/lib/openai/models/responses/response_create_params.rbi +++ b/rbi/lib/openai/models/responses/response_create_params.rbi @@ -63,8 +63,8 @@ module OpenAI # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. sig { returns(T.nilable(String)) } attr_accessor :instructions diff --git a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi b/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi index 8b4a57ef..8d657f44 100644 --- a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi +++ b/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi @@ -4,6 +4,11 @@ module OpenAI module Models module Responses class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel + # 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. + sig { returns(String) } + attr_accessor :name + # The schema for the response format, described as a JSON Schema object. Learn how # to build JSON schemas [here](https://json-schema.org/). sig { returns(T::Hash[Symbol, T.anything]) } @@ -21,14 +26,6 @@ module OpenAI sig { params(description: String).void } attr_writer :description - # 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. - sig { returns(T.nilable(String)) } - attr_reader :name - - sig { params(name: String).void } - attr_writer :name - # 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 @@ -42,25 +39,25 @@ module OpenAI # [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). sig do params( + name: String, schema: T::Hash[Symbol, T.anything], description: String, - name: String, strict: T.nilable(T::Boolean), type: Symbol ) .returns(T.attached_class) end - def self.new(schema:, description: nil, name: nil, strict: nil, type: :json_schema) + def self.new(name:, schema:, description: nil, strict: nil, type: :json_schema) end sig do override .returns( { + name: String, schema: T::Hash[Symbol, T.anything], type: Symbol, description: String, - name: String, strict: T.nilable(T::Boolean) } ) diff --git a/rbi/lib/openai/resources/audio/speech.rbi b/rbi/lib/openai/resources/audio/speech.rbi index 5d7311e5..2c23fe1f 100644 --- a/rbi/lib/openai/resources/audio/speech.rbi +++ b/rbi/lib/openai/resources/audio/speech.rbi @@ -9,7 +9,7 @@ module OpenAI params( input: String, model: T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol), - voice: OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol, + voice: T.any(String, OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol), instructions: String, response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol, speed: Float, @@ -24,8 +24,8 @@ module OpenAI # `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. model:, # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the - # voices are available in the + # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and + # `verse`. Previews of the voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). voice:, # Control the voice of your generated audio with additional instructions. Does not diff --git a/rbi/lib/openai/resources/responses.rbi b/rbi/lib/openai/resources/responses.rbi index 6ddca1da..1c7a99ac 100644 --- a/rbi/lib/openai/resources/responses.rbi +++ b/rbi/lib/openai/resources/responses.rbi @@ -102,8 +102,8 @@ module OpenAI # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. instructions: nil, # An upper bound for the number of tokens that can be generated for a response, # including visible output tokens and @@ -317,8 +317,8 @@ module OpenAI # context. # # When using along with `previous_response_id`, the instructions from a previous - # response will be not be carried over to the next response. This makes it simple - # to swap out system (or developer) messages in new responses. + # response will not be carried over to the next response. This makes it simple to + # swap out system (or developer) messages in new responses. instructions: nil, # An upper bound for the number of tokens that can be generated for a response, # including visible output tokens and diff --git a/rbi/lib/openai/resources/responses/input_items.rbi b/rbi/lib/openai/resources/responses/input_items.rbi index d1663648..35fb21c7 100644 --- a/rbi/lib/openai/resources/responses/input_items.rbi +++ b/rbi/lib/openai/resources/responses/input_items.rbi @@ -10,6 +10,7 @@ module OpenAI response_id: String, after: String, before: String, + include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol], limit: Integer, order: OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol, request_options: T.nilable(T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) @@ -36,6 +37,9 @@ module OpenAI after: nil, # An item ID to list items before, used in pagination. before: nil, + # Additional fields to include in the response. See the `include` parameter for + # Response creation above for more information. + include: nil, # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. limit: nil, diff --git a/sig/openai/models/audio/speech_create_params.rbs b/sig/openai/models/audio/speech_create_params.rbs index 2b0a7895..99ceae76 100644 --- a/sig/openai/models/audio/speech_create_params.rbs +++ b/sig/openai/models/audio/speech_create_params.rbs @@ -57,8 +57,10 @@ module OpenAI end type voice = - :alloy + String + | :alloy | :ash + | :ballad | :coral | :echo | :fable @@ -66,12 +68,14 @@ module OpenAI | :nova | :sage | :shimmer + | :verse module Voice - extend OpenAI::Enum + extend OpenAI::Union ALLOY: :alloy ASH: :ash + BALLAD: :ballad CORAL: :coral ECHO: :echo FABLE: :fable @@ -79,8 +83,19 @@ module OpenAI NOVA: :nova SAGE: :sage SHIMMER: :shimmer + VERSE: :verse - def self?.values: -> ::Array[OpenAI::Models::Audio::SpeechCreateParams::voice] + def self?.variants: -> [String, (:alloy + | :ash + | :ballad + | :coral + | :echo + | :fable + | :onyx + | :nova + | :sage + | :shimmer + | :verse)] end type response_format = :mp3 | :opus | :aac | :flac | :wav | :pcm diff --git a/sig/openai/models/chat/chat_completion_audio_param.rbs b/sig/openai/models/chat/chat_completion_audio_param.rbs index f5963ec9..3f277ae1 100644 --- a/sig/openai/models/chat/chat_completion_audio_param.rbs +++ b/sig/openai/models/chat/chat_completion_audio_param.rbs @@ -36,21 +36,45 @@ module OpenAI end type voice = - :alloy | :ash | :ballad | :coral | :echo | :sage | :shimmer | :verse + String + | :alloy + | :ash + | :ballad + | :coral + | :echo + | :fable + | :onyx + | :nova + | :sage + | :shimmer + | :verse module Voice - extend OpenAI::Enum + extend OpenAI::Union ALLOY: :alloy ASH: :ash BALLAD: :ballad CORAL: :coral ECHO: :echo + FABLE: :fable + ONYX: :onyx + NOVA: :nova SAGE: :sage SHIMMER: :shimmer VERSE: :verse - def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletionAudioParam::voice] + def self?.variants: -> [String, (:alloy + | :ash + | :ballad + | :coral + | :echo + | :fable + | :onyx + | :nova + | :sage + | :shimmer + | :verse)] end end end diff --git a/sig/openai/models/responses/input_item_list_params.rbs b/sig/openai/models/responses/input_item_list_params.rbs index 1a91bd7e..da58932d 100644 --- a/sig/openai/models/responses/input_item_list_params.rbs +++ b/sig/openai/models/responses/input_item_list_params.rbs @@ -5,6 +5,7 @@ module OpenAI { after: String, before: String, + include: ::Array[OpenAI::Models::Responses::response_includable], limit: Integer, order: OpenAI::Models::Responses::InputItemListParams::order } @@ -22,6 +23,12 @@ module OpenAI def before=: (String) -> String + attr_reader include: ::Array[OpenAI::Models::Responses::response_includable]? + + def include=: ( + ::Array[OpenAI::Models::Responses::response_includable] + ) -> ::Array[OpenAI::Models::Responses::response_includable] + attr_reader limit: Integer? def limit=: (Integer) -> Integer @@ -35,6 +42,7 @@ module OpenAI def initialize: ( ?after: String, ?before: String, + ?include: ::Array[OpenAI::Models::Responses::response_includable], ?limit: Integer, ?order: OpenAI::Models::Responses::InputItemListParams::order, ?request_options: OpenAI::request_opts diff --git a/sig/openai/models/responses/response_format_text_json_schema_config.rbs b/sig/openai/models/responses/response_format_text_json_schema_config.rbs index a4435499..899ff7bb 100644 --- a/sig/openai/models/responses/response_format_text_json_schema_config.rbs +++ b/sig/openai/models/responses/response_format_text_json_schema_config.rbs @@ -3,14 +3,16 @@ module OpenAI module Responses type response_format_text_json_schema_config = { + name: String, schema: ::Hash[Symbol, top], type: :json_schema, description: String, - name: String, strict: bool? } class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel + attr_accessor name: String + attr_accessor schema: ::Hash[Symbol, top] attr_accessor type: :json_schema @@ -19,16 +21,12 @@ module OpenAI def description=: (String) -> String - attr_reader name: String? - - def name=: (String) -> String - attr_accessor strict: bool? def initialize: ( + name: String, schema: ::Hash[Symbol, top], ?description: String, - ?name: String, ?strict: bool?, ?type: :json_schema ) -> void diff --git a/sig/openai/resources/responses/input_items.rbs b/sig/openai/resources/responses/input_items.rbs index 63b4ed3c..031857d2 100644 --- a/sig/openai/resources/responses/input_items.rbs +++ b/sig/openai/resources/responses/input_items.rbs @@ -6,6 +6,7 @@ module OpenAI String response_id, ?after: String, ?before: String, + ?include: ::Array[OpenAI::Models::Responses::response_includable], ?limit: Integer, ?order: OpenAI::Models::Responses::InputItemListParams::order, ?request_options: OpenAI::request_opts