Skip to content

Commit d210ee3

Browse files
chore(api): updates to supported Voice IDs (#64)
1 parent e30e75e commit d210ee3

24 files changed

+226
-96
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 80
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
3-
openapi_spec_hash: 0c255269b89767eae26f4d4dc22d3cbd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
3+
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
44
config_hash: d36e491b0afc4f79e3afad4b3c9bec70

lib/openai/models/audio/speech_create_params.rb

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class SpeechCreateParams < OpenAI::BaseModel
2323

2424
# @!attribute voice
2525
# The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
26-
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
27-
# voices are available in the
26+
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
27+
# `verse`. Previews of the voices are available in the
2828
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
2929
#
30-
# @return [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
31-
required :voice, enum: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice }
30+
# @return [String, Symbol]
31+
required :voice, union: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice }
3232

3333
# @!attribute [r] instructions
3434
# Control the voice of your generated audio with additional instructions. Does not
@@ -66,7 +66,7 @@ class SpeechCreateParams < OpenAI::BaseModel
6666
# @!parse
6767
# # @param input [String]
6868
# # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel]
69-
# # @param voice [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
69+
# # @param voice [String, Symbol]
7070
# # @param instructions [String]
7171
# # @param response_format [Symbol, OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat]
7272
# # @param speed [Float]
@@ -92,27 +92,55 @@ module Model
9292
end
9393

9494
# The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
95-
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
96-
# voices are available in the
95+
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
96+
# `verse`. Previews of the voices are available in the
9797
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
9898
module Voice
99-
extend OpenAI::Enum
99+
extend OpenAI::Union
100+
101+
# @!group
100102

101103
ALLOY = :alloy
102104
ASH = :ash
105+
BALLAD = :ballad
103106
CORAL = :coral
104107
ECHO = :echo
105108
FABLE = :fable
106109
ONYX = :onyx
107110
NOVA = :nova
108111
SAGE = :sage
109112
SHIMMER = :shimmer
113+
VERSE = :verse
110114

111-
finalize!
115+
# @!endgroup
116+
117+
variant String
118+
119+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ALLOY
120+
121+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ASH
122+
123+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::BALLAD
124+
125+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::CORAL
126+
127+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ECHO
128+
129+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::FABLE
130+
131+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::ONYX
132+
133+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::NOVA
134+
135+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::SAGE
136+
137+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::SHIMMER
138+
139+
variant const: OpenAI::Models::Audio::SpeechCreateParams::Voice::VERSE
112140

113141
# @!parse
114-
# # @return [Array<Symbol>]
115-
# def self.values; end
142+
# # @return [Array(String, Symbol)]
143+
# def self.variants; end
116144
end
117145

118146
# The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,

lib/openai/models/chat/chat_completion_audio_param.rb

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ class ChatCompletionAudioParam < OpenAI::BaseModel
1515
# The voice the model uses to respond. Supported voices are `alloy`, `ash`,
1616
# `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
1717
#
18-
# @return [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
19-
required :voice, enum: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice }
18+
# @return [String, Symbol]
19+
required :voice, union: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice }
2020

2121
# @!parse
2222
# # Parameters for audio output. Required when audio output is requested with
2323
# # `modalities: ["audio"]`.
2424
# # [Learn more](https://platform.openai.com/docs/guides/audio).
2525
# #
2626
# # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format]
27-
# # @param voice [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
27+
# # @param voice [String, Symbol]
2828
# #
2929
# def initialize(format_:, voice:, **) = super
3030

@@ -51,22 +51,51 @@ module Format
5151
# The voice the model uses to respond. Supported voices are `alloy`, `ash`,
5252
# `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
5353
module Voice
54-
extend OpenAI::Enum
54+
extend OpenAI::Union
55+
56+
# @!group
5557

5658
ALLOY = :alloy
5759
ASH = :ash
5860
BALLAD = :ballad
5961
CORAL = :coral
6062
ECHO = :echo
63+
FABLE = :fable
64+
ONYX = :onyx
65+
NOVA = :nova
6166
SAGE = :sage
6267
SHIMMER = :shimmer
6368
VERSE = :verse
6469

65-
finalize!
70+
# @!endgroup
71+
72+
variant String
73+
74+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ALLOY
75+
76+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ASH
77+
78+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::BALLAD
79+
80+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::CORAL
81+
82+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ECHO
83+
84+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::FABLE
85+
86+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ONYX
87+
88+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::NOVA
89+
90+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::SAGE
91+
92+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::SHIMMER
93+
94+
variant const: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::VERSE
6695

6796
# @!parse
68-
# # @return [Array<Symbol>]
69-
# def self.values; end
97+
# # @return [Array(String, Symbol)]
98+
# def self.variants; end
7099
end
71100
end
72101
end

lib/openai/models/responses/input_item_list_params.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ class InputItemListParams < OpenAI::BaseModel
2828
# # @return [String]
2929
# attr_writer :before
3030

31+
# @!attribute [r] include
32+
# Additional fields to include in the response. See the `include` parameter for
33+
# Response creation above for more information.
34+
#
35+
# @return [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
36+
optional :include, -> { OpenAI::ArrayOf[enum: OpenAI::Models::Responses::ResponseIncludable] }
37+
38+
# @!parse
39+
# # @return [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>]
40+
# attr_writer :include
41+
3142
# @!attribute [r] limit
3243
# A limit on the number of objects to be returned. Limit can range between 1 and
3344
# 100, and the default is 20.
@@ -55,11 +66,12 @@ class InputItemListParams < OpenAI::BaseModel
5566
# @!parse
5667
# # @param after [String]
5768
# # @param before [String]
69+
# # @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>]
5870
# # @param limit [Integer]
5971
# # @param order [Symbol, OpenAI::Models::Responses::InputItemListParams::Order]
6072
# # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
6173
# #
62-
# def initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}, **) = super
74+
# def initialize(after: nil, before: nil, include: nil, limit: nil, order: nil, request_options: {}, **) = super
6375

6476
# def initialize: (Hash | OpenAI::BaseModel) -> void
6577

lib/openai/models/responses/response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class Response < OpenAI::BaseModel
3333
# context.
3434
#
3535
# When using along with `previous_response_id`, the instructions from a previous
36-
# response will be not be carried over to the next response. This makes it simple
37-
# to swap out system (or developer) messages in new responses.
36+
# response will not be carried over to the next response. This makes it simple to
37+
# swap out system (or developer) messages in new responses.
3838
#
3939
# @return [String, nil]
4040
required :instructions, String, nil?: true

lib/openai/models/responses/response_create_params.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class ResponseCreateParams < OpenAI::BaseModel
5050
# context.
5151
#
5252
# When using along with `previous_response_id`, the instructions from a previous
53-
# response will be not be carried over to the next response. This makes it simple
54-
# to swap out system (or developer) messages in new responses.
53+
# response will not be carried over to the next response. This makes it simple to
54+
# swap out system (or developer) messages in new responses.
5555
#
5656
# @return [String, nil]
5757
optional :instructions, String, nil?: true

lib/openai/models/responses/response_format_text_json_schema_config.rb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ module OpenAI
44
module Models
55
module Responses
66
class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel
7+
# @!attribute name
8+
# The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
9+
# and dashes, with a maximum length of 64.
10+
#
11+
# @return [String]
12+
required :name, String
13+
714
# @!attribute schema
815
# The schema for the response format, described as a JSON Schema object. Learn how
916
# to build JSON schemas [here](https://json-schema.org/).
@@ -28,17 +35,6 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel
2835
# # @return [String]
2936
# attr_writer :description
3037

31-
# @!attribute [r] name
32-
# The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
33-
# and dashes, with a maximum length of 64.
34-
#
35-
# @return [String, nil]
36-
optional :name, String
37-
38-
# @!parse
39-
# # @return [String]
40-
# attr_writer :name
41-
4238
# @!attribute strict
4339
# Whether to enable strict schema adherence when generating the output. If set to
4440
# true, the model will always follow the exact schema defined in the `schema`
@@ -54,13 +50,13 @@ class ResponseFormatTextJSONSchemaConfig < OpenAI::BaseModel
5450
# # more about
5551
# # [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
5652
# #
53+
# # @param name [String]
5754
# # @param schema [Hash{Symbol=>Object}]
5855
# # @param description [String]
59-
# # @param name [String]
6056
# # @param strict [Boolean, nil]
6157
# # @param type [Symbol, :json_schema]
6258
# #
63-
# def initialize(schema:, description: nil, name: nil, strict: nil, type: :json_schema, **) = super
59+
# def initialize(name:, schema:, description: nil, strict: nil, type: :json_schema, **) = super
6460

6561
# def initialize: (Hash | OpenAI::BaseModel) -> void
6662
end

lib/openai/resources/audio/speech.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class Speech
1313
# @option params [String, Symbol, OpenAI::Models::Audio::SpeechModel] :model One of the available [TTS models](https://platform.openai.com/docs/models#tts):
1414
# `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
1515
#
16-
# @option params [Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] :voice The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
17-
# `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
18-
# voices are available in the
16+
# @option params [String, Symbol] :voice The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
17+
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
18+
# `verse`. Previews of the voices are available in the
1919
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
2020
#
2121
# @option params [String] :instructions Control the voice of your generated audio with additional instructions. Does not

lib/openai/resources/responses.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class Responses
4949
# context.
5050
#
5151
# When using along with `previous_response_id`, the instructions from a previous
52-
# response will be not be carried over to the next response. This makes it simple
53-
# to swap out system (or developer) messages in new responses.
52+
# response will not be carried over to the next response. This makes it simple to
53+
# swap out system (or developer) messages in new responses.
5454
#
5555
# @option params [Integer, nil] :max_output_tokens An upper bound for the number of tokens that can be generated for a response,
5656
# including visible output tokens and
@@ -185,8 +185,8 @@ def create(params)
185185
# context.
186186
#
187187
# When using along with `previous_response_id`, the instructions from a previous
188-
# response will be not be carried over to the next response. This makes it simple
189-
# to swap out system (or developer) messages in new responses.
188+
# response will not be carried over to the next response. This makes it simple to
189+
# swap out system (or developer) messages in new responses.
190190
#
191191
# @option params [Integer, nil] :max_output_tokens An upper bound for the number of tokens that can be generated for a response,
192192
# including visible output tokens and

lib/openai/resources/responses/input_items.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class InputItems
1414
#
1515
# @option params [String] :before An item ID to list items before, used in pagination.
1616
#
17+
# @option params [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>] :include Additional fields to include in the response. See the `include` parameter for
18+
# Response creation above for more information.
19+
#
1720
# @option params [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and
1821
# 100, and the default is 20.
1922
#

0 commit comments

Comments
 (0)