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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/README.md +12 -18
  4. data/lib/openai/internal/transport/pooled_net_requester.rb +1 -1
  5. data/lib/openai/models/audio/speech_create_params.rb +9 -7
  6. data/lib/openai/models/beta/assistant.rb +2 -0
  7. data/lib/openai/models/chat/chat_completion_audio_param.rb +7 -5
  8. data/lib/openai/models/conversations/conversation_item.rb +1 -1
  9. data/lib/openai/models/conversations/message.rb +1 -1
  10. data/lib/openai/models/file_create_params.rb +9 -5
  11. data/lib/openai/models/file_purpose.rb +8 -4
  12. data/lib/openai/models/realtime/conversation_item_create_event.rb +9 -5
  13. data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -9
  14. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -9
  15. data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +9 -1
  16. data/lib/openai/models/responses/input_token_count_params.rb +4 -7
  17. data/lib/openai/models/responses/response.rb +17 -8
  18. data/lib/openai/models/responses/response_compact_params.rb +1 -0
  19. data/lib/openai/models/responses/response_compaction_item.rb +4 -2
  20. data/lib/openai/models/responses/response_compaction_item_param.rb +2 -1
  21. data/lib/openai/models/responses/response_computer_tool_call.rb +6 -6
  22. data/lib/openai/models/responses/response_function_call_output_item.rb +1 -1
  23. data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +35 -7
  24. data/lib/openai/models/responses/response_function_web_search.rb +26 -18
  25. data/lib/openai/models/responses/response_input_item.rb +28 -1
  26. data/lib/openai/models/responses/response_item.rb +1 -1
  27. data/lib/openai/models/responses/response_output_item.rb +1 -1
  28. data/lib/openai/models/responses/response_output_text.rb +1 -1
  29. data/lib/openai/models/responses/tool.rb +30 -2
  30. data/lib/openai/models/video_create_error.rb +7 -2
  31. data/lib/openai/resources/audio/speech.rb +1 -1
  32. data/lib/openai/resources/beta/assistants.rb +10 -0
  33. data/lib/openai/resources/files.rb +3 -3
  34. data/lib/openai/resources/images.rb +4 -2
  35. data/lib/openai/resources/responses/input_tokens.rb +1 -1
  36. data/lib/openai/version.rb +1 -1
  37. data/rbi/openai/models/audio/speech_create_params.rbi +12 -9
  38. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +9 -6
  39. data/rbi/openai/models/conversations/message.rbi +1 -1
  40. data/rbi/openai/models/file_create_params.rbi +16 -8
  41. data/rbi/openai/models/file_purpose.rbi +8 -4
  42. data/rbi/openai/models/realtime/conversation_item_create_event.rbi +16 -8
  43. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +12 -12
  44. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +12 -12
  45. data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +8 -0
  46. data/rbi/openai/models/responses/input_token_count_params.rbi +3 -9
  47. data/rbi/openai/models/responses/response.rbi +18 -8
  48. data/rbi/openai/models/responses/response_compaction_item.rbi +4 -0
  49. data/rbi/openai/models/responses/response_compaction_item_param.rbi +2 -0
  50. data/rbi/openai/models/responses/response_function_call_output_item.rbi +1 -1
  51. data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +67 -2
  52. data/rbi/openai/models/responses/response_function_web_search.rbi +26 -11
  53. data/rbi/openai/models/responses/response_input_item.rbi +61 -1
  54. data/rbi/openai/models/responses/response_output_text.rbi +1 -1
  55. data/rbi/openai/models/responses/tool.rbi +68 -0
  56. data/rbi/openai/models/video_create_error.rbi +9 -1
  57. data/rbi/openai/resources/audio/speech.rbi +4 -3
  58. data/rbi/openai/resources/files.rbi +10 -6
  59. data/rbi/openai/resources/images.rbi +4 -2
  60. data/rbi/openai/resources/responses/input_tokens.rbi +1 -3
  61. data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +5 -0
  62. data/sig/openai/models/responses/response.rbs +5 -0
  63. data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +17 -0
  64. data/sig/openai/models/responses/response_function_web_search.rbs +24 -8
  65. data/sig/openai/models/responses/response_input_item.rbs +19 -2
  66. data/sig/openai/models/responses/tool.rbs +24 -1
  67. metadata +16 -2
@@ -222,7 +222,7 @@ module OpenAI
222
222
  #
223
223
  # @param path [Array<OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag::Path>] An array of coordinates representing the path of the drag action. Coordinates wi
224
224
  #
225
- # @param type [Symbol, :drag] Specifies the event type. For a drag action, this property is
225
+ # @param type [Symbol, :drag] Specifies the event type. For a drag action, this property is always set to `dra
226
226
 
227
227
  class Path < OpenAI::Internal::Type::BaseModel
228
228
  # @!attribute x
@@ -304,7 +304,7 @@ module OpenAI
304
304
  #
305
305
  # @param y_ [Integer] The y-coordinate to move to.
306
306
  #
307
- # @param type [Symbol, :move] Specifies the event type. For a move action, this property is
307
+ # @param type [Symbol, :move] Specifies the event type. For a move action, this property is always set to `mov
308
308
  end
309
309
 
310
310
  class Screenshot < OpenAI::Internal::Type::BaseModel
@@ -322,7 +322,7 @@ module OpenAI
322
322
  #
323
323
  # A screenshot action.
324
324
  #
325
- # @param type [Symbol, :screenshot] Specifies the event type. For a screenshot action, this property is
325
+ # @param type [Symbol, :screenshot] Specifies the event type. For a screenshot action, this property is always set t
326
326
  end
327
327
 
328
328
  class Scroll < OpenAI::Internal::Type::BaseModel
@@ -372,7 +372,7 @@ module OpenAI
372
372
  #
373
373
  # @param y_ [Integer] The y-coordinate where the scroll occurred.
374
374
  #
375
- # @param type [Symbol, :scroll] Specifies the event type. For a scroll action, this property is
375
+ # @param type [Symbol, :scroll] Specifies the event type. For a scroll action, this property is always set to `s
376
376
  end
377
377
 
378
378
  class Type < OpenAI::Internal::Type::BaseModel
@@ -398,7 +398,7 @@ module OpenAI
398
398
  #
399
399
  # @param text [String] The text to type.
400
400
  #
401
- # @param type [Symbol, :type] Specifies the event type. For a type action, this property is
401
+ # @param type [Symbol, :type] Specifies the event type. For a type action, this property is always set to `typ
402
402
  end
403
403
 
404
404
  class Wait < OpenAI::Internal::Type::BaseModel
@@ -416,7 +416,7 @@ module OpenAI
416
416
  #
417
417
  # A wait action.
418
418
  #
419
- # @param type [Symbol, :wait] Specifies the event type. For a wait action, this property is
419
+ # @param type [Symbol, :wait] Specifies the event type. For a wait action, this property is always set to `wai
420
420
  end
421
421
 
422
422
  # @!method self.variants
@@ -3,7 +3,7 @@
3
3
  module OpenAI
4
4
  module Models
5
5
  module Responses
6
- # A text input to the model.
6
+ # A piece of message content, such as text, an image, or a file.
7
7
  module ResponseFunctionCallOutputItem
8
8
  extend OpenAI::Internal::Type::Union
9
9
 
@@ -31,6 +31,13 @@ module OpenAI
31
31
  required :output,
32
32
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output] }
33
33
 
34
+ # @!attribute status
35
+ # The status of the shell call output. One of `in_progress`, `completed`, or
36
+ # `incomplete`.
37
+ #
38
+ # @return [Symbol, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Status]
39
+ required :status, enum: -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput::Status }
40
+
34
41
  # @!attribute type
35
42
  # The type of the shell call output. Always `shell_call_output`.
36
43
  #
@@ -38,16 +45,17 @@ module OpenAI
38
45
  required :type, const: :shell_call_output
39
46
 
40
47
  # @!attribute created_by
48
+ # The identifier of the actor that created the item.
41
49
  #
42
50
  # @return [String, nil]
43
51
  optional :created_by, String
44
52
 
45
- # @!method initialize(id:, call_id:, max_output_length:, output:, created_by: nil, type: :shell_call_output)
53
+ # @!method initialize(id:, call_id:, max_output_length:, output:, status:, created_by: nil, type: :shell_call_output)
46
54
  # Some parameter documentations has been truncated, see
47
55
  # {OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput} for more
48
56
  # details.
49
57
  #
50
- # The output of a shell tool call.
58
+ # The output of a shell tool call that was emitted.
51
59
  #
52
60
  # @param id [String] The unique ID of the shell call output. Populated when this item is returned via
53
61
  #
@@ -57,7 +65,9 @@ module OpenAI
57
65
  #
58
66
  # @param output [Array<OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output>] An array of shell call output contents
59
67
  #
60
- # @param created_by [String]
68
+ # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Status] The status of the shell call output. One of `in_progress`, `completed`, or `inco
69
+ #
70
+ # @param created_by [String] The identifier of the actor that created the item.
61
71
  #
62
72
  # @param type [Symbol, :shell_call_output] The type of the shell call output. Always `shell_call_output`.
63
73
 
@@ -70,16 +80,19 @@ module OpenAI
70
80
  required :outcome, union: -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome }
71
81
 
72
82
  # @!attribute stderr
83
+ # The standard error output that was captured.
73
84
  #
74
85
  # @return [String]
75
86
  required :stderr, String
76
87
 
77
88
  # @!attribute stdout
89
+ # The standard output that was captured.
78
90
  #
79
91
  # @return [String]
80
92
  required :stdout, String
81
93
 
82
94
  # @!attribute created_by
95
+ # The identifier of the actor that created the item.
83
96
  #
84
97
  # @return [String, nil]
85
98
  optional :created_by, String
@@ -89,15 +102,15 @@ module OpenAI
89
102
  # {OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output} for
90
103
  # more details.
91
104
  #
92
- # The content of a shell call output.
105
+ # The content of a shell tool call output that was emitted.
93
106
  #
94
107
  # @param outcome [OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit] Represents either an exit outcome (with an exit code) or a timeout outcome for a
95
108
  #
96
- # @param stderr [String]
109
+ # @param stderr [String] The standard error output that was captured.
97
110
  #
98
- # @param stdout [String]
111
+ # @param stdout [String] The standard output that was captured.
99
112
  #
100
- # @param created_by [String]
113
+ # @param created_by [String] The identifier of the actor that created the item.
101
114
 
102
115
  # Represents either an exit outcome (with an exit code) or a timeout outcome for a
103
116
  # shell call output chunk.
@@ -152,6 +165,21 @@ module OpenAI
152
165
  # @return [Array(OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit)]
153
166
  end
154
167
  end
168
+
169
+ # The status of the shell call output. One of `in_progress`, `completed`, or
170
+ # `incomplete`.
171
+ #
172
+ # @see OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput#status
173
+ module Status
174
+ extend OpenAI::Internal::Type::Enum
175
+
176
+ IN_PROGRESS = :in_progress
177
+ COMPLETED = :completed
178
+ INCOMPLETE = :incomplete
179
+
180
+ # @!method self.values
181
+ # @return [Array<Symbol>]
182
+ end
155
183
  end
156
184
  end
157
185
  end
@@ -12,7 +12,7 @@ module OpenAI
12
12
 
13
13
  # @!attribute action
14
14
  # An object describing the specific action taken in this web search call. Includes
15
- # details on how the model used the web (search, open_page, find).
15
+ # details on how the model used the web (search, open_page, find_in_page).
16
16
  #
17
17
  # @return [OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Search, OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::OpenPage, OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Find]
18
18
  required :action, union: -> { OpenAI::Responses::ResponseFunctionWebSearch::Action }
@@ -46,7 +46,7 @@ module OpenAI
46
46
  # @param type [Symbol, :web_search_call] The type of the web search tool call. Always `web_search_call`.
47
47
 
48
48
  # An object describing the specific action taken in this web search call. Includes
49
- # details on how the model used the web (search, open_page, find).
49
+ # details on how the model used the web (search, open_page, find_in_page).
50
50
  #
51
51
  # @see OpenAI::Models::Responses::ResponseFunctionWebSearch#action
52
52
  module Action
@@ -60,12 +60,12 @@ module OpenAI
60
60
  # Action type "open_page" - Opens a specific URL from search results.
61
61
  variant :open_page, -> { OpenAI::Responses::ResponseFunctionWebSearch::Action::OpenPage }
62
62
 
63
- # Action type "find": Searches for a pattern within a loaded page.
64
- variant :find, -> { OpenAI::Responses::ResponseFunctionWebSearch::Action::Find }
63
+ # Action type "find_in_page": Searches for a pattern within a loaded page.
64
+ variant :find_in_page, -> { OpenAI::Responses::ResponseFunctionWebSearch::Action::Find }
65
65
 
66
66
  class Search < OpenAI::Internal::Type::BaseModel
67
67
  # @!attribute query
68
- # The search query.
68
+ # [DEPRECATED] The search query.
69
69
  #
70
70
  # @return [String]
71
71
  required :query, String
@@ -76,6 +76,12 @@ module OpenAI
76
76
  # @return [Symbol, :search]
77
77
  required :type, const: :search
78
78
 
79
+ # @!attribute queries
80
+ # The search queries.
81
+ #
82
+ # @return [Array<String>, nil]
83
+ optional :queries, OpenAI::Internal::Type::ArrayOf[String]
84
+
79
85
  # @!attribute sources
80
86
  # The sources used in the search.
81
87
  #
@@ -83,14 +89,16 @@ module OpenAI
83
89
  optional :sources,
84
90
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::Source] }
85
91
 
86
- # @!method initialize(query:, sources: nil, type: :search)
92
+ # @!method initialize(query:, queries: nil, sources: nil, type: :search)
87
93
  # Some parameter documentations has been truncated, see
88
94
  # {OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Search} for more
89
95
  # details.
90
96
  #
91
97
  # Action type "search" - Performs a web search query.
92
98
  #
93
- # @param query [String] The search query.
99
+ # @param query [String] [DEPRECATED] The search query.
100
+ #
101
+ # @param queries [Array<String>] The search queries.
94
102
  #
95
103
  # @param sources [Array<OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Search::Source>] The sources used in the search.
96
104
  #
@@ -132,17 +140,17 @@ module OpenAI
132
140
  # @!attribute url
133
141
  # The URL opened by the model.
134
142
  #
135
- # @return [String]
136
- required :url, String
143
+ # @return [String, nil]
144
+ optional :url, String, nil?: true
137
145
 
138
- # @!method initialize(url:, type: :open_page)
146
+ # @!method initialize(url: nil, type: :open_page)
139
147
  # Some parameter documentations has been truncated, see
140
148
  # {OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::OpenPage} for
141
149
  # more details.
142
150
  #
143
151
  # Action type "open_page" - Opens a specific URL from search results.
144
152
  #
145
- # @param url [String] The URL opened by the model.
153
+ # @param url [String, nil] The URL opened by the model.
146
154
  #
147
155
  # @param type [Symbol, :open_page] The action type.
148
156
  end
@@ -157,8 +165,8 @@ module OpenAI
157
165
  # @!attribute type
158
166
  # The action type.
159
167
  #
160
- # @return [Symbol, :find]
161
- required :type, const: :find
168
+ # @return [Symbol, :find_in_page]
169
+ required :type, const: :find_in_page
162
170
 
163
171
  # @!attribute url
164
172
  # The URL of the page searched for the pattern.
@@ -166,18 +174,18 @@ module OpenAI
166
174
  # @return [String]
167
175
  required :url, String
168
176
 
169
- # @!method initialize(pattern:, url:, type: :find)
177
+ # @!method initialize(pattern:, url:, type: :find_in_page)
170
178
  # Some parameter documentations has been truncated, see
171
- # {OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Find} for more
172
- # details.
179
+ # {OpenAI::Models::Responses::ResponseFunctionWebSearch::Action::Find} for
180
+ # more details.
173
181
  #
174
- # Action type "find": Searches for a pattern within a loaded page.
182
+ # Action type "find_in_page": Searches for a pattern within a loaded page.
175
183
  #
176
184
  # @param pattern [String] The pattern or text to search for within the page.
177
185
  #
178
186
  # @param url [String] The URL of the page searched for the pattern.
179
187
  #
180
- # @param type [Symbol, :find] The action type.
188
+ # @param type [Symbol, :find_in_page] The action type.
181
189
  end
182
190
 
183
191
  # @!method self.variants
@@ -359,6 +359,7 @@ module OpenAI
359
359
  # A JSON string of the output of the function tool call.
360
360
  variant String
361
361
 
362
+ # An array of content outputs (text, image, file) for the function tool call.
362
363
  variant -> { OpenAI::Responses::ResponseFunctionCallOutputItemList }
363
364
 
364
365
  # @!method self.variants
@@ -745,7 +746,17 @@ module OpenAI
745
746
  # @return [Integer, nil]
746
747
  optional :max_output_length, Integer, nil?: true
747
748
 
748
- # @!method initialize(call_id:, output:, id: nil, max_output_length: nil, type: :shell_call_output)
749
+ # @!attribute status
750
+ # The status of the shell call output.
751
+ #
752
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput::Status, nil]
753
+ optional :status,
754
+ enum: -> {
755
+ OpenAI::Responses::ResponseInputItem::ShellCallOutput::Status
756
+ },
757
+ nil?: true
758
+
759
+ # @!method initialize(call_id:, output:, id: nil, max_output_length: nil, status: nil, type: :shell_call_output)
749
760
  # Some parameter documentations has been truncated, see
750
761
  # {OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput} for more
751
762
  # details.
@@ -760,7 +771,23 @@ module OpenAI
760
771
  #
761
772
  # @param max_output_length [Integer, nil] The maximum number of UTF-8 characters captured for this shell call's combined o
762
773
  #
774
+ # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput::Status, nil] The status of the shell call output.
775
+ #
763
776
  # @param type [Symbol, :shell_call_output] The type of the item. Always `shell_call_output`.
777
+
778
+ # The status of the shell call output.
779
+ #
780
+ # @see OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput#status
781
+ module Status
782
+ extend OpenAI::Internal::Type::Enum
783
+
784
+ IN_PROGRESS = :in_progress
785
+ COMPLETED = :completed
786
+ INCOMPLETE = :incomplete
787
+
788
+ # @!method self.values
789
+ # @return [Array<Symbol>]
790
+ end
764
791
  end
765
792
 
766
793
  class ApplyPatchCall < OpenAI::Internal::Type::BaseModel
@@ -49,7 +49,7 @@ module OpenAI
49
49
  # A tool call that executes one or more shell commands in a managed environment.
50
50
  variant :shell_call, -> { OpenAI::Responses::ResponseFunctionShellToolCall }
51
51
 
52
- # The output of a shell tool call.
52
+ # The output of a shell tool call that was emitted.
53
53
  variant :shell_call_output, -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput }
54
54
 
55
55
  # A tool call that applies file diffs by creating, deleting, or updating files.
@@ -49,7 +49,7 @@ module OpenAI
49
49
  # A tool call that executes one or more shell commands in a managed environment.
50
50
  variant :shell_call, -> { OpenAI::Responses::ResponseFunctionShellToolCall }
51
51
 
52
- # The output of a shell tool call.
52
+ # The output of a shell tool call that was emitted.
53
53
  variant :shell_call_output, -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput }
54
54
 
55
55
  # A tool call that applies file diffs by creating, deleting, or updating files.
@@ -47,7 +47,7 @@ module OpenAI
47
47
  #
48
48
  # @param type [Symbol, :output_text] The type of the output text. Always `output_text`.
49
49
 
50
- # A citation to a file.
50
+ # An annotation that applies to a span of output text.
51
51
  module Annotation
52
52
  extend OpenAI::Internal::Type::Union
53
53
 
@@ -399,6 +399,7 @@ module OpenAI
399
399
  optional :file_ids, OpenAI::Internal::Type::ArrayOf[String]
400
400
 
401
401
  # @!attribute memory_limit
402
+ # The memory limit for the code interpreter container.
402
403
  #
403
404
  # @return [Symbol, OpenAI::Models::Responses::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit, nil]
404
405
  optional :memory_limit,
@@ -413,10 +414,12 @@ module OpenAI
413
414
  #
414
415
  # @param file_ids [Array<String>] An optional list of uploaded files to make available to your code.
415
416
  #
416
- # @param memory_limit [Symbol, OpenAI::Models::Responses::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit, nil]
417
+ # @param memory_limit [Symbol, OpenAI::Models::Responses::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit, nil] The memory limit for the code interpreter container.
417
418
  #
418
419
  # @param type [Symbol, :auto] Always `auto`.
419
420
 
421
+ # The memory limit for the code interpreter container.
422
+ #
420
423
  # @see OpenAI::Models::Responses::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto#memory_limit
421
424
  module MemoryLimit
422
425
  extend OpenAI::Internal::Type::Enum
@@ -443,6 +446,12 @@ module OpenAI
443
446
  # @return [Symbol, :image_generation]
444
447
  required :type, const: :image_generation
445
448
 
449
+ # @!attribute action
450
+ # Whether to generate a new image or edit an existing image. Default: `auto`.
451
+ #
452
+ # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Action, nil]
453
+ optional :action, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Action }
454
+
446
455
  # @!attribute background
447
456
  # Background type for the generated image. One of `transparent`, `opaque`, or
448
457
  # `auto`. Default: `auto`.
@@ -516,12 +525,14 @@ module OpenAI
516
525
  # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size, nil]
517
526
  optional :size, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Size }
518
527
 
519
- # @!method initialize(background: nil, input_fidelity: nil, input_image_mask: nil, model: nil, moderation: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, size: nil, type: :image_generation)
528
+ # @!method initialize(action: nil, background: nil, input_fidelity: nil, input_image_mask: nil, model: nil, moderation: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, size: nil, type: :image_generation)
520
529
  # Some parameter documentations has been truncated, see
521
530
  # {OpenAI::Models::Responses::Tool::ImageGeneration} for more details.
522
531
  #
523
532
  # A tool that generates images using the GPT image models.
524
533
  #
534
+ # @param action [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Action] Whether to generate a new image or edit an existing image. Default: `auto`.
535
+ #
525
536
  # @param background [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background] Background type for the generated image. One of `transparent`,
526
537
  #
527
538
  # @param input_fidelity [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil] Control how much effort the model will exert to match the style and features, es
@@ -544,6 +555,20 @@ module OpenAI
544
555
  #
545
556
  # @param type [Symbol, :image_generation] The type of the image generation tool. Always `image_generation`.
546
557
 
558
+ # Whether to generate a new image or edit an existing image. Default: `auto`.
559
+ #
560
+ # @see OpenAI::Models::Responses::Tool::ImageGeneration#action
561
+ module Action
562
+ extend OpenAI::Internal::Type::Enum
563
+
564
+ GENERATE = :generate
565
+ EDIT = :edit
566
+ AUTO = :auto
567
+
568
+ # @!method self.values
569
+ # @return [Array<Symbol>]
570
+ end
571
+
547
572
  # Background type for the generated image. One of `transparent`, `opaque`, or
548
573
  # `auto`. Default: `auto`.
549
574
  #
@@ -614,6 +639,8 @@ module OpenAI
614
639
 
615
640
  variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_1_MINI }
616
641
 
642
+ variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_1_5 }
643
+
617
644
  # @!method self.variants
618
645
  # @return [Array(String, Symbol)]
619
646
 
@@ -625,6 +652,7 @@ module OpenAI
625
652
 
626
653
  GPT_IMAGE_1 = :"gpt-image-1"
627
654
  GPT_IMAGE_1_MINI = :"gpt-image-1-mini"
655
+ GPT_IMAGE_1_5 = :"gpt-image-1.5"
628
656
 
629
657
  # @!endgroup
630
658
  end
@@ -4,18 +4,23 @@ module OpenAI
4
4
  module Models
5
5
  class VideoCreateError < OpenAI::Internal::Type::BaseModel
6
6
  # @!attribute code
7
+ # A machine-readable error code that was returned.
7
8
  #
8
9
  # @return [String]
9
10
  required :code, String
10
11
 
11
12
  # @!attribute message
13
+ # A human-readable description of the error that was returned.
12
14
  #
13
15
  # @return [String]
14
16
  required :message, String
15
17
 
16
18
  # @!method initialize(code:, message:)
17
- # @param code [String]
18
- # @param message [String]
19
+ # An error that occurred while generating the response.
20
+ #
21
+ # @param code [String] A machine-readable error code that was returned.
22
+ #
23
+ # @param message [String] A human-readable description of the error that was returned.
19
24
  end
20
25
  end
21
26
  end
@@ -15,7 +15,7 @@ module OpenAI
15
15
  #
16
16
  # @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts):
17
17
  #
18
- # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
18
+ # @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
19
19
  #
20
20
  # @param instructions [String] Control the voice of your generated audio with additional instructions. Does not
21
21
  #
@@ -4,6 +4,8 @@ module OpenAI
4
4
  module Resources
5
5
  class Beta
6
6
  class Assistants
7
+ # @deprecated
8
+ #
7
9
  # Some parameter documentations has been truncated, see
8
10
  # {OpenAI::Models::Beta::AssistantCreateParams} for more details.
9
11
  #
@@ -49,6 +51,8 @@ module OpenAI
49
51
  )
50
52
  end
51
53
 
54
+ # @deprecated
55
+ #
52
56
  # Retrieves an assistant.
53
57
  #
54
58
  # @overload retrieve(assistant_id, request_options: {})
@@ -69,6 +73,8 @@ module OpenAI
69
73
  )
70
74
  end
71
75
 
76
+ # @deprecated
77
+ #
72
78
  # Some parameter documentations has been truncated, see
73
79
  # {OpenAI::Models::Beta::AssistantUpdateParams} for more details.
74
80
  #
@@ -116,6 +122,8 @@ module OpenAI
116
122
  )
117
123
  end
118
124
 
125
+ # @deprecated
126
+ #
119
127
  # Some parameter documentations has been truncated, see
120
128
  # {OpenAI::Models::Beta::AssistantListParams} for more details.
121
129
  #
@@ -148,6 +156,8 @@ module OpenAI
148
156
  )
149
157
  end
150
158
 
159
+ # @deprecated
160
+ #
151
161
  # Delete an assistant.
152
162
  #
153
163
  # @overload delete(assistant_id, request_options: {})
@@ -7,8 +7,8 @@ module OpenAI
7
7
  # {OpenAI::Models::FileCreateParams} for more details.
8
8
  #
9
9
  # Upload a file that can be used across various endpoints. Individual files can be
10
- # up to 512 MB, and the size of all files uploaded by one organization can be up
11
- # to 1 TB.
10
+ # up to 512 MB, and each project can store up to 2.5 TB of files in total. There
11
+ # is no organization-wide storage limit.
12
12
  #
13
13
  # - The Assistants API supports files up to 2 million tokens and of specific file
14
14
  # types. See the
@@ -31,7 +31,7 @@ module OpenAI
31
31
  #
32
32
  # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] The File object (not file name) to be uploaded.
33
33
  #
34
- # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of: - `assistants`: Used in the A
34
+ # @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of:
35
35
  #
36
36
  # @param expires_after [OpenAI::Models::FileCreateParams::ExpiresAfter] The expiration policy for a file. By default, files with `purpose=batch` expire
37
37
  #
@@ -45,7 +45,8 @@ module OpenAI
45
45
  # {OpenAI::Models::ImageEditParams} for more details.
46
46
  #
47
47
  # Creates an edited or extended image given one or more source images and a
48
- # prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`.
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
  #
50
51
  # @overload edit(image:, prompt:, background: nil, input_fidelity: nil, mask: nil, model: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {})
51
52
  #
@@ -104,7 +105,8 @@ module OpenAI
104
105
  # {OpenAI::Models::ImageEditParams} for more details.
105
106
  #
106
107
  # Creates an edited or extended image given one or more source images and a
107
- # prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`.
108
+ # prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`,
109
+ # and `gpt-image-1-mini`) and `dall-e-2`.
108
110
  #
109
111
  # @overload edit_stream_raw(image:, prompt:, background: nil, input_fidelity: nil, mask: nil, model: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {})
110
112
  #
@@ -27,7 +27,7 @@ module OpenAI
27
27
  #
28
28
  # @param text [OpenAI::Models::Responses::InputTokenCountParams::Text, nil] Configuration options for a text response from the model. Can be plain
29
29
  #
30
- # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceAllowed, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp, OpenAI::Models::Responses::ToolChoiceCustom, OpenAI::Models::Responses::ToolChoiceApplyPatch, OpenAI::Models::Responses::ToolChoiceShell, nil] How the model should select which tool (or tools) to use when generating
30
+ # @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceAllowed, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp, OpenAI::Models::Responses::ToolChoiceCustom, OpenAI::Models::Responses::ToolChoiceApplyPatch, OpenAI::Models::Responses::ToolChoiceShell, nil] Controls which tool the model should use, if any.
31
31
  #
32
32
  # @param tools [Array<OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::Tool::Mcp, OpenAI::Models::Responses::Tool::CodeInterpreter, OpenAI::Models::Responses::Tool::ImageGeneration, OpenAI::Models::Responses::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool>, nil] An array of tools the model may call while generating a response. You can specif
33
33
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.42.0"
4
+ VERSION = "0.45.0"
5
5
  end
@@ -21,9 +21,10 @@ module OpenAI
21
21
  sig { returns(T.any(String, OpenAI::Audio::SpeechModel::OrSymbol)) }
22
22
  attr_accessor :model
23
23
 
24
- # The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
25
- # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
26
- # `verse`. Previews of the voices are available in the
24
+ # The voice to use when generating the audio. Supported built-in voices are
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
27
28
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
28
29
  sig do
29
30
  returns(
@@ -105,9 +106,10 @@ module OpenAI
105
106
  # One of the available [TTS models](https://platform.openai.com/docs/models#tts):
106
107
  # `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
107
108
  model:,
108
- # The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
109
- # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
110
- # `verse`. Previews of the voices are available in the
109
+ # The voice to use when generating the audio. Supported built-in voices are
110
+ # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
111
+ # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
112
+ # in the
111
113
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
112
114
  voice:,
113
115
  # Control the voice of your generated audio with additional instructions. Does not
@@ -168,9 +170,10 @@ module OpenAI
168
170
  end
169
171
  end
170
172
 
171
- # The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
172
- # `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
173
- # `verse`. Previews of the voices are available in the
173
+ # The voice to use when generating the audio. Supported built-in voices are
174
+ # `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
175
+ # `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
176
+ # in the
174
177
  # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
175
178
  module Voice
176
179
  extend OpenAI::Internal::Type::Union