openai 0.42.0 → 0.45.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 +4 -4
- data/CHANGELOG.md +57 -0
- data/README.md +12 -18
- data/lib/openai/internal/transport/pooled_net_requester.rb +1 -1
- data/lib/openai/models/audio/speech_create_params.rb +9 -7
- data/lib/openai/models/beta/assistant.rb +2 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +7 -5
- data/lib/openai/models/conversations/conversation_item.rb +1 -1
- data/lib/openai/models/conversations/message.rb +1 -1
- data/lib/openai/models/file_create_params.rb +9 -5
- data/lib/openai/models/file_purpose.rb +8 -4
- data/lib/openai/models/realtime/conversation_item_create_event.rb +9 -5
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -9
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -9
- data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +9 -1
- data/lib/openai/models/responses/input_token_count_params.rb +4 -7
- data/lib/openai/models/responses/response.rb +17 -8
- data/lib/openai/models/responses/response_compact_params.rb +1 -0
- data/lib/openai/models/responses/response_compaction_item.rb +4 -2
- data/lib/openai/models/responses/response_compaction_item_param.rb +2 -1
- data/lib/openai/models/responses/response_computer_tool_call.rb +6 -6
- data/lib/openai/models/responses/response_function_call_output_item.rb +1 -1
- data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +35 -7
- data/lib/openai/models/responses/response_function_web_search.rb +26 -18
- data/lib/openai/models/responses/response_input_item.rb +28 -1
- data/lib/openai/models/responses/response_item.rb +1 -1
- data/lib/openai/models/responses/response_output_item.rb +1 -1
- data/lib/openai/models/responses/response_output_text.rb +1 -1
- data/lib/openai/models/responses/tool.rb +30 -2
- data/lib/openai/models/video_create_error.rb +7 -2
- data/lib/openai/resources/audio/speech.rb +1 -1
- data/lib/openai/resources/beta/assistants.rb +10 -0
- data/lib/openai/resources/files.rb +3 -3
- data/lib/openai/resources/images.rb +4 -2
- data/lib/openai/resources/responses/input_tokens.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/models/audio/speech_create_params.rbi +12 -9
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +9 -6
- data/rbi/openai/models/conversations/message.rbi +1 -1
- data/rbi/openai/models/file_create_params.rbi +16 -8
- data/rbi/openai/models/file_purpose.rbi +8 -4
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +16 -8
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +12 -12
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +12 -12
- data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +8 -0
- data/rbi/openai/models/responses/input_token_count_params.rbi +3 -9
- data/rbi/openai/models/responses/response.rbi +18 -8
- data/rbi/openai/models/responses/response_compaction_item.rbi +4 -0
- data/rbi/openai/models/responses/response_compaction_item_param.rbi +2 -0
- data/rbi/openai/models/responses/response_function_call_output_item.rbi +1 -1
- data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +67 -2
- data/rbi/openai/models/responses/response_function_web_search.rbi +26 -11
- data/rbi/openai/models/responses/response_input_item.rbi +61 -1
- data/rbi/openai/models/responses/response_output_text.rbi +1 -1
- data/rbi/openai/models/responses/tool.rbi +68 -0
- data/rbi/openai/models/video_create_error.rbi +9 -1
- data/rbi/openai/resources/audio/speech.rbi +4 -3
- data/rbi/openai/resources/files.rbi +10 -6
- data/rbi/openai/resources/images.rbi +4 -2
- data/rbi/openai/resources/responses/input_tokens.rbi +1 -3
- data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +5 -0
- data/sig/openai/models/responses/response.rbs +5 -0
- data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +17 -0
- data/sig/openai/models/responses/response_function_web_search.rbs +24 -8
- data/sig/openai/models/responses/response_input_item.rbs +19 -2
- data/sig/openai/models/responses/tool.rbs +24 -1
- metadata +16 -2
|
@@ -17,7 +17,7 @@ module OpenAI
|
|
|
17
17
|
attr_accessor :id
|
|
18
18
|
|
|
19
19
|
# An object describing the specific action taken in this web search call. Includes
|
|
20
|
-
# details on how the model used the web (search, open_page,
|
|
20
|
+
# details on how the model used the web (search, open_page, find_in_page).
|
|
21
21
|
sig do
|
|
22
22
|
returns(
|
|
23
23
|
T.any(
|
|
@@ -62,7 +62,7 @@ module OpenAI
|
|
|
62
62
|
# The unique ID of the web search tool call.
|
|
63
63
|
id:,
|
|
64
64
|
# An object describing the specific action taken in this web search call. Includes
|
|
65
|
-
# details on how the model used the web (search, open_page,
|
|
65
|
+
# details on how the model used the web (search, open_page, find_in_page).
|
|
66
66
|
action:,
|
|
67
67
|
# The status of the web search tool call.
|
|
68
68
|
status:,
|
|
@@ -91,7 +91,7 @@ module OpenAI
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
# An object describing the specific action taken in this web search call. Includes
|
|
94
|
-
# details on how the model used the web (search, open_page,
|
|
94
|
+
# details on how the model used the web (search, open_page, find_in_page).
|
|
95
95
|
module Action
|
|
96
96
|
extend OpenAI::Internal::Type::Union
|
|
97
97
|
|
|
@@ -113,7 +113,7 @@ module OpenAI
|
|
|
113
113
|
)
|
|
114
114
|
end
|
|
115
115
|
|
|
116
|
-
# The search query.
|
|
116
|
+
# [DEPRECATED] The search query.
|
|
117
117
|
sig { returns(String) }
|
|
118
118
|
attr_accessor :query
|
|
119
119
|
|
|
@@ -121,6 +121,13 @@ module OpenAI
|
|
|
121
121
|
sig { returns(Symbol) }
|
|
122
122
|
attr_accessor :type
|
|
123
123
|
|
|
124
|
+
# The search queries.
|
|
125
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
126
|
+
attr_reader :queries
|
|
127
|
+
|
|
128
|
+
sig { params(queries: T::Array[String]).void }
|
|
129
|
+
attr_writer :queries
|
|
130
|
+
|
|
124
131
|
# The sources used in the search.
|
|
125
132
|
sig do
|
|
126
133
|
returns(
|
|
@@ -147,6 +154,7 @@ module OpenAI
|
|
|
147
154
|
sig do
|
|
148
155
|
params(
|
|
149
156
|
query: String,
|
|
157
|
+
queries: T::Array[String],
|
|
150
158
|
sources:
|
|
151
159
|
T::Array[
|
|
152
160
|
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source::OrHash
|
|
@@ -155,8 +163,10 @@ module OpenAI
|
|
|
155
163
|
).returns(T.attached_class)
|
|
156
164
|
end
|
|
157
165
|
def self.new(
|
|
158
|
-
# The search query.
|
|
166
|
+
# [DEPRECATED] The search query.
|
|
159
167
|
query:,
|
|
168
|
+
# The search queries.
|
|
169
|
+
queries: nil,
|
|
160
170
|
# The sources used in the search.
|
|
161
171
|
sources: nil,
|
|
162
172
|
# The action type.
|
|
@@ -169,6 +179,7 @@ module OpenAI
|
|
|
169
179
|
{
|
|
170
180
|
query: String,
|
|
171
181
|
type: Symbol,
|
|
182
|
+
queries: T::Array[String],
|
|
172
183
|
sources:
|
|
173
184
|
T::Array[
|
|
174
185
|
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source
|
|
@@ -228,20 +239,24 @@ module OpenAI
|
|
|
228
239
|
attr_accessor :type
|
|
229
240
|
|
|
230
241
|
# The URL opened by the model.
|
|
231
|
-
sig { returns(String) }
|
|
242
|
+
sig { returns(T.nilable(String)) }
|
|
232
243
|
attr_accessor :url
|
|
233
244
|
|
|
234
245
|
# Action type "open_page" - Opens a specific URL from search results.
|
|
235
|
-
sig
|
|
246
|
+
sig do
|
|
247
|
+
params(url: T.nilable(String), type: Symbol).returns(
|
|
248
|
+
T.attached_class
|
|
249
|
+
)
|
|
250
|
+
end
|
|
236
251
|
def self.new(
|
|
237
252
|
# The URL opened by the model.
|
|
238
|
-
url
|
|
253
|
+
url: nil,
|
|
239
254
|
# The action type.
|
|
240
255
|
type: :open_page
|
|
241
256
|
)
|
|
242
257
|
end
|
|
243
258
|
|
|
244
|
-
sig { override.returns({ type: Symbol, url: String }) }
|
|
259
|
+
sig { override.returns({ type: Symbol, url: T.nilable(String) }) }
|
|
245
260
|
def to_hash
|
|
246
261
|
end
|
|
247
262
|
end
|
|
@@ -267,7 +282,7 @@ module OpenAI
|
|
|
267
282
|
sig { returns(String) }
|
|
268
283
|
attr_accessor :url
|
|
269
284
|
|
|
270
|
-
# Action type "
|
|
285
|
+
# Action type "find_in_page": Searches for a pattern within a loaded page.
|
|
271
286
|
sig do
|
|
272
287
|
params(pattern: String, url: String, type: Symbol).returns(
|
|
273
288
|
T.attached_class
|
|
@@ -279,7 +294,7 @@ module OpenAI
|
|
|
279
294
|
# The URL of the page searched for the pattern.
|
|
280
295
|
url:,
|
|
281
296
|
# The action type.
|
|
282
|
-
type: :
|
|
297
|
+
type: :find_in_page
|
|
283
298
|
)
|
|
284
299
|
end
|
|
285
300
|
|
|
@@ -1308,6 +1308,16 @@ module OpenAI
|
|
|
1308
1308
|
sig { returns(T.nilable(Integer)) }
|
|
1309
1309
|
attr_accessor :max_output_length
|
|
1310
1310
|
|
|
1311
|
+
# The status of the shell call output.
|
|
1312
|
+
sig do
|
|
1313
|
+
returns(
|
|
1314
|
+
T.nilable(
|
|
1315
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::OrSymbol
|
|
1316
|
+
)
|
|
1317
|
+
)
|
|
1318
|
+
end
|
|
1319
|
+
attr_accessor :status
|
|
1320
|
+
|
|
1311
1321
|
# The streamed output items emitted by a shell tool call.
|
|
1312
1322
|
sig do
|
|
1313
1323
|
params(
|
|
@@ -1318,6 +1328,10 @@ module OpenAI
|
|
|
1318
1328
|
],
|
|
1319
1329
|
id: T.nilable(String),
|
|
1320
1330
|
max_output_length: T.nilable(Integer),
|
|
1331
|
+
status:
|
|
1332
|
+
T.nilable(
|
|
1333
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::OrSymbol
|
|
1334
|
+
),
|
|
1321
1335
|
type: Symbol
|
|
1322
1336
|
).returns(T.attached_class)
|
|
1323
1337
|
end
|
|
@@ -1333,6 +1347,8 @@ module OpenAI
|
|
|
1333
1347
|
# The maximum number of UTF-8 characters captured for this shell call's combined
|
|
1334
1348
|
# output.
|
|
1335
1349
|
max_output_length: nil,
|
|
1350
|
+
# The status of the shell call output.
|
|
1351
|
+
status: nil,
|
|
1336
1352
|
# The type of the item. Always `shell_call_output`.
|
|
1337
1353
|
type: :shell_call_output
|
|
1338
1354
|
)
|
|
@@ -1348,12 +1364,56 @@ module OpenAI
|
|
|
1348
1364
|
],
|
|
1349
1365
|
type: Symbol,
|
|
1350
1366
|
id: T.nilable(String),
|
|
1351
|
-
max_output_length: T.nilable(Integer)
|
|
1367
|
+
max_output_length: T.nilable(Integer),
|
|
1368
|
+
status:
|
|
1369
|
+
T.nilable(
|
|
1370
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::OrSymbol
|
|
1371
|
+
)
|
|
1352
1372
|
}
|
|
1353
1373
|
)
|
|
1354
1374
|
end
|
|
1355
1375
|
def to_hash
|
|
1356
1376
|
end
|
|
1377
|
+
|
|
1378
|
+
# The status of the shell call output.
|
|
1379
|
+
module Status
|
|
1380
|
+
extend OpenAI::Internal::Type::Enum
|
|
1381
|
+
|
|
1382
|
+
TaggedSymbol =
|
|
1383
|
+
T.type_alias do
|
|
1384
|
+
T.all(
|
|
1385
|
+
Symbol,
|
|
1386
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status
|
|
1387
|
+
)
|
|
1388
|
+
end
|
|
1389
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1390
|
+
|
|
1391
|
+
IN_PROGRESS =
|
|
1392
|
+
T.let(
|
|
1393
|
+
:in_progress,
|
|
1394
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::TaggedSymbol
|
|
1395
|
+
)
|
|
1396
|
+
COMPLETED =
|
|
1397
|
+
T.let(
|
|
1398
|
+
:completed,
|
|
1399
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::TaggedSymbol
|
|
1400
|
+
)
|
|
1401
|
+
INCOMPLETE =
|
|
1402
|
+
T.let(
|
|
1403
|
+
:incomplete,
|
|
1404
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::TaggedSymbol
|
|
1405
|
+
)
|
|
1406
|
+
|
|
1407
|
+
sig do
|
|
1408
|
+
override.returns(
|
|
1409
|
+
T::Array[
|
|
1410
|
+
OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status::TaggedSymbol
|
|
1411
|
+
]
|
|
1412
|
+
)
|
|
1413
|
+
end
|
|
1414
|
+
def self.values
|
|
1415
|
+
end
|
|
1416
|
+
end
|
|
1357
1417
|
end
|
|
1358
1418
|
|
|
1359
1419
|
class ApplyPatchCall < OpenAI::Internal::Type::BaseModel
|
|
@@ -718,6 +718,7 @@ module OpenAI
|
|
|
718
718
|
sig { params(file_ids: T::Array[String]).void }
|
|
719
719
|
attr_writer :file_ids
|
|
720
720
|
|
|
721
|
+
# The memory limit for the code interpreter container.
|
|
721
722
|
sig do
|
|
722
723
|
returns(
|
|
723
724
|
T.nilable(
|
|
@@ -742,6 +743,7 @@ module OpenAI
|
|
|
742
743
|
def self.new(
|
|
743
744
|
# An optional list of uploaded files to make available to your code.
|
|
744
745
|
file_ids: nil,
|
|
746
|
+
# The memory limit for the code interpreter container.
|
|
745
747
|
memory_limit: nil,
|
|
746
748
|
# Always `auto`.
|
|
747
749
|
type: :auto
|
|
@@ -763,6 +765,7 @@ module OpenAI
|
|
|
763
765
|
def to_hash
|
|
764
766
|
end
|
|
765
767
|
|
|
768
|
+
# The memory limit for the code interpreter container.
|
|
766
769
|
module MemoryLimit
|
|
767
770
|
extend OpenAI::Internal::Type::Enum
|
|
768
771
|
|
|
@@ -833,6 +836,23 @@ module OpenAI
|
|
|
833
836
|
sig { returns(Symbol) }
|
|
834
837
|
attr_accessor :type
|
|
835
838
|
|
|
839
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
840
|
+
sig do
|
|
841
|
+
returns(
|
|
842
|
+
T.nilable(
|
|
843
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::OrSymbol
|
|
844
|
+
)
|
|
845
|
+
)
|
|
846
|
+
end
|
|
847
|
+
attr_reader :action
|
|
848
|
+
|
|
849
|
+
sig do
|
|
850
|
+
params(
|
|
851
|
+
action: OpenAI::Responses::Tool::ImageGeneration::Action::OrSymbol
|
|
852
|
+
).void
|
|
853
|
+
end
|
|
854
|
+
attr_writer :action
|
|
855
|
+
|
|
836
856
|
# Background type for the generated image. One of `transparent`, `opaque`, or
|
|
837
857
|
# `auto`. Default: `auto`.
|
|
838
858
|
sig do
|
|
@@ -1000,6 +1020,8 @@ module OpenAI
|
|
|
1000
1020
|
# A tool that generates images using the GPT image models.
|
|
1001
1021
|
sig do
|
|
1002
1022
|
params(
|
|
1023
|
+
action:
|
|
1024
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::OrSymbol,
|
|
1003
1025
|
background:
|
|
1004
1026
|
OpenAI::Responses::Tool::ImageGeneration::Background::OrSymbol,
|
|
1005
1027
|
input_fidelity:
|
|
@@ -1026,6 +1048,8 @@ module OpenAI
|
|
|
1026
1048
|
).returns(T.attached_class)
|
|
1027
1049
|
end
|
|
1028
1050
|
def self.new(
|
|
1051
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
1052
|
+
action: nil,
|
|
1029
1053
|
# Background type for the generated image. One of `transparent`, `opaque`, or
|
|
1030
1054
|
# `auto`. Default: `auto`.
|
|
1031
1055
|
background: nil,
|
|
@@ -1064,6 +1088,8 @@ module OpenAI
|
|
|
1064
1088
|
override.returns(
|
|
1065
1089
|
{
|
|
1066
1090
|
type: Symbol,
|
|
1091
|
+
action:
|
|
1092
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::OrSymbol,
|
|
1067
1093
|
background:
|
|
1068
1094
|
OpenAI::Responses::Tool::ImageGeneration::Background::OrSymbol,
|
|
1069
1095
|
input_fidelity:
|
|
@@ -1092,6 +1118,43 @@ module OpenAI
|
|
|
1092
1118
|
def to_hash
|
|
1093
1119
|
end
|
|
1094
1120
|
|
|
1121
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
1122
|
+
module Action
|
|
1123
|
+
extend OpenAI::Internal::Type::Enum
|
|
1124
|
+
|
|
1125
|
+
TaggedSymbol =
|
|
1126
|
+
T.type_alias do
|
|
1127
|
+
T.all(Symbol, OpenAI::Responses::Tool::ImageGeneration::Action)
|
|
1128
|
+
end
|
|
1129
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1130
|
+
|
|
1131
|
+
GENERATE =
|
|
1132
|
+
T.let(
|
|
1133
|
+
:generate,
|
|
1134
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1135
|
+
)
|
|
1136
|
+
EDIT =
|
|
1137
|
+
T.let(
|
|
1138
|
+
:edit,
|
|
1139
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1140
|
+
)
|
|
1141
|
+
AUTO =
|
|
1142
|
+
T.let(
|
|
1143
|
+
:auto,
|
|
1144
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1145
|
+
)
|
|
1146
|
+
|
|
1147
|
+
sig do
|
|
1148
|
+
override.returns(
|
|
1149
|
+
T::Array[
|
|
1150
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1151
|
+
]
|
|
1152
|
+
)
|
|
1153
|
+
end
|
|
1154
|
+
def self.values
|
|
1155
|
+
end
|
|
1156
|
+
end
|
|
1157
|
+
|
|
1095
1158
|
# Background type for the generated image. One of `transparent`, `opaque`, or
|
|
1096
1159
|
# `auto`. Default: `auto`.
|
|
1097
1160
|
module Background
|
|
@@ -1252,6 +1315,11 @@ module OpenAI
|
|
|
1252
1315
|
:"gpt-image-1-mini",
|
|
1253
1316
|
OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1254
1317
|
)
|
|
1318
|
+
GPT_IMAGE_1_5 =
|
|
1319
|
+
T.let(
|
|
1320
|
+
:"gpt-image-1.5",
|
|
1321
|
+
OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1322
|
+
)
|
|
1255
1323
|
end
|
|
1256
1324
|
|
|
1257
1325
|
# Moderation level for the generated image. Default: `auto`.
|
|
@@ -8,14 +8,22 @@ module OpenAI
|
|
|
8
8
|
T.any(OpenAI::VideoCreateError, OpenAI::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# A machine-readable error code that was returned.
|
|
11
12
|
sig { returns(String) }
|
|
12
13
|
attr_accessor :code
|
|
13
14
|
|
|
15
|
+
# A human-readable description of the error that was returned.
|
|
14
16
|
sig { returns(String) }
|
|
15
17
|
attr_accessor :message
|
|
16
18
|
|
|
19
|
+
# An error that occurred while generating the response.
|
|
17
20
|
sig { params(code: String, message: String).returns(T.attached_class) }
|
|
18
|
-
def self.new(
|
|
21
|
+
def self.new(
|
|
22
|
+
# A machine-readable error code that was returned.
|
|
23
|
+
code:,
|
|
24
|
+
# A human-readable description of the error that was returned.
|
|
25
|
+
message:
|
|
26
|
+
)
|
|
19
27
|
end
|
|
20
28
|
|
|
21
29
|
sig { override.returns({ code: String, message: String }) }
|
|
@@ -26,9 +26,10 @@ module OpenAI
|
|
|
26
26
|
# One of the available [TTS models](https://platform.openai.com/docs/models#tts):
|
|
27
27
|
# `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
|
|
28
28
|
model:,
|
|
29
|
-
# The voice to use when generating the audio. Supported voices are
|
|
30
|
-
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
|
|
31
|
-
# `verse`. Previews of the voices are available
|
|
29
|
+
# The voice to use when generating the audio. Supported built-in voices are
|
|
30
|
+
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
|
|
31
|
+
# `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
|
|
32
|
+
# in the
|
|
32
33
|
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
|
|
33
34
|
voice:,
|
|
34
35
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
@@ -4,8 +4,8 @@ module OpenAI
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Files
|
|
6
6
|
# Upload a file that can be used across various endpoints. Individual files can be
|
|
7
|
-
# up to 512 MB, and
|
|
8
|
-
#
|
|
7
|
+
# up to 512 MB, and each project can store up to 2.5 TB of files in total. There
|
|
8
|
+
# is no organization-wide storage limit.
|
|
9
9
|
#
|
|
10
10
|
# - The Assistants API supports files up to 2 million tokens and of specific file
|
|
11
11
|
# types. See the
|
|
@@ -34,10 +34,14 @@ module OpenAI
|
|
|
34
34
|
def create(
|
|
35
35
|
# The File object (not file name) to be uploaded.
|
|
36
36
|
file:,
|
|
37
|
-
# The intended purpose of the uploaded file. One of:
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
37
|
+
# The intended purpose of the uploaded file. One of:
|
|
38
|
+
#
|
|
39
|
+
# - `assistants`: Used in the Assistants API
|
|
40
|
+
# - `batch`: Used in the Batch API
|
|
41
|
+
# - `fine-tune`: Used for fine-tuning
|
|
42
|
+
# - `vision`: Images used for vision fine-tuning
|
|
43
|
+
# - `user_data`: Flexible file type for any purpose
|
|
44
|
+
# - `evals`: Used for eval data sets
|
|
41
45
|
purpose:,
|
|
42
46
|
# The expiration policy for a file. By default, files with `purpose=batch` expire
|
|
43
47
|
# after 30 days and all other files are persisted until they are manually deleted.
|
|
@@ -45,7 +45,8 @@ module OpenAI
|
|
|
45
45
|
# See {OpenAI::Resources::Images#edit_stream_raw} for streaming counterpart.
|
|
46
46
|
#
|
|
47
47
|
# Creates an edited or extended image given one or more source images and a
|
|
48
|
-
# prompt. This endpoint
|
|
48
|
+
# prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`,
|
|
49
|
+
# and `gpt-image-1-mini`) and `dall-e-2`.
|
|
49
50
|
sig do
|
|
50
51
|
params(
|
|
51
52
|
image: OpenAI::ImageEditParams::Image::Variants,
|
|
@@ -148,7 +149,8 @@ module OpenAI
|
|
|
148
149
|
# See {OpenAI::Resources::Images#edit} for non-streaming counterpart.
|
|
149
150
|
#
|
|
150
151
|
# Creates an edited or extended image given one or more source images and a
|
|
151
|
-
# prompt. This endpoint
|
|
152
|
+
# prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`,
|
|
153
|
+
# and `gpt-image-1-mini`) and `dall-e-2`.
|
|
152
154
|
sig do
|
|
153
155
|
params(
|
|
154
156
|
image: OpenAI::ImageEditParams::Image::Variants,
|
|
@@ -97,9 +97,7 @@ module OpenAI
|
|
|
97
97
|
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
98
98
|
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
99
99
|
text: nil,
|
|
100
|
-
#
|
|
101
|
-
# response. See the `tools` parameter to see how to specify which tools the model
|
|
102
|
-
# can call.
|
|
100
|
+
# Controls which tool the model should use, if any.
|
|
103
101
|
tool_choice: nil,
|
|
104
102
|
# An array of tools the model may call while generating a response. You can
|
|
105
103
|
# specify which tool to use by setting the `tool_choice` parameter.
|
|
@@ -7,6 +7,7 @@ module OpenAI
|
|
|
7
7
|
call_id: String,
|
|
8
8
|
event_id: String,
|
|
9
9
|
item_id: String,
|
|
10
|
+
name: String,
|
|
10
11
|
output_index: Integer,
|
|
11
12
|
response_id: String,
|
|
12
13
|
type: :"response.function_call_arguments.done"
|
|
@@ -21,6 +22,8 @@ module OpenAI
|
|
|
21
22
|
|
|
22
23
|
attr_accessor item_id: String
|
|
23
24
|
|
|
25
|
+
attr_accessor name: String
|
|
26
|
+
|
|
24
27
|
attr_accessor output_index: Integer
|
|
25
28
|
|
|
26
29
|
attr_accessor response_id: String
|
|
@@ -32,6 +35,7 @@ module OpenAI
|
|
|
32
35
|
call_id: String,
|
|
33
36
|
event_id: String,
|
|
34
37
|
item_id: String,
|
|
38
|
+
name: String,
|
|
35
39
|
output_index: Integer,
|
|
36
40
|
response_id: String,
|
|
37
41
|
?type: :"response.function_call_arguments.done"
|
|
@@ -42,6 +46,7 @@ module OpenAI
|
|
|
42
46
|
call_id: String,
|
|
43
47
|
event_id: String,
|
|
44
48
|
item_id: String,
|
|
49
|
+
name: String,
|
|
45
50
|
output_index: Integer,
|
|
46
51
|
response_id: String,
|
|
47
52
|
type: :"response.function_call_arguments.done"
|
|
@@ -18,6 +18,7 @@ module OpenAI
|
|
|
18
18
|
tools: ::Array[OpenAI::Models::Responses::tool],
|
|
19
19
|
top_p: Float?,
|
|
20
20
|
background: bool?,
|
|
21
|
+
completed_at: Float?,
|
|
21
22
|
conversation: OpenAI::Responses::Response::Conversation?,
|
|
22
23
|
max_output_tokens: Integer?,
|
|
23
24
|
max_tool_calls: Integer?,
|
|
@@ -67,6 +68,8 @@ module OpenAI
|
|
|
67
68
|
|
|
68
69
|
attr_accessor background: bool?
|
|
69
70
|
|
|
71
|
+
attr_accessor completed_at: Float?
|
|
72
|
+
|
|
70
73
|
attr_accessor conversation: OpenAI::Responses::Response::Conversation?
|
|
71
74
|
|
|
72
75
|
attr_accessor max_output_tokens: Integer?
|
|
@@ -132,6 +135,7 @@ module OpenAI
|
|
|
132
135
|
tools: ::Array[OpenAI::Models::Responses::tool],
|
|
133
136
|
top_p: Float?,
|
|
134
137
|
?background: bool?,
|
|
138
|
+
?completed_at: Float?,
|
|
135
139
|
?conversation: OpenAI::Responses::Response::Conversation?,
|
|
136
140
|
?max_output_tokens: Integer?,
|
|
137
141
|
?max_tool_calls: Integer?,
|
|
@@ -167,6 +171,7 @@ module OpenAI
|
|
|
167
171
|
tools: ::Array[OpenAI::Models::Responses::tool],
|
|
168
172
|
top_p: Float?,
|
|
169
173
|
background: bool?,
|
|
174
|
+
completed_at: Float?,
|
|
170
175
|
conversation: OpenAI::Responses::Response::Conversation?,
|
|
171
176
|
max_output_tokens: Integer?,
|
|
172
177
|
max_tool_calls: Integer?,
|
|
@@ -7,6 +7,7 @@ module OpenAI
|
|
|
7
7
|
call_id: String,
|
|
8
8
|
max_output_length: Integer?,
|
|
9
9
|
output: ::Array[OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output],
|
|
10
|
+
status: OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::status,
|
|
10
11
|
type: :shell_call_output,
|
|
11
12
|
created_by: String
|
|
12
13
|
}
|
|
@@ -20,6 +21,8 @@ module OpenAI
|
|
|
20
21
|
|
|
21
22
|
attr_accessor output: ::Array[OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output]
|
|
22
23
|
|
|
24
|
+
attr_accessor status: OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::status
|
|
25
|
+
|
|
23
26
|
attr_accessor type: :shell_call_output
|
|
24
27
|
|
|
25
28
|
attr_reader created_by: String?
|
|
@@ -31,6 +34,7 @@ module OpenAI
|
|
|
31
34
|
call_id: String,
|
|
32
35
|
max_output_length: Integer?,
|
|
33
36
|
output: ::Array[OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output],
|
|
37
|
+
status: OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::status,
|
|
34
38
|
?created_by: String,
|
|
35
39
|
?type: :shell_call_output
|
|
36
40
|
) -> void
|
|
@@ -40,6 +44,7 @@ module OpenAI
|
|
|
40
44
|
call_id: String,
|
|
41
45
|
max_output_length: Integer?,
|
|
42
46
|
output: ::Array[OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output],
|
|
47
|
+
status: OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::status,
|
|
43
48
|
type: :shell_call_output,
|
|
44
49
|
created_by: String
|
|
45
50
|
}
|
|
@@ -109,6 +114,18 @@ module OpenAI
|
|
|
109
114
|
def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::outcome]
|
|
110
115
|
end
|
|
111
116
|
end
|
|
117
|
+
|
|
118
|
+
type status = :in_progress | :completed | :incomplete
|
|
119
|
+
|
|
120
|
+
module Status
|
|
121
|
+
extend OpenAI::Internal::Type::Enum
|
|
122
|
+
|
|
123
|
+
IN_PROGRESS: :in_progress
|
|
124
|
+
COMPLETED: :completed
|
|
125
|
+
INCOMPLETE: :incomplete
|
|
126
|
+
|
|
127
|
+
def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::status]
|
|
128
|
+
end
|
|
112
129
|
end
|
|
113
130
|
end
|
|
114
131
|
end
|
|
@@ -44,6 +44,7 @@ module OpenAI
|
|
|
44
44
|
{
|
|
45
45
|
query: String,
|
|
46
46
|
type: :search,
|
|
47
|
+
queries: ::Array[String],
|
|
47
48
|
sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -52,6 +53,10 @@ module OpenAI
|
|
|
52
53
|
|
|
53
54
|
attr_accessor type: :search
|
|
54
55
|
|
|
56
|
+
attr_reader queries: ::Array[String]?
|
|
57
|
+
|
|
58
|
+
def queries=: (::Array[String]) -> ::Array[String]
|
|
59
|
+
|
|
55
60
|
attr_reader sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]?
|
|
56
61
|
|
|
57
62
|
def sources=: (
|
|
@@ -60,6 +65,7 @@ module OpenAI
|
|
|
60
65
|
|
|
61
66
|
def initialize: (
|
|
62
67
|
query: String,
|
|
68
|
+
?queries: ::Array[String],
|
|
63
69
|
?sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source],
|
|
64
70
|
?type: :search
|
|
65
71
|
) -> void
|
|
@@ -67,6 +73,7 @@ module OpenAI
|
|
|
67
73
|
def to_hash: -> {
|
|
68
74
|
query: String,
|
|
69
75
|
type: :search,
|
|
76
|
+
queries: ::Array[String],
|
|
70
77
|
sources: ::Array[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source]
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -83,30 +90,39 @@ module OpenAI
|
|
|
83
90
|
end
|
|
84
91
|
end
|
|
85
92
|
|
|
86
|
-
type open_page = { type: :open_page, url: String }
|
|
93
|
+
type open_page = { type: :open_page, url: String? }
|
|
87
94
|
|
|
88
95
|
class OpenPage < OpenAI::Internal::Type::BaseModel
|
|
89
96
|
attr_accessor type: :open_page
|
|
90
97
|
|
|
91
|
-
attr_accessor url: String
|
|
98
|
+
attr_accessor url: String?
|
|
92
99
|
|
|
93
|
-
def initialize: (url: String
|
|
100
|
+
def initialize: (?url: String?, ?type: :open_page) -> void
|
|
94
101
|
|
|
95
|
-
def to_hash: -> { type: :open_page, url: String }
|
|
102
|
+
def to_hash: -> { type: :open_page, url: String? }
|
|
96
103
|
end
|
|
97
104
|
|
|
98
|
-
type
|
|
105
|
+
type find_in_page =
|
|
106
|
+
{ pattern: String, type: :find_in_page, url: String }
|
|
99
107
|
|
|
100
108
|
class Find < OpenAI::Internal::Type::BaseModel
|
|
101
109
|
attr_accessor pattern: String
|
|
102
110
|
|
|
103
|
-
attr_accessor type: :
|
|
111
|
+
attr_accessor type: :find_in_page
|
|
104
112
|
|
|
105
113
|
attr_accessor url: String
|
|
106
114
|
|
|
107
|
-
def initialize: (
|
|
115
|
+
def initialize: (
|
|
116
|
+
pattern: String,
|
|
117
|
+
url: String,
|
|
118
|
+
?type: :find_in_page
|
|
119
|
+
) -> void
|
|
108
120
|
|
|
109
|
-
def to_hash: -> {
|
|
121
|
+
def to_hash: -> {
|
|
122
|
+
pattern: String,
|
|
123
|
+
type: :find_in_page,
|
|
124
|
+
url: String
|
|
125
|
+
}
|
|
110
126
|
end
|
|
111
127
|
|
|
112
128
|
def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseFunctionWebSearch::action]
|