openai 0.54.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83d02aadc8a7e6f7b37049c3d9f4aeaea7431550be5d59b39125caac69dc0b8d
4
- data.tar.gz: 65952c4730694ec1d6d8e94975574830caaa4b00af59102004c22193eeddd084
3
+ metadata.gz: 1829322792fdc33445abe86fe08267e3b93d183511e2e1651ef6e1cd81ecc1b8
4
+ data.tar.gz: 2b9578ceacd8423c77d35e7c3f0e3f7fb9d56bcd971403a83dedf8bb0cb9fa51
5
5
  SHA512:
6
- metadata.gz: 0cdf744110926dcc10a24efcb6d945f23da0390a72827434ab6b0cd9308e1e5a9f64e6d7f8d304c206c146caf10fc8d06c242c3f6447ed7d052bb60f302f905a
7
- data.tar.gz: 5cc663414eead8566eaefb21714a5fad8e1bbaa5ed5f8b297d4af45909b4cc0ea34d96fa273cc85e587f4fa41cc263b0c5b88db67e4c22e24a10cbb48822165b
6
+ metadata.gz: 6a248621c5aea0ac33ad525d91dfae5e7b9934c18b8e7a172685dade248784c44b7d262ba1575472efdec948be1cc52e4d588845a13a12f2bb87854d196fd095
7
+ data.tar.gz: 1247752dd4600a775ea0d52f977d360348bf0ade61b5274bcd92a135d5a86db2acaf689feb9cd35e58f33db37d246dee6e37a9e0d2c0b4b704fe46920079312f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.55.0 (2026-03-13)
4
+
5
+ Full Changelog: [v0.54.0...v0.55.0](https://github.com/openai/openai-ruby/compare/v0.54.0...v0.55.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** custom voices ([a9f7891](https://github.com/openai/openai-ruby/commit/a9f78916b97e3a59f35dbcac05c725474e6634af))
10
+
3
11
  ## 0.54.0 (2026-03-13)
4
12
 
5
13
  Full Changelog: [v0.53.0...v0.54.0](https://github.com/openai/openai-ruby/compare/v0.53.0...v0.54.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.54.0"
18
+ gem "openai", "~> 0.55.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -24,11 +24,12 @@ module OpenAI
24
24
  # @!attribute voice
25
25
  # The voice to use when generating the audio. Supported built-in voices are
26
26
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
27
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
28
- # in the
27
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
28
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
29
+ # voices are available in the
29
30
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
30
31
  #
31
- # @return [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
32
+ # @return [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID, OpenAI::Models::Audio::SpeechCreateParams::Voice]
32
33
  required :voice, union: -> { OpenAI::Audio::SpeechCreateParams::Voice }
33
34
 
34
35
  # @!attribute instructions
@@ -67,7 +68,7 @@ module OpenAI
67
68
  #
68
69
  # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts):
69
70
  #
70
- # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
71
+ # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
71
72
  #
72
73
  # @param instructions [String] Control the voice of your generated audio with additional instructions. Does not
73
74
  #
@@ -95,8 +96,9 @@ module OpenAI
95
96
 
96
97
  # The voice to use when generating the audio. Supported built-in voices are
97
98
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
98
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
99
- # in the
99
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
100
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
101
+ # voices are available in the
100
102
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
101
103
  module Voice
102
104
  extend OpenAI::Internal::Type::Union
@@ -123,11 +125,33 @@ module OpenAI
123
125
 
124
126
  variant const: -> { OpenAI::Models::Audio::SpeechCreateParams::Voice::CEDAR }
125
127
 
128
+ # Custom voice reference.
129
+ variant -> { OpenAI::Audio::SpeechCreateParams::Voice::ID }
130
+
131
+ class ID < OpenAI::Internal::Type::BaseModel
132
+ # @!attribute id
133
+ # The custom voice ID, e.g. `voice_1234`.
134
+ #
135
+ # @return [String]
136
+ required :id, String
137
+
138
+ # @!method initialize(id:)
139
+ # Custom voice reference.
140
+ #
141
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
142
+ end
143
+
126
144
  # @!method self.variants
127
- # @return [Array(String, Symbol)]
145
+ # @return [Array(String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID)]
128
146
 
129
147
  define_sorbet_constant!(:Variants) do
130
- T.type_alias { T.any(String, OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol) }
148
+ T.type_alias do
149
+ T.any(
150
+ String,
151
+ OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol,
152
+ OpenAI::Audio::SpeechCreateParams::Voice::ID
153
+ )
154
+ end
131
155
  end
132
156
 
133
157
  # @!group
@@ -14,9 +14,10 @@ module OpenAI
14
14
  # @!attribute voice
15
15
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
16
16
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
17
- # `marin`, and `cedar`.
17
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
18
+ # for example `{ "id": "voice_1234" }`.
18
19
  #
19
- # @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
20
+ # @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
20
21
  required :voice, union: -> { OpenAI::Chat::ChatCompletionAudioParam::Voice }
21
22
 
22
23
  # @!method initialize(format_:, voice:)
@@ -29,7 +30,7 @@ module OpenAI
29
30
  #
30
31
  # @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format] Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
31
32
  #
32
- # @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
33
+ # @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported built-in voices are
33
34
 
34
35
  # Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
35
36
  # or `pcm16`.
@@ -51,7 +52,8 @@ module OpenAI
51
52
 
52
53
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
53
54
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
54
- # `marin`, and `cedar`.
55
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
56
+ # for example `{ "id": "voice_1234" }`.
55
57
  #
56
58
  # @see OpenAI::Models::Chat::ChatCompletionAudioParam#voice
57
59
  module Voice
@@ -79,11 +81,33 @@ module OpenAI
79
81
 
80
82
  variant const: -> { OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::CEDAR }
81
83
 
84
+ # Custom voice reference.
85
+ variant -> { OpenAI::Chat::ChatCompletionAudioParam::Voice::ID }
86
+
87
+ class ID < OpenAI::Internal::Type::BaseModel
88
+ # @!attribute id
89
+ # The custom voice ID, e.g. `voice_1234`.
90
+ #
91
+ # @return [String]
92
+ required :id, String
93
+
94
+ # @!method initialize(id:)
95
+ # Custom voice reference.
96
+ #
97
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
98
+ end
99
+
82
100
  # @!method self.variants
83
- # @return [Array(String, Symbol)]
101
+ # @return [Array(String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID)]
84
102
 
85
103
  define_sorbet_constant!(:Variants) do
86
- T.type_alias { T.any(String, OpenAI::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol) }
104
+ T.type_alias do
105
+ T.any(
106
+ String,
107
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol,
108
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID
109
+ )
110
+ end
87
111
  end
88
112
 
89
113
  # @!group
@@ -25,10 +25,12 @@ module OpenAI
25
25
  # @!attribute voice
26
26
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
27
27
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
28
- # `cedar`. Voice cannot be changed during the session once the model has responded
29
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
28
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
29
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
30
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
31
+ # for best quality.
30
32
  #
31
- # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice, nil]
33
+ # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice, nil]
32
34
  optional :voice, union: -> { OpenAI::Realtime::RealtimeAudioConfigOutput::Voice }
33
35
 
34
36
  # @!method initialize(format_: nil, speed: nil, voice: nil)
@@ -39,12 +41,14 @@ module OpenAI
39
41
  #
40
42
  # @param speed [Float] The speed of the model's spoken response as a multiple of the original speed.
41
43
  #
42
- # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
44
+ # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice] The voice the model uses to respond. Supported built-in voices are
43
45
 
44
46
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
45
47
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
46
- # `cedar`. Voice cannot be changed during the session once the model has responded
47
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
48
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
49
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
50
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
51
+ # for best quality.
48
52
  #
49
53
  # @see OpenAI::Models::Realtime::RealtimeAudioConfigOutput#voice
50
54
  module Voice
@@ -72,11 +76,33 @@ module OpenAI
72
76
 
73
77
  variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::CEDAR }
74
78
 
79
+ # Custom voice reference.
80
+ variant -> { OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID }
81
+
82
+ class ID < OpenAI::Internal::Type::BaseModel
83
+ # @!attribute id
84
+ # The custom voice ID, e.g. `voice_1234`.
85
+ #
86
+ # @return [String]
87
+ required :id, String
88
+
89
+ # @!method initialize(id:)
90
+ # Custom voice reference.
91
+ #
92
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
93
+ end
94
+
75
95
  # @!method self.variants
76
- # @return [Array(String, Symbol)]
96
+ # @return [Array(String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID)]
77
97
 
78
98
  define_sorbet_constant!(:Variants) do
79
- T.type_alias { T.any(String, OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol) }
99
+ T.type_alias do
100
+ T.any(
101
+ String,
102
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol,
103
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
104
+ )
105
+ end
80
106
  end
81
107
 
82
108
  # @!group
@@ -25,10 +25,12 @@ module OpenAI
25
25
  # @!attribute voice
26
26
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
27
27
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
28
- # `cedar`. Voice cannot be changed during the session once the model has responded
29
- # with audio at least once.
28
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
29
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
30
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
31
+ # for best quality.
30
32
  #
31
- # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice, nil]
33
+ # @return [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice, nil]
32
34
  optional :voice, union: -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice }
33
35
 
34
36
  # @!method initialize(format_: nil, voice: nil)
@@ -38,12 +40,14 @@ module OpenAI
38
40
  #
39
41
  # @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The format of the output audio.
40
42
  #
41
- # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
43
+ # @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice] The voice the model uses to respond. Supported built-in voices are
42
44
 
43
45
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
44
46
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
45
- # `cedar`. Voice cannot be changed during the session once the model has responded
46
- # with audio at least once.
47
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
48
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
49
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
50
+ # for best quality.
47
51
  #
48
52
  # @see OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output#voice
49
53
  module Voice
@@ -71,11 +75,33 @@ module OpenAI
71
75
 
72
76
  variant const: -> { OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::CEDAR }
73
77
 
78
+ # Custom voice reference.
79
+ variant -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID }
80
+
81
+ class ID < OpenAI::Internal::Type::BaseModel
82
+ # @!attribute id
83
+ # The custom voice ID, e.g. `voice_1234`.
84
+ #
85
+ # @return [String]
86
+ required :id, String
87
+
88
+ # @!method initialize(id:)
89
+ # Custom voice reference.
90
+ #
91
+ # @param id [String] The custom voice ID, e.g. `voice_1234`.
92
+ end
93
+
74
94
  # @!method self.variants
75
- # @return [Array(String, Symbol)]
95
+ # @return [Array(String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID)]
76
96
 
77
97
  define_sorbet_constant!(:Variants) do
78
- T.type_alias { T.any(String, OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol) }
98
+ T.type_alias do
99
+ T.any(
100
+ String,
101
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol,
102
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
103
+ )
104
+ end
79
105
  end
80
106
 
81
107
  # @!group
@@ -18,7 +18,7 @@ module OpenAI
18
18
  #
19
19
  # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts):
20
20
  #
21
- # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
21
+ # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
22
22
  #
23
23
  # @param instructions [String] Control the voice of your generated audio with additional instructions. Does not
24
24
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.54.0"
4
+ VERSION = "0.55.0"
5
5
  end
@@ -23,12 +23,17 @@ module OpenAI
23
23
 
24
24
  # The voice to use when generating the audio. Supported built-in voices are
25
25
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
26
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
27
- # in the
26
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
27
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
28
+ # voices are available in the
28
29
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
29
30
  sig do
30
31
  returns(
31
- T.any(String, OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol)
32
+ T.any(
33
+ String,
34
+ OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol,
35
+ OpenAI::Audio::SpeechCreateParams::Voice::ID
36
+ )
32
37
  )
33
38
  end
34
39
  attr_accessor :voice
@@ -90,7 +95,11 @@ module OpenAI
90
95
  input: String,
91
96
  model: T.any(String, OpenAI::Audio::SpeechModel::OrSymbol),
92
97
  voice:
93
- T.any(String, OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol),
98
+ T.any(
99
+ String,
100
+ OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol,
101
+ OpenAI::Audio::SpeechCreateParams::Voice::ID::OrHash
102
+ ),
94
103
  instructions: String,
95
104
  response_format:
96
105
  OpenAI::Audio::SpeechCreateParams::ResponseFormat::OrSymbol,
@@ -108,8 +117,9 @@ module OpenAI
108
117
  model:,
109
118
  # The voice to use when generating the audio. Supported built-in voices are
110
119
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
111
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
112
- # in the
120
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
121
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
122
+ # voices are available in the
113
123
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
114
124
  voice:,
115
125
  # Control the voice of your generated audio with additional instructions. Does not
@@ -136,7 +146,8 @@ module OpenAI
136
146
  voice:
137
147
  T.any(
138
148
  String,
139
- OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol
149
+ OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol,
150
+ OpenAI::Audio::SpeechCreateParams::Voice::ID
140
151
  ),
141
152
  instructions: String,
142
153
  response_format:
@@ -172,8 +183,9 @@ module OpenAI
172
183
 
173
184
  # The voice to use when generating the audio. Supported built-in voices are
174
185
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
175
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
176
- # in the
186
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
187
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
188
+ # voices are available in the
177
189
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
178
190
  module Voice
179
191
  extend OpenAI::Internal::Type::Union
@@ -182,10 +194,37 @@ module OpenAI
182
194
  T.type_alias do
183
195
  T.any(
184
196
  String,
185
- OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol
197
+ OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol,
198
+ OpenAI::Audio::SpeechCreateParams::Voice::ID
186
199
  )
187
200
  end
188
201
 
202
+ class ID < OpenAI::Internal::Type::BaseModel
203
+ OrHash =
204
+ T.type_alias do
205
+ T.any(
206
+ OpenAI::Audio::SpeechCreateParams::Voice::ID,
207
+ OpenAI::Internal::AnyHash
208
+ )
209
+ end
210
+
211
+ # The custom voice ID, e.g. `voice_1234`.
212
+ sig { returns(String) }
213
+ attr_accessor :id
214
+
215
+ # Custom voice reference.
216
+ sig { params(id: String).returns(T.attached_class) }
217
+ def self.new(
218
+ # The custom voice ID, e.g. `voice_1234`.
219
+ id:
220
+ )
221
+ end
222
+
223
+ sig { override.returns({ id: String }) }
224
+ def to_hash
225
+ end
226
+ end
227
+
189
228
  sig do
190
229
  override.returns(
191
230
  T::Array[OpenAI::Audio::SpeechCreateParams::Voice::Variants]
@@ -23,12 +23,14 @@ module OpenAI
23
23
 
24
24
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
25
25
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
26
- # `marin`, and `cedar`.
26
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
27
+ # for example `{ "id": "voice_1234" }`.
27
28
  sig do
28
29
  returns(
29
30
  T.any(
30
31
  String,
31
- OpenAI::Chat::ChatCompletionAudioParam::Voice::OrSymbol
32
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::OrSymbol,
33
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID
32
34
  )
33
35
  )
34
36
  end
@@ -43,7 +45,8 @@ module OpenAI
43
45
  voice:
44
46
  T.any(
45
47
  String,
46
- OpenAI::Chat::ChatCompletionAudioParam::Voice::OrSymbol
48
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::OrSymbol,
49
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID::OrHash
47
50
  )
48
51
  ).returns(T.attached_class)
49
52
  end
@@ -53,7 +56,8 @@ module OpenAI
53
56
  format_:,
54
57
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
55
58
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
56
- # `marin`, and `cedar`.
59
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
60
+ # for example `{ "id": "voice_1234" }`.
57
61
  voice:
58
62
  )
59
63
  end
@@ -65,7 +69,8 @@ module OpenAI
65
69
  voice:
66
70
  T.any(
67
71
  String,
68
- OpenAI::Chat::ChatCompletionAudioParam::Voice::OrSymbol
72
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::OrSymbol,
73
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID
69
74
  )
70
75
  }
71
76
  )
@@ -128,7 +133,8 @@ module OpenAI
128
133
 
129
134
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
130
135
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
131
- # `marin`, and `cedar`.
136
+ # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
137
+ # for example `{ "id": "voice_1234" }`.
132
138
  module Voice
133
139
  extend OpenAI::Internal::Type::Union
134
140
 
@@ -136,10 +142,37 @@ module OpenAI
136
142
  T.type_alias do
137
143
  T.any(
138
144
  String,
139
- OpenAI::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol
145
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::TaggedSymbol,
146
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID
140
147
  )
141
148
  end
142
149
 
150
+ class ID < OpenAI::Internal::Type::BaseModel
151
+ OrHash =
152
+ T.type_alias do
153
+ T.any(
154
+ OpenAI::Chat::ChatCompletionAudioParam::Voice::ID,
155
+ OpenAI::Internal::AnyHash
156
+ )
157
+ end
158
+
159
+ # The custom voice ID, e.g. `voice_1234`.
160
+ sig { returns(String) }
161
+ attr_accessor :id
162
+
163
+ # Custom voice reference.
164
+ sig { params(id: String).returns(T.attached_class) }
165
+ def self.new(
166
+ # The custom voice ID, e.g. `voice_1234`.
167
+ id:
168
+ )
169
+ end
170
+
171
+ sig { override.returns({ id: String }) }
172
+ def to_hash
173
+ end
174
+ end
175
+
143
176
  sig do
144
177
  override.returns(
145
178
  T::Array[OpenAI::Chat::ChatCompletionAudioParam::Voice::Variants]
@@ -53,14 +53,17 @@ module OpenAI
53
53
 
54
54
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
55
55
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
56
- # `cedar`. Voice cannot be changed during the session once the model has responded
57
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
56
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
57
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
58
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
59
+ # for best quality.
58
60
  sig do
59
61
  returns(
60
62
  T.nilable(
61
63
  T.any(
62
64
  String,
63
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
65
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
66
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
64
67
  )
65
68
  )
66
69
  )
@@ -72,7 +75,8 @@ module OpenAI
72
75
  voice:
73
76
  T.any(
74
77
  String,
75
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
78
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
79
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID::OrHash
76
80
  )
77
81
  ).void
78
82
  end
@@ -90,7 +94,8 @@ module OpenAI
90
94
  voice:
91
95
  T.any(
92
96
  String,
93
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
97
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
98
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID::OrHash
94
99
  )
95
100
  ).returns(T.attached_class)
96
101
  end
@@ -107,8 +112,10 @@ module OpenAI
107
112
  speed: nil,
108
113
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
109
114
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
110
- # `cedar`. Voice cannot be changed during the session once the model has responded
111
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
115
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
116
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
117
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
118
+ # for best quality.
112
119
  voice: nil
113
120
  )
114
121
  end
@@ -126,7 +133,8 @@ module OpenAI
126
133
  voice:
127
134
  T.any(
128
135
  String,
129
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol
136
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::OrSymbol,
137
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
130
138
  )
131
139
  }
132
140
  )
@@ -136,8 +144,10 @@ module OpenAI
136
144
 
137
145
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
138
146
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
139
- # `cedar`. Voice cannot be changed during the session once the model has responded
140
- # with audio at least once. We recommend `marin` and `cedar` for best quality.
147
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
148
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
149
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
150
+ # for best quality.
141
151
  module Voice
142
152
  extend OpenAI::Internal::Type::Union
143
153
 
@@ -145,10 +155,37 @@ module OpenAI
145
155
  T.type_alias do
146
156
  T.any(
147
157
  String,
148
- OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol
158
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::TaggedSymbol,
159
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
149
160
  )
150
161
  end
151
162
 
163
+ class ID < OpenAI::Internal::Type::BaseModel
164
+ OrHash =
165
+ T.type_alias do
166
+ T.any(
167
+ OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID,
168
+ OpenAI::Internal::AnyHash
169
+ )
170
+ end
171
+
172
+ # The custom voice ID, e.g. `voice_1234`.
173
+ sig { returns(String) }
174
+ attr_accessor :id
175
+
176
+ # Custom voice reference.
177
+ sig { params(id: String).returns(T.attached_class) }
178
+ def self.new(
179
+ # The custom voice ID, e.g. `voice_1234`.
180
+ id:
181
+ )
182
+ end
183
+
184
+ sig { override.returns({ id: String }) }
185
+ def to_hash
186
+ end
187
+ end
188
+
152
189
  sig do
153
190
  override.returns(
154
191
  T::Array[
@@ -87,14 +87,17 @@ module OpenAI
87
87
 
88
88
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
89
89
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
90
- # `cedar`. Voice cannot be changed during the session once the model has responded
91
- # with audio at least once.
90
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
91
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
92
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
93
+ # for best quality.
92
94
  sig do
93
95
  returns(
94
96
  T.nilable(
95
97
  T.any(
96
98
  String,
97
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
99
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
100
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
98
101
  )
99
102
  )
100
103
  )
@@ -106,7 +109,8 @@ module OpenAI
106
109
  voice:
107
110
  T.any(
108
111
  String,
109
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
112
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
113
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID::OrHash
110
114
  )
111
115
  ).void
112
116
  end
@@ -123,7 +127,8 @@ module OpenAI
123
127
  voice:
124
128
  T.any(
125
129
  String,
126
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
130
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
131
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID::OrHash
127
132
  )
128
133
  ).returns(T.attached_class)
129
134
  end
@@ -132,8 +137,10 @@ module OpenAI
132
137
  format_: nil,
133
138
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
134
139
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
135
- # `cedar`. Voice cannot be changed during the session once the model has responded
136
- # with audio at least once.
140
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
141
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
142
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
143
+ # for best quality.
137
144
  voice: nil
138
145
  )
139
146
  end
@@ -150,7 +157,8 @@ module OpenAI
150
157
  voice:
151
158
  T.any(
152
159
  String,
153
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol
160
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::OrSymbol,
161
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
154
162
  )
155
163
  }
156
164
  )
@@ -160,8 +168,10 @@ module OpenAI
160
168
 
161
169
  # The voice the model uses to respond. Supported built-in voices are `alloy`,
162
170
  # `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
163
- # `cedar`. Voice cannot be changed during the session once the model has responded
164
- # with audio at least once.
171
+ # `cedar`. You may also provide a custom voice object with an `id`, for example
172
+ # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
173
+ # model has responded with audio at least once. We recommend `marin` and `cedar`
174
+ # for best quality.
165
175
  module Voice
166
176
  extend OpenAI::Internal::Type::Union
167
177
 
@@ -169,10 +179,37 @@ module OpenAI
169
179
  T.type_alias do
170
180
  T.any(
171
181
  String,
172
- OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol
182
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::TaggedSymbol,
183
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
173
184
  )
174
185
  end
175
186
 
187
+ class ID < OpenAI::Internal::Type::BaseModel
188
+ OrHash =
189
+ T.type_alias do
190
+ T.any(
191
+ OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID,
192
+ OpenAI::Internal::AnyHash
193
+ )
194
+ end
195
+
196
+ # The custom voice ID, e.g. `voice_1234`.
197
+ sig { returns(String) }
198
+ attr_accessor :id
199
+
200
+ # Custom voice reference.
201
+ sig { params(id: String).returns(T.attached_class) }
202
+ def self.new(
203
+ # The custom voice ID, e.g. `voice_1234`.
204
+ id:
205
+ )
206
+ end
207
+
208
+ sig { override.returns({ id: String }) }
209
+ def to_hash
210
+ end
211
+ end
212
+
176
213
  sig do
177
214
  override.returns(
178
215
  T::Array[
@@ -13,7 +13,11 @@ module OpenAI
13
13
  input: String,
14
14
  model: T.any(String, OpenAI::Audio::SpeechModel::OrSymbol),
15
15
  voice:
16
- T.any(String, OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol),
16
+ T.any(
17
+ String,
18
+ OpenAI::Audio::SpeechCreateParams::Voice::OrSymbol,
19
+ OpenAI::Audio::SpeechCreateParams::Voice::ID::OrHash
20
+ ),
17
21
  instructions: String,
18
22
  response_format:
19
23
  OpenAI::Audio::SpeechCreateParams::ResponseFormat::OrSymbol,
@@ -31,8 +35,9 @@ module OpenAI
31
35
  model:,
32
36
  # The voice to use when generating the audio. Supported built-in voices are
33
37
  # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
34
- # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
35
- # in the
38
+ # `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
39
+ # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
40
+ # voices are available in the
36
41
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
37
42
  voice:,
38
43
  # Control the voice of your generated audio with additional instructions. Does not
@@ -85,10 +85,21 @@ module OpenAI
85
85
  | :verse
86
86
  | :marin
87
87
  | :cedar
88
+ | OpenAI::Audio::SpeechCreateParams::Voice::ID
88
89
 
89
90
  module Voice
90
91
  extend OpenAI::Internal::Type::Union
91
92
 
93
+ type id = { id: String }
94
+
95
+ class ID < OpenAI::Internal::Type::BaseModel
96
+ attr_accessor id: String
97
+
98
+ def initialize: (id: String) -> void
99
+
100
+ def to_hash: -> { id: String }
101
+ end
102
+
92
103
  def self?.variants: -> ::Array[OpenAI::Models::Audio::SpeechCreateParams::voice]
93
104
 
94
105
  ALLOY: :alloy
@@ -51,10 +51,21 @@ module OpenAI
51
51
  | :verse
52
52
  | :marin
53
53
  | :cedar
54
+ | OpenAI::Chat::ChatCompletionAudioParam::Voice::ID
54
55
 
55
56
  module Voice
56
57
  extend OpenAI::Internal::Type::Union
57
58
 
59
+ type id = { id: String }
60
+
61
+ class ID < OpenAI::Internal::Type::BaseModel
62
+ attr_accessor id: String
63
+
64
+ def initialize: (id: String) -> void
65
+
66
+ def to_hash: -> { id: String }
67
+ end
68
+
58
69
  def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletionAudioParam::voice]
59
70
 
60
71
  ALLOY: :alloy
@@ -49,10 +49,21 @@ module OpenAI
49
49
  | :verse
50
50
  | :marin
51
51
  | :cedar
52
+ | OpenAI::Realtime::RealtimeAudioConfigOutput::Voice::ID
52
53
 
53
54
  module Voice
54
55
  extend OpenAI::Internal::Type::Union
55
56
 
57
+ type id = { id: String }
58
+
59
+ class ID < OpenAI::Internal::Type::BaseModel
60
+ attr_accessor id: String
61
+
62
+ def initialize: (id: String) -> void
63
+
64
+ def to_hash: -> { id: String }
65
+ end
66
+
56
67
  def self?.variants: -> ::Array[OpenAI::Models::Realtime::RealtimeAudioConfigOutput::voice]
57
68
 
58
69
  ALLOY: :alloy
@@ -60,10 +60,21 @@ module OpenAI
60
60
  | :verse
61
61
  | :marin
62
62
  | :cedar
63
+ | OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID
63
64
 
64
65
  module Voice
65
66
  extend OpenAI::Internal::Type::Union
66
67
 
68
+ type id = { id: String }
69
+
70
+ class ID < OpenAI::Internal::Type::BaseModel
71
+ attr_accessor id: String
72
+
73
+ def initialize: (id: String) -> void
74
+
75
+ def to_hash: -> { id: String }
76
+ end
77
+
67
78
  def self?.variants: -> ::Array[OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::voice]
68
79
 
69
80
  ALLOY: :alloy
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.54.0
4
+ version: 0.55.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAI