openai 0.43.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 +41 -0
- data/README.md +11 -11
- data/lib/openai/internal/transport/pooled_net_requester.rb +1 -1
- data/lib/openai/models/beta/assistant.rb +2 -0
- 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/response_function_call_arguments_done_event.rb +9 -1
- data/lib/openai/models/responses/response_computer_tool_call.rb +6 -6
- data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +25 -1
- data/lib/openai/models/responses/response_function_web_search.rb +15 -15
- data/lib/openai/models/responses/response_input_item.rb +27 -1
- data/lib/openai/models/responses/tool.rb +26 -1
- data/lib/openai/resources/beta/assistants.rb +10 -0
- data/lib/openai/resources/files.rb +3 -3
- data/lib/openai/version.rb +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/response_function_call_arguments_done_event.rbi +8 -0
- data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +57 -0
- data/rbi/openai/models/responses/response_function_web_search.rbi +13 -9
- data/rbi/openai/models/responses/response_input_item.rbi +61 -1
- data/rbi/openai/models/responses/tool.rbi +65 -0
- data/rbi/openai/resources/files.rbi +10 -6
- data/sig/openai/models/realtime/response_function_call_arguments_done_event.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 +17 -8
- data/sig/openai/models/responses/response_input_item.rbs +19 -2
- data/sig/openai/models/responses/tool.rbs +24 -1
- metadata +2 -2
|
@@ -15,10 +15,14 @@ module OpenAI
|
|
|
15
15
|
sig { returns(OpenAI::Internal::FileInput) }
|
|
16
16
|
attr_accessor :file
|
|
17
17
|
|
|
18
|
-
# The intended purpose of the uploaded file. One of:
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
18
|
+
# The intended purpose of the uploaded file. One of:
|
|
19
|
+
#
|
|
20
|
+
# - `assistants`: Used in the Assistants API
|
|
21
|
+
# - `batch`: Used in the Batch API
|
|
22
|
+
# - `fine-tune`: Used for fine-tuning
|
|
23
|
+
# - `vision`: Images used for vision fine-tuning
|
|
24
|
+
# - `user_data`: Flexible file type for any purpose
|
|
25
|
+
# - `evals`: Used for eval data sets
|
|
22
26
|
sig { returns(OpenAI::FilePurpose::OrSymbol) }
|
|
23
27
|
attr_accessor :purpose
|
|
24
28
|
|
|
@@ -45,10 +49,14 @@ module OpenAI
|
|
|
45
49
|
def self.new(
|
|
46
50
|
# The File object (not file name) to be uploaded.
|
|
47
51
|
file:,
|
|
48
|
-
# The intended purpose of the uploaded file. One of:
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
+
# The intended purpose of the uploaded file. One of:
|
|
53
|
+
#
|
|
54
|
+
# - `assistants`: Used in the Assistants API
|
|
55
|
+
# - `batch`: Used in the Batch API
|
|
56
|
+
# - `fine-tune`: Used for fine-tuning
|
|
57
|
+
# - `vision`: Images used for vision fine-tuning
|
|
58
|
+
# - `user_data`: Flexible file type for any purpose
|
|
59
|
+
# - `evals`: Used for eval data sets
|
|
52
60
|
purpose:,
|
|
53
61
|
# The expiration policy for a file. By default, files with `purpose=batch` expire
|
|
54
62
|
# after 30 days and all other files are persisted until they are manually deleted.
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
|
-
# The intended purpose of the uploaded file. One of:
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
5
|
+
# The intended purpose of the uploaded file. One of:
|
|
6
|
+
#
|
|
7
|
+
# - `assistants`: Used in the Assistants API
|
|
8
|
+
# - `batch`: Used in the Batch API
|
|
9
|
+
# - `fine-tune`: Used for fine-tuning
|
|
10
|
+
# - `vision`: Images used for vision fine-tuning
|
|
11
|
+
# - `user_data`: Flexible file type for any purpose
|
|
12
|
+
# - `evals`: Used for eval data sets
|
|
9
13
|
module FilePurpose
|
|
10
14
|
extend OpenAI::Internal::Type::Enum
|
|
11
15
|
|
|
@@ -42,10 +42,14 @@ module OpenAI
|
|
|
42
42
|
attr_writer :event_id
|
|
43
43
|
|
|
44
44
|
# The ID of the preceding item after which the new item will be inserted. If not
|
|
45
|
-
# set, the new item will be appended to the end of the conversation.
|
|
46
|
-
#
|
|
47
|
-
# to
|
|
48
|
-
#
|
|
45
|
+
# set, the new item will be appended to the end of the conversation.
|
|
46
|
+
#
|
|
47
|
+
# If set to `root`, the new item will be added to the beginning of the
|
|
48
|
+
# conversation.
|
|
49
|
+
#
|
|
50
|
+
# If set to an existing ID, it allows an item to be inserted mid-conversation. If
|
|
51
|
+
# the ID cannot be found, an error will be returned and the item will not be
|
|
52
|
+
# added.
|
|
49
53
|
sig { returns(T.nilable(String)) }
|
|
50
54
|
attr_reader :previous_item_id
|
|
51
55
|
|
|
@@ -84,10 +88,14 @@ module OpenAI
|
|
|
84
88
|
# Optional client-generated ID used to identify this event.
|
|
85
89
|
event_id: nil,
|
|
86
90
|
# The ID of the preceding item after which the new item will be inserted. If not
|
|
87
|
-
# set, the new item will be appended to the end of the conversation.
|
|
88
|
-
#
|
|
89
|
-
# to
|
|
90
|
-
#
|
|
91
|
+
# set, the new item will be appended to the end of the conversation.
|
|
92
|
+
#
|
|
93
|
+
# If set to `root`, the new item will be added to the beginning of the
|
|
94
|
+
# conversation.
|
|
95
|
+
#
|
|
96
|
+
# If set to an existing ID, it allows an item to be inserted mid-conversation. If
|
|
97
|
+
# the ID cannot be found, an error will be returned and the item will not be
|
|
98
|
+
# added.
|
|
91
99
|
previous_item_id: nil,
|
|
92
100
|
# The event type, must be `conversation.item.create`.
|
|
93
101
|
type: :"conversation.item.create"
|
|
@@ -28,6 +28,10 @@ module OpenAI
|
|
|
28
28
|
sig { returns(String) }
|
|
29
29
|
attr_accessor :item_id
|
|
30
30
|
|
|
31
|
+
# The name of the function that was called.
|
|
32
|
+
sig { returns(String) }
|
|
33
|
+
attr_accessor :name
|
|
34
|
+
|
|
31
35
|
# The index of the output item in the response.
|
|
32
36
|
sig { returns(Integer) }
|
|
33
37
|
attr_accessor :output_index
|
|
@@ -48,6 +52,7 @@ module OpenAI
|
|
|
48
52
|
call_id: String,
|
|
49
53
|
event_id: String,
|
|
50
54
|
item_id: String,
|
|
55
|
+
name: String,
|
|
51
56
|
output_index: Integer,
|
|
52
57
|
response_id: String,
|
|
53
58
|
type: Symbol
|
|
@@ -62,6 +67,8 @@ module OpenAI
|
|
|
62
67
|
event_id:,
|
|
63
68
|
# The ID of the function call item.
|
|
64
69
|
item_id:,
|
|
70
|
+
# The name of the function that was called.
|
|
71
|
+
name:,
|
|
65
72
|
# The index of the output item in the response.
|
|
66
73
|
output_index:,
|
|
67
74
|
# The ID of the response.
|
|
@@ -78,6 +85,7 @@ module OpenAI
|
|
|
78
85
|
call_id: String,
|
|
79
86
|
event_id: String,
|
|
80
87
|
item_id: String,
|
|
88
|
+
name: String,
|
|
81
89
|
output_index: Integer,
|
|
82
90
|
response_id: String,
|
|
83
91
|
type: Symbol
|
|
@@ -36,6 +36,15 @@ module OpenAI
|
|
|
36
36
|
end
|
|
37
37
|
attr_accessor :output
|
|
38
38
|
|
|
39
|
+
# The status of the shell call output. One of `in_progress`, `completed`, or
|
|
40
|
+
# `incomplete`.
|
|
41
|
+
sig do
|
|
42
|
+
returns(
|
|
43
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::TaggedSymbol
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
attr_accessor :status
|
|
47
|
+
|
|
39
48
|
# The type of the shell call output. Always `shell_call_output`.
|
|
40
49
|
sig { returns(Symbol) }
|
|
41
50
|
attr_accessor :type
|
|
@@ -57,6 +66,8 @@ module OpenAI
|
|
|
57
66
|
T::Array[
|
|
58
67
|
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::OrHash
|
|
59
68
|
],
|
|
69
|
+
status:
|
|
70
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::OrSymbol,
|
|
60
71
|
created_by: String,
|
|
61
72
|
type: Symbol
|
|
62
73
|
).returns(T.attached_class)
|
|
@@ -72,6 +83,9 @@ module OpenAI
|
|
|
72
83
|
max_output_length:,
|
|
73
84
|
# An array of shell call output contents
|
|
74
85
|
output:,
|
|
86
|
+
# The status of the shell call output. One of `in_progress`, `completed`, or
|
|
87
|
+
# `incomplete`.
|
|
88
|
+
status:,
|
|
75
89
|
# The identifier of the actor that created the item.
|
|
76
90
|
created_by: nil,
|
|
77
91
|
# The type of the shell call output. Always `shell_call_output`.
|
|
@@ -89,6 +103,8 @@ module OpenAI
|
|
|
89
103
|
T::Array[
|
|
90
104
|
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output
|
|
91
105
|
],
|
|
106
|
+
status:
|
|
107
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::TaggedSymbol,
|
|
92
108
|
type: Symbol,
|
|
93
109
|
created_by: String
|
|
94
110
|
}
|
|
@@ -256,6 +272,47 @@ module OpenAI
|
|
|
256
272
|
end
|
|
257
273
|
end
|
|
258
274
|
end
|
|
275
|
+
|
|
276
|
+
# The status of the shell call output. One of `in_progress`, `completed`, or
|
|
277
|
+
# `incomplete`.
|
|
278
|
+
module Status
|
|
279
|
+
extend OpenAI::Internal::Type::Enum
|
|
280
|
+
|
|
281
|
+
TaggedSymbol =
|
|
282
|
+
T.type_alias do
|
|
283
|
+
T.all(
|
|
284
|
+
Symbol,
|
|
285
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
289
|
+
|
|
290
|
+
IN_PROGRESS =
|
|
291
|
+
T.let(
|
|
292
|
+
:in_progress,
|
|
293
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::TaggedSymbol
|
|
294
|
+
)
|
|
295
|
+
COMPLETED =
|
|
296
|
+
T.let(
|
|
297
|
+
:completed,
|
|
298
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::TaggedSymbol
|
|
299
|
+
)
|
|
300
|
+
INCOMPLETE =
|
|
301
|
+
T.let(
|
|
302
|
+
:incomplete,
|
|
303
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::TaggedSymbol
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
sig do
|
|
307
|
+
override.returns(
|
|
308
|
+
T::Array[
|
|
309
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status::TaggedSymbol
|
|
310
|
+
]
|
|
311
|
+
)
|
|
312
|
+
end
|
|
313
|
+
def self.values
|
|
314
|
+
end
|
|
315
|
+
end
|
|
259
316
|
end
|
|
260
317
|
end
|
|
261
318
|
end
|
|
@@ -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
|
|
|
@@ -239,20 +239,24 @@ module OpenAI
|
|
|
239
239
|
attr_accessor :type
|
|
240
240
|
|
|
241
241
|
# The URL opened by the model.
|
|
242
|
-
sig { returns(String) }
|
|
242
|
+
sig { returns(T.nilable(String)) }
|
|
243
243
|
attr_accessor :url
|
|
244
244
|
|
|
245
245
|
# Action type "open_page" - Opens a specific URL from search results.
|
|
246
|
-
sig
|
|
246
|
+
sig do
|
|
247
|
+
params(url: T.nilable(String), type: Symbol).returns(
|
|
248
|
+
T.attached_class
|
|
249
|
+
)
|
|
250
|
+
end
|
|
247
251
|
def self.new(
|
|
248
252
|
# The URL opened by the model.
|
|
249
|
-
url
|
|
253
|
+
url: nil,
|
|
250
254
|
# The action type.
|
|
251
255
|
type: :open_page
|
|
252
256
|
)
|
|
253
257
|
end
|
|
254
258
|
|
|
255
|
-
sig { override.returns({ type: Symbol, url: String }) }
|
|
259
|
+
sig { override.returns({ type: Symbol, url: T.nilable(String) }) }
|
|
256
260
|
def to_hash
|
|
257
261
|
end
|
|
258
262
|
end
|
|
@@ -278,7 +282,7 @@ module OpenAI
|
|
|
278
282
|
sig { returns(String) }
|
|
279
283
|
attr_accessor :url
|
|
280
284
|
|
|
281
|
-
# Action type "
|
|
285
|
+
# Action type "find_in_page": Searches for a pattern within a loaded page.
|
|
282
286
|
sig do
|
|
283
287
|
params(pattern: String, url: String, type: Symbol).returns(
|
|
284
288
|
T.attached_class
|
|
@@ -290,7 +294,7 @@ module OpenAI
|
|
|
290
294
|
# The URL of the page searched for the pattern.
|
|
291
295
|
url:,
|
|
292
296
|
# The action type.
|
|
293
|
-
type: :
|
|
297
|
+
type: :find_in_page
|
|
294
298
|
)
|
|
295
299
|
end
|
|
296
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
|
|
@@ -836,6 +836,23 @@ module OpenAI
|
|
|
836
836
|
sig { returns(Symbol) }
|
|
837
837
|
attr_accessor :type
|
|
838
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
|
+
|
|
839
856
|
# Background type for the generated image. One of `transparent`, `opaque`, or
|
|
840
857
|
# `auto`. Default: `auto`.
|
|
841
858
|
sig do
|
|
@@ -1003,6 +1020,8 @@ module OpenAI
|
|
|
1003
1020
|
# A tool that generates images using the GPT image models.
|
|
1004
1021
|
sig do
|
|
1005
1022
|
params(
|
|
1023
|
+
action:
|
|
1024
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::OrSymbol,
|
|
1006
1025
|
background:
|
|
1007
1026
|
OpenAI::Responses::Tool::ImageGeneration::Background::OrSymbol,
|
|
1008
1027
|
input_fidelity:
|
|
@@ -1029,6 +1048,8 @@ module OpenAI
|
|
|
1029
1048
|
).returns(T.attached_class)
|
|
1030
1049
|
end
|
|
1031
1050
|
def self.new(
|
|
1051
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
1052
|
+
action: nil,
|
|
1032
1053
|
# Background type for the generated image. One of `transparent`, `opaque`, or
|
|
1033
1054
|
# `auto`. Default: `auto`.
|
|
1034
1055
|
background: nil,
|
|
@@ -1067,6 +1088,8 @@ module OpenAI
|
|
|
1067
1088
|
override.returns(
|
|
1068
1089
|
{
|
|
1069
1090
|
type: Symbol,
|
|
1091
|
+
action:
|
|
1092
|
+
OpenAI::Responses::Tool::ImageGeneration::Action::OrSymbol,
|
|
1070
1093
|
background:
|
|
1071
1094
|
OpenAI::Responses::Tool::ImageGeneration::Background::OrSymbol,
|
|
1072
1095
|
input_fidelity:
|
|
@@ -1095,6 +1118,43 @@ module OpenAI
|
|
|
1095
1118
|
def to_hash
|
|
1096
1119
|
end
|
|
1097
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
|
+
|
|
1098
1158
|
# Background type for the generated image. One of `transparent`, `opaque`, or
|
|
1099
1159
|
# `auto`. Default: `auto`.
|
|
1100
1160
|
module Background
|
|
@@ -1255,6 +1315,11 @@ module OpenAI
|
|
|
1255
1315
|
:"gpt-image-1-mini",
|
|
1256
1316
|
OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1257
1317
|
)
|
|
1318
|
+
GPT_IMAGE_1_5 =
|
|
1319
|
+
T.let(
|
|
1320
|
+
:"gpt-image-1.5",
|
|
1321
|
+
OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1322
|
+
)
|
|
1258
1323
|
end
|
|
1259
1324
|
|
|
1260
1325
|
# Moderation level for the generated image. Default: `auto`.
|
|
@@ -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.
|
|
@@ -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"
|
|
@@ -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
|
|
@@ -90,30 +90,39 @@ module OpenAI
|
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
-
type open_page = { type: :open_page, url: String }
|
|
93
|
+
type open_page = { type: :open_page, url: String? }
|
|
94
94
|
|
|
95
95
|
class OpenPage < OpenAI::Internal::Type::BaseModel
|
|
96
96
|
attr_accessor type: :open_page
|
|
97
97
|
|
|
98
|
-
attr_accessor url: String
|
|
98
|
+
attr_accessor url: String?
|
|
99
99
|
|
|
100
|
-
def initialize: (url: String
|
|
100
|
+
def initialize: (?url: String?, ?type: :open_page) -> void
|
|
101
101
|
|
|
102
|
-
def to_hash: -> { type: :open_page, url: String }
|
|
102
|
+
def to_hash: -> { type: :open_page, url: String? }
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
-
type
|
|
105
|
+
type find_in_page =
|
|
106
|
+
{ pattern: String, type: :find_in_page, url: String }
|
|
106
107
|
|
|
107
108
|
class Find < OpenAI::Internal::Type::BaseModel
|
|
108
109
|
attr_accessor pattern: String
|
|
109
110
|
|
|
110
|
-
attr_accessor type: :
|
|
111
|
+
attr_accessor type: :find_in_page
|
|
111
112
|
|
|
112
113
|
attr_accessor url: String
|
|
113
114
|
|
|
114
|
-
def initialize: (
|
|
115
|
+
def initialize: (
|
|
116
|
+
pattern: String,
|
|
117
|
+
url: String,
|
|
118
|
+
?type: :find_in_page
|
|
119
|
+
) -> void
|
|
115
120
|
|
|
116
|
-
def to_hash: -> {
|
|
121
|
+
def to_hash: -> {
|
|
122
|
+
pattern: String,
|
|
123
|
+
type: :find_in_page,
|
|
124
|
+
url: String
|
|
125
|
+
}
|
|
117
126
|
end
|
|
118
127
|
|
|
119
128
|
def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseFunctionWebSearch::action]
|