openai 0.100.0 → 0.101.1
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/models/audio/speech_create_params.rb +3 -6
- data/lib/openai/models/audio/voice.rb +4 -9
- data/lib/openai/models/audio/voice_create_params.rb +3 -100
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +3 -3
- data/lib/openai/models/decision.rb +313 -0
- data/lib/openai/models/decision_create_params.rb +233 -0
- data/lib/openai/models/decision_input_image.rb +53 -0
- data/lib/openai/models/decision_input_message.rb +60 -0
- data/lib/openai/models/decision_input_part.rb +20 -0
- data/lib/openai/models/decision_input_text.rb +21 -0
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +3 -6
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +3 -6
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
- data/lib/openai/models.rb +12 -0
- data/lib/openai/resources/audio/speech.rb +1 -2
- data/lib/openai/resources/audio/voices.rb +10 -10
- data/lib/openai/resources/decisions.rb +59 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +9 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +3 -6
- data/rbi/openai/models/audio/voice.rbi +4 -9
- data/rbi/openai/models/audio/voice_create_params.rbi +4 -149
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +1893 -18
- data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +3 -3
- data/rbi/openai/models/decision.rbi +586 -0
- data/rbi/openai/models/decision_create_params.rbi +435 -0
- data/rbi/openai/models/decision_input_image.rbi +81 -0
- data/rbi/openai/models/decision_input_message.rbi +96 -0
- data/rbi/openai/models/decision_input_part.rbi +24 -0
- data/rbi/openai/models/decision_input_text.rbi +49 -0
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +3 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +3 -6
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +1901 -18
- data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models.rbi +12 -0
- data/rbi/openai/resources/audio/speech.rbi +1 -2
- data/rbi/openai/resources/audio/voices.rbi +10 -13
- data/rbi/openai/resources/decisions.rbi +57 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/audio/speech_create_params.rbs +2 -4
- data/sig/openai/models/audio/voice.rbs +3 -6
- data/sig/openai/models/audio/voice_create_params.rbs +1 -90
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +2 -2
- data/sig/openai/models/decision.rbs +296 -0
- data/sig/openai/models/decision_create_params.rbs +227 -0
- data/sig/openai/models/decision_input_image.rbs +51 -0
- data/sig/openai/models/decision_input_message.rbs +57 -0
- data/sig/openai/models/decision_input_part.rbs +12 -0
- data/sig/openai/models/decision_input_text.rbs +15 -0
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +3 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +3 -6
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
- data/sig/openai/models.rbs +12 -0
- data/sig/openai/resources/decisions.rbs +15 -0
- metadata +28 -1
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Responses
|
|
7
|
+
|
|
8
|
+
class ToolSearchOutputNamespaceTool < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Responses::ToolSearchOutputNamespaceTool,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# A description of the namespace shown to the model.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :description
|
|
20
|
+
|
|
21
|
+
# The namespace name used in tool calls (for example, `crm`).
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :name
|
|
24
|
+
|
|
25
|
+
# The function/custom tools loaded inside this namespace.
|
|
26
|
+
sig {
|
|
27
|
+
returns(
|
|
28
|
+
T::Array[
|
|
29
|
+
T.any(OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Responses::CustomTool)
|
|
30
|
+
]
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
attr_accessor :tools
|
|
34
|
+
|
|
35
|
+
# The type of the tool. Always `namespace`.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
# Groups function/custom tools under a shared namespace.
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
|
|
43
|
+
description: String,
|
|
44
|
+
|
|
45
|
+
name: String,
|
|
46
|
+
|
|
47
|
+
tools: T::Array[
|
|
48
|
+
T.any(
|
|
49
|
+
OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::OrHash,
|
|
50
|
+
OpenAI::Responses::CustomTool::OrHash
|
|
51
|
+
)
|
|
52
|
+
],
|
|
53
|
+
|
|
54
|
+
type: Symbol
|
|
55
|
+
)
|
|
56
|
+
.returns(T.attached_class)
|
|
57
|
+
end
|
|
58
|
+
def self.new(
|
|
59
|
+
|
|
60
|
+
# A description of the namespace shown to the model.
|
|
61
|
+
description:,
|
|
62
|
+
|
|
63
|
+
# The namespace name used in tool calls (for example, `crm`).
|
|
64
|
+
name:,
|
|
65
|
+
|
|
66
|
+
# The function/custom tools loaded inside this namespace.
|
|
67
|
+
tools:,
|
|
68
|
+
|
|
69
|
+
# The type of the tool. Always `namespace`.
|
|
70
|
+
|
|
71
|
+
type: :namespace
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
sig do
|
|
76
|
+
override.returns(
|
|
77
|
+
{
|
|
78
|
+
description: String,
|
|
79
|
+
name: String,
|
|
80
|
+
tools: T::Array[
|
|
81
|
+
T.any(OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Responses::CustomTool)
|
|
82
|
+
],
|
|
83
|
+
type: Symbol
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# A function or custom tool loaded into a namespace by tool search.
|
|
91
|
+
module Tool
|
|
92
|
+
extend OpenAI::Internal::Type::Union
|
|
93
|
+
|
|
94
|
+
Variants = T.type_alias {
|
|
95
|
+
T.any(OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Responses::CustomTool)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
class Function < OpenAI::Internal::Type::BaseModel
|
|
99
|
+
OrHash = T.type_alias do
|
|
100
|
+
T.any(
|
|
101
|
+
OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function,
|
|
102
|
+
OpenAI::Internal::AnyHash
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# The name of the loaded function tool.
|
|
107
|
+
sig { returns(String) }
|
|
108
|
+
attr_accessor :name
|
|
109
|
+
|
|
110
|
+
sig { returns(Symbol) }
|
|
111
|
+
attr_accessor :type
|
|
112
|
+
|
|
113
|
+
# The tool invocation context(s).
|
|
114
|
+
sig {
|
|
115
|
+
returns(
|
|
116
|
+
T.nilable(
|
|
117
|
+
T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
attr_accessor :allowed_callers
|
|
122
|
+
|
|
123
|
+
# Whether the tool response can be returned asynchronously versus immediately
|
|
124
|
+
# returned on next response creation.
|
|
125
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
126
|
+
attr_reader :async
|
|
127
|
+
|
|
128
|
+
sig { params(async: T::Boolean).void }
|
|
129
|
+
attr_writer :async
|
|
130
|
+
|
|
131
|
+
# Whether this function should be deferred and discovered via tool search.
|
|
132
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
133
|
+
attr_reader :defer_loading
|
|
134
|
+
|
|
135
|
+
sig { params(defer_loading: T::Boolean).void }
|
|
136
|
+
attr_writer :defer_loading
|
|
137
|
+
|
|
138
|
+
sig { returns(T.nilable(String)) }
|
|
139
|
+
attr_accessor :description
|
|
140
|
+
|
|
141
|
+
# A JSON Schema describing the JSON value encoded in string outputs for this
|
|
142
|
+
# function tool. This does not describe content-array outputs.
|
|
143
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
144
|
+
attr_accessor :output_schema
|
|
145
|
+
|
|
146
|
+
sig { returns(T.nilable(T.anything)) }
|
|
147
|
+
attr_accessor :parameters
|
|
148
|
+
|
|
149
|
+
# Whether to enforce strict parameter validation. If omitted, Responses attempts
|
|
150
|
+
# to use strict validation when the schema is compatible, and falls back to
|
|
151
|
+
# non-strict validation otherwise.
|
|
152
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
153
|
+
attr_accessor :strict
|
|
154
|
+
|
|
155
|
+
sig do
|
|
156
|
+
params(
|
|
157
|
+
|
|
158
|
+
name: String,
|
|
159
|
+
|
|
160
|
+
allowed_callers: T.nilable(
|
|
161
|
+
T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
|
|
162
|
+
),
|
|
163
|
+
|
|
164
|
+
async: T::Boolean,
|
|
165
|
+
|
|
166
|
+
defer_loading: T::Boolean,
|
|
167
|
+
|
|
168
|
+
description: T.nilable(String),
|
|
169
|
+
|
|
170
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
171
|
+
|
|
172
|
+
parameters: T.nilable(T.anything),
|
|
173
|
+
|
|
174
|
+
strict: T.nilable(T::Boolean),
|
|
175
|
+
|
|
176
|
+
type: Symbol
|
|
177
|
+
)
|
|
178
|
+
.returns(T.attached_class)
|
|
179
|
+
end
|
|
180
|
+
def self.new(
|
|
181
|
+
|
|
182
|
+
# The name of the loaded function tool.
|
|
183
|
+
name:,
|
|
184
|
+
|
|
185
|
+
# The tool invocation context(s).
|
|
186
|
+
allowed_callers: nil,
|
|
187
|
+
|
|
188
|
+
# Whether the tool response can be returned asynchronously versus immediately
|
|
189
|
+
# returned on next response creation.
|
|
190
|
+
async: nil,
|
|
191
|
+
|
|
192
|
+
# Whether this function should be deferred and discovered via tool search.
|
|
193
|
+
defer_loading: nil,
|
|
194
|
+
|
|
195
|
+
description: nil,
|
|
196
|
+
|
|
197
|
+
# A JSON Schema describing the JSON value encoded in string outputs for this
|
|
198
|
+
# function tool. This does not describe content-array outputs.
|
|
199
|
+
output_schema: nil,
|
|
200
|
+
|
|
201
|
+
parameters: nil,
|
|
202
|
+
|
|
203
|
+
# Whether to enforce strict parameter validation. If omitted, Responses attempts
|
|
204
|
+
# to use strict validation when the schema is compatible, and falls back to
|
|
205
|
+
# non-strict validation otherwise.
|
|
206
|
+
strict: nil,
|
|
207
|
+
|
|
208
|
+
type: :function
|
|
209
|
+
)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
sig do
|
|
213
|
+
override.returns(
|
|
214
|
+
{
|
|
215
|
+
name: String,
|
|
216
|
+
type: Symbol,
|
|
217
|
+
allowed_callers: T.nilable(
|
|
218
|
+
T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
|
|
219
|
+
),
|
|
220
|
+
async: T::Boolean,
|
|
221
|
+
defer_loading: T::Boolean,
|
|
222
|
+
description: T.nilable(String),
|
|
223
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
224
|
+
parameters: T.nilable(T.anything),
|
|
225
|
+
strict: T.nilable(T::Boolean)
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
end
|
|
229
|
+
def to_hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
module AllowedCaller
|
|
233
|
+
extend OpenAI::Internal::Type::Enum
|
|
234
|
+
|
|
235
|
+
TaggedSymbol = T.type_alias {
|
|
236
|
+
T.all(Symbol, OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller)
|
|
237
|
+
}
|
|
238
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
239
|
+
|
|
240
|
+
DIRECT = T.let(
|
|
241
|
+
:direct,
|
|
242
|
+
OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
|
|
243
|
+
)
|
|
244
|
+
PROGRAMMATIC = T.let(
|
|
245
|
+
:programmatic,
|
|
246
|
+
OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
sig {
|
|
250
|
+
override.returns(
|
|
251
|
+
T::Array[
|
|
252
|
+
OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
|
|
253
|
+
]
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
def self.values
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
sig { override.returns(T::Array[OpenAI::Responses::ToolSearchOutputNamespaceTool::Tool::Variants]) }
|
|
262
|
+
def self.variants
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
end
|
|
272
|
+
end
|
data/rbi/openai/models.rbi
CHANGED
|
@@ -68,6 +68,18 @@ module OpenAI
|
|
|
68
68
|
|
|
69
69
|
CustomToolInputFormat = OpenAI::Models::CustomToolInputFormat
|
|
70
70
|
|
|
71
|
+
Decision = OpenAI::Models::Decision
|
|
72
|
+
|
|
73
|
+
DecisionCreateParams = OpenAI::Models::DecisionCreateParams
|
|
74
|
+
|
|
75
|
+
DecisionInputImage = OpenAI::Models::DecisionInputImage
|
|
76
|
+
|
|
77
|
+
DecisionInputMessage = OpenAI::Models::DecisionInputMessage
|
|
78
|
+
|
|
79
|
+
DecisionInputPart = OpenAI::Models::DecisionInputPart
|
|
80
|
+
|
|
81
|
+
DecisionInputText = OpenAI::Models::DecisionInputText
|
|
82
|
+
|
|
71
83
|
DeletedSkill = OpenAI::Models::DeletedSkill
|
|
72
84
|
|
|
73
85
|
Embedding = OpenAI::Models::Embedding
|
|
@@ -41,8 +41,7 @@ module OpenAI
|
|
|
41
41
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
42
42
|
# voices are available in the
|
|
43
43
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
44
|
-
# Custom voices must be created from audio samples.
|
|
45
|
-
# prompts are supported only in Live.
|
|
44
|
+
# Custom voices must be created from audio samples.
|
|
46
45
|
voice:,
|
|
47
46
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
48
47
|
# work with `tts-1` or `tts-1-hd`.
|
|
@@ -8,23 +8,20 @@ module OpenAI
|
|
|
8
8
|
# Turn audio into text or text into audio.
|
|
9
9
|
class Voices
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
# sample
|
|
11
|
+
# Create a custom voice you can use for audio output (for example, in
|
|
12
|
+
# Text-to-Speech and the Realtime API). This requires an audio sample and a
|
|
13
|
+
# previously uploaded consent recording.
|
|
13
14
|
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
|
|
17
|
-
# as multipart form data. The type defaults to `audio_sample` when omitted.
|
|
15
|
+
# Send `name`, `audio_sample`, and the `consent` recording ID as multipart form
|
|
16
|
+
# data. The optional `type` defaults to `audio_sample`.
|
|
18
17
|
#
|
|
19
|
-
# Returns the saved voice's metadata.
|
|
20
|
-
#
|
|
21
|
-
#
|
|
18
|
+
# Returns the saved voice's metadata. See the
|
|
19
|
+
# [custom voices guide](https://developers.openai.com/api/docs/guides/text-to-speech#custom-voices)
|
|
20
|
+
# for requirements and best practices. Custom voices are limited to eligible
|
|
21
|
+
# customers.
|
|
22
22
|
sig {
|
|
23
23
|
params(
|
|
24
|
-
body:
|
|
25
|
-
OpenAI::Audio::VoiceCreateParams::Body::AudioSample::OrHash,
|
|
26
|
-
OpenAI::Audio::VoiceCreateParams::Body::Prompt::OrHash
|
|
27
|
-
),
|
|
24
|
+
body: OpenAI::Audio::VoiceCreateParams::Body::AudioSample::OrHash,
|
|
28
25
|
request_options: OpenAI::RequestOptions::OrHash
|
|
29
26
|
)
|
|
30
27
|
.returns(OpenAI::Audio::Voice)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
|
|
6
|
+
class Decisions
|
|
7
|
+
|
|
8
|
+
# Evaluate ordered classification and scoring questions against shared input.
|
|
9
|
+
# Answers are returned in question order.
|
|
10
|
+
#
|
|
11
|
+
# Supply input as a string or user messages containing text and inline images.
|
|
12
|
+
# Only user messages with `input_text` and `input_image` parts are supported;
|
|
13
|
+
# non-user roles, function calls, files, audio, and item references are not
|
|
14
|
+
# supported. Images require a data URL, not an external URL or file ID. At most
|
|
15
|
+
# 128 images are allowed across the request.
|
|
16
|
+
#
|
|
17
|
+
# Each question can return a refusal instead of a scored answer. A refusal has
|
|
18
|
+
# type `refusal` and the corresponding question name, or null if unnamed.
|
|
19
|
+
sig {
|
|
20
|
+
params(
|
|
21
|
+
input: OpenAI::DecisionCreateParams::Input::Variants,
|
|
22
|
+
model: String,
|
|
23
|
+
questions: T::Array[
|
|
24
|
+
T.any(
|
|
25
|
+
OpenAI::DecisionCreateParams::Question::Predicate::OrHash,
|
|
26
|
+
OpenAI::DecisionCreateParams::Question::Choice::OrHash,
|
|
27
|
+
OpenAI::DecisionCreateParams::Question::Score::OrHash
|
|
28
|
+
)
|
|
29
|
+
],
|
|
30
|
+
safety_identifier: T.nilable(String),
|
|
31
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
32
|
+
)
|
|
33
|
+
.returns(OpenAI::Decision)
|
|
34
|
+
}
|
|
35
|
+
def create(
|
|
36
|
+
# Shared evidence, as a string or an array of user messages containing text and
|
|
37
|
+
# inline images. Non-user roles, function calls, function-call outputs, files,
|
|
38
|
+
# audio, and item references are not supported. At most 128 image parts are
|
|
39
|
+
# allowed across all messages in one request.
|
|
40
|
+
input:,
|
|
41
|
+
model:,
|
|
42
|
+
questions:,
|
|
43
|
+
# Opaque caller-provided end-user identifier, scoped by the verified org. Match
|
|
44
|
+
# Responses' limit; this is never the authenticated user identity.
|
|
45
|
+
safety_identifier: nil,
|
|
46
|
+
request_options: {}
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @api private
|
|
51
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
52
|
+
def self.new(client:)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
data/sig/openai/client.rbs
CHANGED
|
@@ -31,8 +31,7 @@ module OpenAI
|
|
|
31
31
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
32
32
|
# voices are available in the
|
|
33
33
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
34
|
-
# Custom voices must be created from audio samples.
|
|
35
|
-
# prompts are supported only in Live.
|
|
34
|
+
# Custom voices must be created from audio samples.
|
|
36
35
|
attr_accessor voice: OpenAI::Models::Audio::SpeechCreateParams::voice
|
|
37
36
|
|
|
38
37
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
@@ -84,8 +83,7 @@ module OpenAI
|
|
|
84
83
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
85
84
|
# voices are available in the
|
|
86
85
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
87
|
-
# Custom voices must be created from audio samples.
|
|
88
|
-
# prompts are supported only in Live.
|
|
86
|
+
# Custom voices must be created from audio samples.
|
|
89
87
|
# @param instructions
|
|
90
88
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
91
89
|
# work with `tts-1` or `tts-1-hd`.
|
|
@@ -23,8 +23,7 @@ module OpenAI
|
|
|
23
23
|
# The object type, which is always `audio.voice`.
|
|
24
24
|
attr_accessor object: :"audio.voice"
|
|
25
25
|
|
|
26
|
-
# How the voice was created.
|
|
27
|
-
# in Live.
|
|
26
|
+
# How the voice was created.
|
|
28
27
|
attr_accessor type: OpenAI::Models::Audio::Voice::type_
|
|
29
28
|
|
|
30
29
|
# @param id
|
|
@@ -34,8 +33,7 @@ module OpenAI
|
|
|
34
33
|
# @param name
|
|
35
34
|
# The name of the voice.
|
|
36
35
|
# @param type
|
|
37
|
-
# How the voice was created.
|
|
38
|
-
# in Live.
|
|
36
|
+
# How the voice was created.
|
|
39
37
|
# @param object
|
|
40
38
|
# The object type, which is always `audio.voice`.
|
|
41
39
|
def initialize: (
|
|
@@ -54,13 +52,12 @@ module OpenAI
|
|
|
54
52
|
type: OpenAI::Models::Audio::Voice::type_
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
type type_ = :audio_sample
|
|
55
|
+
type type_ = :audio_sample
|
|
58
56
|
|
|
59
57
|
module Type
|
|
60
58
|
extend OpenAI::Internal::Type::Enum
|
|
61
59
|
|
|
62
60
|
AUDIO_SAMPLE: :audio_sample
|
|
63
|
-
PROMPT: :prompt
|
|
64
61
|
|
|
65
62
|
def self?.values: -> ::Array[OpenAI::Models::Audio::Voice::type_]
|
|
66
63
|
end
|
|
@@ -28,9 +28,7 @@ module OpenAI
|
|
|
28
28
|
?request_options: OpenAI::RequestOptions
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type body =
|
|
32
|
-
OpenAI::Audio::VoiceCreateParams::Body::AudioSample
|
|
33
|
-
| OpenAI::Audio::VoiceCreateParams::Body::Prompt
|
|
31
|
+
type body = OpenAI::Audio::VoiceCreateParams::Body::AudioSample
|
|
34
32
|
|
|
35
33
|
module Body
|
|
36
34
|
extend OpenAI::Internal::Type::Union
|
|
@@ -108,93 +106,6 @@ module OpenAI
|
|
|
108
106
|
end
|
|
109
107
|
end
|
|
110
108
|
|
|
111
|
-
type prompt =
|
|
112
|
-
{
|
|
113
|
-
name: String,
|
|
114
|
-
prompt: String,
|
|
115
|
-
type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
|
|
116
|
-
?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
|
|
117
|
-
?script_hint: String
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
class Prompt < OpenAI::Internal::Type::BaseModel
|
|
121
|
-
# The name of the new voice.
|
|
122
|
-
attr_accessor name: String
|
|
123
|
-
|
|
124
|
-
# A description of the desired voice. Must not contain only whitespace.
|
|
125
|
-
attr_accessor prompt: String
|
|
126
|
-
|
|
127
|
-
# Set to `prompt` to create a voice from a text description.
|
|
128
|
-
attr_accessor type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_
|
|
129
|
-
|
|
130
|
-
# The voice creation model to use. Defaults to `auto`.
|
|
131
|
-
attr_reader model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model?
|
|
132
|
-
|
|
133
|
-
# The voice creation model to use. Defaults to `auto`.
|
|
134
|
-
def model=: (
|
|
135
|
-
OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model
|
|
136
|
-
) -> OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model
|
|
137
|
-
|
|
138
|
-
# Optional text for the voice to speak during creation. If omitted, a script is
|
|
139
|
-
# generated from the prompt. Must not be blank after trimming whitespace; scripts
|
|
140
|
-
# that are too short are rejected.
|
|
141
|
-
attr_reader script_hint: String?
|
|
142
|
-
|
|
143
|
-
# Optional text for the voice to speak during creation. If omitted, a script is
|
|
144
|
-
# generated from the prompt. Must not be blank after trimming whitespace; scripts
|
|
145
|
-
# that are too short are rejected.
|
|
146
|
-
def script_hint=: (String) -> String
|
|
147
|
-
|
|
148
|
-
# @param name
|
|
149
|
-
# The name of the new voice.
|
|
150
|
-
# @param prompt
|
|
151
|
-
# A description of the desired voice. Must not contain only whitespace.
|
|
152
|
-
# @param type
|
|
153
|
-
# Set to `prompt` to create a voice from a text description.
|
|
154
|
-
# @param model
|
|
155
|
-
# The voice creation model to use. Defaults to `auto`.
|
|
156
|
-
# @param script_hint
|
|
157
|
-
# Optional text for the voice to speak during creation. If omitted, a script is
|
|
158
|
-
# generated from the prompt. Must not be blank after trimming whitespace; scripts
|
|
159
|
-
# that are too short are rejected.
|
|
160
|
-
def initialize: (
|
|
161
|
-
name: String,
|
|
162
|
-
prompt: String,
|
|
163
|
-
type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
|
|
164
|
-
?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
|
|
165
|
-
?script_hint: String
|
|
166
|
-
) -> void
|
|
167
|
-
|
|
168
|
-
def to_hash: -> {
|
|
169
|
-
name: String,
|
|
170
|
-
prompt: String,
|
|
171
|
-
type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
|
|
172
|
-
?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
|
|
173
|
-
?script_hint: String
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
type type_ = :prompt
|
|
177
|
-
|
|
178
|
-
module Type
|
|
179
|
-
extend OpenAI::Internal::Type::Enum
|
|
180
|
-
|
|
181
|
-
PROMPT: :prompt
|
|
182
|
-
|
|
183
|
-
def self?.values: -> ::Array[OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_]
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
type model = String | :auto | :"2026-10-01"
|
|
187
|
-
|
|
188
|
-
module Model
|
|
189
|
-
extend OpenAI::Internal::Type::Union
|
|
190
|
-
|
|
191
|
-
def self?.variants: -> ::Array[OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model]
|
|
192
|
-
|
|
193
|
-
AUTO: :auto
|
|
194
|
-
MODEL_2026_10_01: :"2026-10-01"
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
|
-
|
|
198
109
|
def self?.variants: -> ::Array[OpenAI::Models::Audio::VoiceCreateParams::body]
|
|
199
110
|
end
|
|
200
111
|
end
|