openai 0.86.0 → 0.87.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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +10 -1
  4. data/examples/audio/record_and_play.rb +19 -0
  5. data/examples/responses/websocket_workflows.rb +159 -0
  6. data/lib/openai/helpers/local_audio/errors.rb +27 -0
  7. data/lib/openai/helpers/local_audio/process.rb +158 -0
  8. data/lib/openai/helpers/local_audio.rb +157 -0
  9. data/lib/openai/helpers/realtime/connection.rb +20 -2
  10. data/lib/openai/helpers/realtime/errors.rb +18 -0
  11. data/lib/openai/helpers/realtime/recovery.rb +489 -0
  12. data/lib/openai/helpers/realtime/resources/realtime_extension.rb +26 -1
  13. data/lib/openai/helpers/realtime.rb +1 -0
  14. data/lib/openai/models/beta/beta_response_input_item.rb +84 -1
  15. data/lib/openai/models/beta/beta_response_item.rb +72 -1
  16. data/lib/openai/models/beta/beta_response_output_item.rb +84 -1
  17. data/lib/openai/models/beta/beta_responses_client_event.rb +3 -0
  18. data/lib/openai/models/beta/beta_tool.rb +69 -37
  19. data/lib/openai/models/beta/response_create_params.rb +3 -0
  20. data/lib/openai/models/conversations/conversation_item.rb +82 -1
  21. data/lib/openai/models/image_edit_completed_event.rb +34 -8
  22. data/lib/openai/models/image_edit_params.rb +64 -44
  23. data/lib/openai/models/image_edit_partial_image_event.rb +34 -8
  24. data/lib/openai/models/image_gen_completed_event.rb +34 -8
  25. data/lib/openai/models/image_gen_partial_image_event.rb +34 -8
  26. data/lib/openai/models/image_generate_params.rb +51 -35
  27. data/lib/openai/models/image_model.rb +4 -0
  28. data/lib/openai/models/images_response.rb +37 -13
  29. data/lib/openai/models/responses/response_create_params.rb +3 -0
  30. data/lib/openai/models/responses/response_input_item.rb +84 -1
  31. data/lib/openai/models/responses/response_item.rb +72 -1
  32. data/lib/openai/models/responses/response_output_item.rb +84 -1
  33. data/lib/openai/models/responses/responses_client_event.rb +3 -0
  34. data/lib/openai/models/responses/tool.rb +69 -37
  35. data/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb +3 -3
  36. data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +5 -3
  37. data/lib/openai/resources/images.rb +12 -14
  38. data/lib/openai/version.rb +1 -1
  39. data/local-audio.md +146 -0
  40. data/rbi/openai/helpers/local_audio/interface.rbi +110 -0
  41. data/rbi/openai/helpers/realtime/connection.rbi +18 -2
  42. data/rbi/openai/helpers/realtime/extensions.rbi +8 -0
  43. data/rbi/openai/helpers/realtime/recovery.rbi +27 -0
  44. data/rbi/openai/models/beta/beta_response_input_item.rbi +86 -1
  45. data/rbi/openai/models/beta/beta_response_item.rbi +78 -1
  46. data/rbi/openai/models/beta/beta_response_output_item.rbi +84 -1
  47. data/rbi/openai/models/beta/beta_responses_client_event.rbi +6 -0
  48. data/rbi/openai/models/beta/beta_tool.rbi +90 -51
  49. data/rbi/openai/models/beta/response_create_params.rbi +6 -0
  50. data/rbi/openai/models/conversations/conversation_item.rbi +88 -1
  51. data/rbi/openai/models/image_edit_completed_event.rbi +20 -9
  52. data/rbi/openai/models/image_edit_params.rbi +89 -60
  53. data/rbi/openai/models/image_edit_partial_image_event.rbi +20 -9
  54. data/rbi/openai/models/image_gen_completed_event.rbi +20 -9
  55. data/rbi/openai/models/image_gen_partial_image_event.rbi +20 -9
  56. data/rbi/openai/models/image_generate_params.rbi +71 -48
  57. data/rbi/openai/models/image_model.rbi +4 -0
  58. data/rbi/openai/models/images_response.rbi +27 -16
  59. data/rbi/openai/models/responses/response_create_params.rbi +6 -0
  60. data/rbi/openai/models/responses/response_input_item.rbi +88 -1
  61. data/rbi/openai/models/responses/response_item.rbi +80 -1
  62. data/rbi/openai/models/responses/response_output_item.rbi +84 -1
  63. data/rbi/openai/models/responses/responses_client_event.rbi +6 -0
  64. data/rbi/openai/models/responses/tool.rbi +90 -51
  65. data/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi +4 -4
  66. data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +8 -4
  67. data/rbi/openai/resources/beta/responses.rbi +6 -2
  68. data/rbi/openai/resources/images.rbi +106 -76
  69. data/rbi/openai/resources/responses.rbi +6 -0
  70. data/realtime.md +101 -0
  71. data/responses-websocket.md +182 -0
  72. data/sig/openai/helpers/local_audio/interface.rbs +62 -0
  73. data/sig/openai/helpers/realtime/connection.rbs +9 -1
  74. data/sig/openai/helpers/realtime/extensions.rbs +4 -0
  75. data/sig/openai/helpers/realtime/recovery.rbs +19 -0
  76. data/sig/openai/models/beta/beta_response_input_item.rbs +39 -2
  77. data/sig/openai/models/beta/beta_response_item.rbs +39 -2
  78. data/sig/openai/models/beta/beta_response_output_item.rbs +39 -2
  79. data/sig/openai/models/beta/beta_tool.rbs +11 -1
  80. data/sig/openai/models/conversations/conversation_item.rbs +39 -2
  81. data/sig/openai/models/image_edit_completed_event.rbs +11 -4
  82. data/sig/openai/models/image_edit_params.rbs +3 -1
  83. data/sig/openai/models/image_edit_partial_image_event.rbs +11 -4
  84. data/sig/openai/models/image_gen_completed_event.rbs +11 -4
  85. data/sig/openai/models/image_gen_partial_image_event.rbs +11 -4
  86. data/sig/openai/models/image_generate_params.rbs +4 -1
  87. data/sig/openai/models/image_model.rbs +8 -0
  88. data/sig/openai/models/images_response.rbs +10 -4
  89. data/sig/openai/models/responses/response_input_item.rbs +39 -2
  90. data/sig/openai/models/responses/response_item.rbs +39 -2
  91. data/sig/openai/models/responses/response_output_item.rbs +39 -2
  92. data/sig/openai/models/responses/tool.rbs +11 -1
  93. metadata +15 -1
@@ -30,17 +30,17 @@ module OpenAI
30
30
  optional :output_format, enum: -> { OpenAI::ImagesResponse::OutputFormat }
31
31
 
32
32
  # @!attribute quality
33
- # The quality of the image generated. Either `low`, `medium`, or `high`.
33
+ # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or
34
+ # `max`.
34
35
  #
35
36
  # @return [Symbol, OpenAI::Models::ImagesResponse::Quality, nil]
36
37
  optional :quality, enum: -> { OpenAI::ImagesResponse::Quality }
37
38
 
38
39
  # @!attribute size
39
- # The size of the image generated. Either `1024x1024`, `1024x1536`, or
40
- # `1536x1024`.
40
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
41
41
  #
42
- # @return [Symbol, OpenAI::Models::ImagesResponse::Size, nil]
43
- optional :size, enum: -> { OpenAI::ImagesResponse::Size }
42
+ # @return [String, Symbol, OpenAI::Models::ImagesResponse::Size, nil]
43
+ optional :size, union: -> { OpenAI::ImagesResponse::Size }
44
44
 
45
45
  # @!attribute usage
46
46
  # For `gpt-image-1` only, the token usage information for the image generation.
@@ -62,9 +62,9 @@ module OpenAI
62
62
  #
63
63
  # @param output_format [Symbol, OpenAI::Models::ImagesResponse::OutputFormat] The output format of the image generation. Either `png`, `webp`, or `jpeg`.
64
64
  #
65
- # @param quality [Symbol, OpenAI::Models::ImagesResponse::Quality] The quality of the image generated. Either `low`, `medium`, or `high`.
65
+ # @param quality [Symbol, OpenAI::Models::ImagesResponse::Quality] The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or
66
66
  #
67
- # @param size [Symbol, OpenAI::Models::ImagesResponse::Size] The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`
67
+ # @param size [String, Symbol, OpenAI::Models::ImagesResponse::Size] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
68
68
  #
69
69
  # @param usage [OpenAI::Models::ImagesResponse::Usage] For `gpt-image-1` only, the token usage information for the image generation.
70
70
 
@@ -96,7 +96,8 @@ module OpenAI
96
96
  # @return [Array<Symbol>]
97
97
  end
98
98
 
99
- # The quality of the image generated. Either `low`, `medium`, or `high`.
99
+ # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or
100
+ # `max`.
100
101
  #
101
102
  # @see OpenAI::Models::ImagesResponse#quality
102
103
  module Quality
@@ -105,24 +106,47 @@ module OpenAI
105
106
  LOW = :low
106
107
  MEDIUM = :medium
107
108
  HIGH = :high
109
+ XHIGH = :xhigh
110
+ MAX = :max
108
111
 
109
112
  # @!method self.values
110
113
  # @return [Array<Symbol>]
111
114
  end
112
115
 
113
- # The size of the image generated. Either `1024x1024`, `1024x1536`, or
114
- # `1536x1024`.
116
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
115
117
  #
116
118
  # @see OpenAI::Models::ImagesResponse#size
117
119
  module Size
118
- extend OpenAI::Internal::Type::Enum
120
+ extend OpenAI::Internal::Type::Union
121
+
122
+ variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1024X1024 }
123
+
124
+ variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1024X1536 }
125
+
126
+ variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1536X1024 }
127
+
128
+ # Keep known dimensions as symbols when reading existing API responses.
129
+ variant String
130
+
131
+ # @!method self.variants
132
+ # @return [Array(String, Symbol)]
133
+
134
+ define_sorbet_constant!(:Variants) do
135
+ T.type_alias { T.any(String, OpenAI::ImagesResponse::Size::TaggedSymbol) }
136
+ end
137
+
138
+ # @!group
119
139
 
120
140
  SIZE_1024X1024 = :"1024x1024"
121
141
  SIZE_1024X1536 = :"1024x1536"
122
142
  SIZE_1536X1024 = :"1536x1024"
123
143
 
124
- # @!method self.values
125
- # @return [Array<Symbol>]
144
+ # @!endgroup
145
+
146
+ # Preserve the enum helper available before custom dimensions were supported.
147
+ #
148
+ # @return [Array<Symbol>]
149
+ def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024]
126
150
  end
127
151
 
128
152
  # @see OpenAI::Models::ImagesResponse#usage
@@ -260,6 +260,9 @@ module OpenAI
260
260
 
261
261
  # @!attribute store
262
262
  # Whether to store the generated model response for later retrieval via API.
263
+ # Defaults to true when omitted. If set to true, response data will be stored for
264
+ # at least 30 days, subject to the
265
+ # [data retention exceptions](/api/docs/guides/your-data#v1responses).
263
266
  #
264
267
  # @return [Boolean, nil]
265
268
  optional :store, OpenAI::Internal::Type::Boolean, nil?: true
@@ -627,7 +627,30 @@ module OpenAI
627
627
  # @return [Symbol, :image_generation_call]
628
628
  required :type, const: :image_generation_call
629
629
 
630
- # @!method initialize(id:, result:, status:, type: :image_generation_call)
630
+ # @!attribute quality
631
+ # The quality of the image generated by the image generation tool call. One of
632
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
633
+ #
634
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Quality, nil]
635
+ optional(
636
+ :quality,
637
+ enum: -> { OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality },
638
+ nil?: true
639
+ )
640
+
641
+ # @!attribute size
642
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
643
+ #
644
+ # @return [String, Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size, nil]
645
+ optional(
646
+ :size,
647
+ union: -> {
648
+ OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size
649
+ },
650
+ nil?: true
651
+ )
652
+
653
+ # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call)
631
654
  # Some parameter documentations has been truncated, see
632
655
  # {OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall} for more
633
656
  # details.
@@ -640,6 +663,10 @@ module OpenAI
640
663
  #
641
664
  # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Status] The status of the image generation call.
642
665
  #
666
+ # @param quality [Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo
667
+ #
668
+ # @param size [String, Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
669
+ #
643
670
  # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`.
644
671
 
645
672
  # The status of the image generation call.
@@ -656,6 +683,62 @@ module OpenAI
656
683
  # @!method self.values
657
684
  # @return [Array<Symbol>]
658
685
  end
686
+
687
+ # The quality of the image generated by the image generation tool call. One of
688
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
689
+ #
690
+ # @see OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall#quality
691
+ module Quality
692
+ extend OpenAI::Internal::Type::Enum
693
+
694
+ LOW = :low
695
+ MEDIUM = :medium
696
+ HIGH = :high
697
+ XHIGH = :xhigh
698
+ MAX = :max
699
+ AUTO = :auto
700
+
701
+ # @!method self.values
702
+ # @return [Array<Symbol>]
703
+ end
704
+
705
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
706
+ #
707
+ # @see OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall#size
708
+ module Size
709
+ extend OpenAI::Internal::Type::Union
710
+
711
+ variant String
712
+
713
+ variant(
714
+ const: -> { OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size::SIZE_1024X1024 }
715
+ )
716
+
717
+ variant(
718
+ const: -> { OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size::SIZE_1024X1536 }
719
+ )
720
+
721
+ variant(
722
+ const: -> { OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size::SIZE_1536X1024 }
723
+ )
724
+
725
+ # @!method self.variants
726
+ # @return [Array(String, Symbol)]
727
+
728
+ define_sorbet_constant!(:Variants) do
729
+ T.type_alias {
730
+ T.any(String, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::TaggedSymbol)
731
+ }
732
+ end
733
+
734
+ # @!group
735
+
736
+ SIZE_1024X1024 = :"1024x1024"
737
+ SIZE_1024X1536 = :"1024x1536"
738
+ SIZE_1536X1024 = :"1536x1024"
739
+
740
+ # @!endgroup
741
+ end
659
742
  end
660
743
 
661
744
  class LocalShellCall < OpenAI::Internal::Type::BaseModel
@@ -277,7 +277,26 @@ module OpenAI
277
277
  # @return [Symbol, :image_generation_call]
278
278
  required :type, const: :image_generation_call
279
279
 
280
- # @!method initialize(id:, result:, status:, type: :image_generation_call)
280
+ # @!attribute quality
281
+ # The quality of the image generated by the image generation tool call. One of
282
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
283
+ #
284
+ # @return [Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Quality, nil]
285
+ optional(
286
+ :quality,
287
+ enum: -> {
288
+ OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality
289
+ },
290
+ nil?: true
291
+ )
292
+
293
+ # @!attribute size
294
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
295
+ #
296
+ # @return [String, Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size, nil]
297
+ optional :size, union: -> { OpenAI::Responses::ResponseItem::ImageGenerationCall::Size }, nil?: true
298
+
299
+ # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call)
281
300
  # Some parameter documentations has been truncated, see
282
301
  # {OpenAI::Models::Responses::ResponseItem::ImageGenerationCall} for more details.
283
302
  #
@@ -289,6 +308,10 @@ module OpenAI
289
308
  #
290
309
  # @param status [Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Status] The status of the image generation call.
291
310
  #
311
+ # @param quality [Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo
312
+ #
313
+ # @param size [String, Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
314
+ #
292
315
  # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`.
293
316
 
294
317
  # The status of the image generation call.
@@ -305,6 +328,54 @@ module OpenAI
305
328
  # @!method self.values
306
329
  # @return [Array<Symbol>]
307
330
  end
331
+
332
+ # The quality of the image generated by the image generation tool call. One of
333
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
334
+ #
335
+ # @see OpenAI::Models::Responses::ResponseItem::ImageGenerationCall#quality
336
+ module Quality
337
+ extend OpenAI::Internal::Type::Enum
338
+
339
+ LOW = :low
340
+ MEDIUM = :medium
341
+ HIGH = :high
342
+ XHIGH = :xhigh
343
+ MAX = :max
344
+ AUTO = :auto
345
+
346
+ # @!method self.values
347
+ # @return [Array<Symbol>]
348
+ end
349
+
350
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
351
+ #
352
+ # @see OpenAI::Models::Responses::ResponseItem::ImageGenerationCall#size
353
+ module Size
354
+ extend OpenAI::Internal::Type::Union
355
+
356
+ variant String
357
+
358
+ variant const: -> { OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size::SIZE_1024X1024 }
359
+
360
+ variant const: -> { OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size::SIZE_1024X1536 }
361
+
362
+ variant const: -> { OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size::SIZE_1536X1024 }
363
+
364
+ # @!method self.variants
365
+ # @return [Array(String, Symbol)]
366
+
367
+ define_sorbet_constant!(:Variants) do
368
+ T.type_alias { T.any(String, OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::TaggedSymbol) }
369
+ end
370
+
371
+ # @!group
372
+
373
+ SIZE_1024X1024 = :"1024x1024"
374
+ SIZE_1024X1536 = :"1024x1536"
375
+ SIZE_1536X1024 = :"1536x1024"
376
+
377
+ # @!endgroup
378
+ end
308
379
  end
309
380
 
310
381
  class LocalShellCall < OpenAI::Internal::Type::BaseModel
@@ -271,7 +271,30 @@ module OpenAI
271
271
  # @return [Symbol, :image_generation_call]
272
272
  required :type, const: :image_generation_call
273
273
 
274
- # @!method initialize(id:, result:, status:, type: :image_generation_call)
274
+ # @!attribute quality
275
+ # The quality of the image generated by the image generation tool call. One of
276
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
277
+ #
278
+ # @return [Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Quality, nil]
279
+ optional(
280
+ :quality,
281
+ enum: -> { OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality },
282
+ nil?: true
283
+ )
284
+
285
+ # @!attribute size
286
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
287
+ #
288
+ # @return [String, Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size, nil]
289
+ optional(
290
+ :size,
291
+ union: -> {
292
+ OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size
293
+ },
294
+ nil?: true
295
+ )
296
+
297
+ # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call)
275
298
  # Some parameter documentations has been truncated, see
276
299
  # {OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall} for more
277
300
  # details.
@@ -284,6 +307,10 @@ module OpenAI
284
307
  #
285
308
  # @param status [Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Status] The status of the image generation call.
286
309
  #
310
+ # @param quality [Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo
311
+ #
312
+ # @param size [String, Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
313
+ #
287
314
  # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`.
288
315
 
289
316
  # The status of the image generation call.
@@ -300,6 +327,62 @@ module OpenAI
300
327
  # @!method self.values
301
328
  # @return [Array<Symbol>]
302
329
  end
330
+
331
+ # The quality of the image generated by the image generation tool call. One of
332
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
333
+ #
334
+ # @see OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall#quality
335
+ module Quality
336
+ extend OpenAI::Internal::Type::Enum
337
+
338
+ LOW = :low
339
+ MEDIUM = :medium
340
+ HIGH = :high
341
+ XHIGH = :xhigh
342
+ MAX = :max
343
+ AUTO = :auto
344
+
345
+ # @!method self.values
346
+ # @return [Array<Symbol>]
347
+ end
348
+
349
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
350
+ #
351
+ # @see OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall#size
352
+ module Size
353
+ extend OpenAI::Internal::Type::Union
354
+
355
+ variant String
356
+
357
+ variant(
358
+ const: -> { OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size::SIZE_1024X1024 }
359
+ )
360
+
361
+ variant(
362
+ const: -> { OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size::SIZE_1024X1536 }
363
+ )
364
+
365
+ variant(
366
+ const: -> { OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size::SIZE_1536X1024 }
367
+ )
368
+
369
+ # @!method self.variants
370
+ # @return [Array(String, Symbol)]
371
+
372
+ define_sorbet_constant!(:Variants) do
373
+ T.type_alias {
374
+ T.any(String, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol)
375
+ }
376
+ end
377
+
378
+ # @!group
379
+
380
+ SIZE_1024X1024 = :"1024x1024"
381
+ SIZE_1024X1536 = :"1024x1536"
382
+ SIZE_1536X1024 = :"1536x1024"
383
+
384
+ # @!endgroup
385
+ end
303
386
  end
304
387
 
305
388
  class LocalShellCall < OpenAI::Internal::Type::BaseModel
@@ -317,6 +317,9 @@ module OpenAI
317
317
 
318
318
  # @!attribute store
319
319
  # Whether to store the generated model response for later retrieval via API.
320
+ # Defaults to true when omitted. If set to true, response data will be stored for
321
+ # at least 30 days, subject to the
322
+ # [data retention exceptions](/api/docs/guides/your-data#v1responses).
320
323
  #
321
324
  # @return [Boolean, nil]
322
325
  optional :store, OpenAI::Internal::Type::Boolean, nil?: true
@@ -573,9 +573,11 @@ module OpenAI
573
573
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
574
574
  # the model will automatically determine the best background for the image.
575
575
  #
576
- # Transparent backgrounds are available for supported GPT Image models. For
577
- # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
578
- # using `transparent`, set the output format to `png` or `webp`.
576
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
577
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
578
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
579
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
580
+ # set the output format to `png` or `webp`.
579
581
  #
580
582
  # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background, nil]
581
583
  optional :background, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Background }
@@ -604,7 +606,9 @@ module OpenAI
604
606
 
605
607
  # @!attribute model
606
608
  # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
607
- # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
609
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
610
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
611
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
608
612
  # `chatgpt-image-latest`. Default: `gpt-image-1`.
609
613
  #
610
614
  # @return [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Model, nil]
@@ -637,24 +641,27 @@ module OpenAI
637
641
  optional :partial_images, Integer
638
642
 
639
643
  # @!attribute quality
640
- # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.
641
- # Default: `auto`.
644
+ # The quality of the generated image. The GPT image models support `low`,
645
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
646
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
647
+ # `auto`.
642
648
  #
643
649
  # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Quality, nil]
644
650
  optional :quality, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Quality }
645
651
 
646
652
  # @!attribute size
647
- # The size of the generated images. For `gpt-image-2` and
648
- # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
649
- # strings, for example `1536x864`. Width and height must both be divisible by 16
650
- # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
651
- # `2560x1440` are experimental, and the maximum supported resolution is
652
- # `3840x2160`. The requested size must also satisfy the model's current pixel and
653
- # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
654
- # supported by the GPT image models; `auto` is supported for models that allow
655
- # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
656
- # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
657
- # `1024x1792`.
653
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
654
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
655
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
656
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
657
+ # Width and height must both be divisible by 16 and the requested aspect ratio
658
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
659
+ # the maximum supported resolution is `3840x2160`. The requested size must also
660
+ # satisfy the model's current pixel and edge limits. The standard sizes
661
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
662
+ # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
663
+ # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
664
+ # `1024x1024`, `1792x1024`, or `1024x1792`.
658
665
  #
659
666
  # @return [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size, nil]
660
667
  optional :size, union: -> { OpenAI::Responses::Tool::ImageGeneration::Size }
@@ -667,7 +674,7 @@ module OpenAI
667
674
  #
668
675
  # @param action [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Action] Whether to generate a new image or edit an existing image. Default: `auto`.
669
676
  #
670
- # @param background [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background] Allows to set transparency for the background of the generated image(s).
677
+ # @param background [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background] Allows to set transparency for the background of the generated image(s). Must
671
678
  #
672
679
  # @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
673
680
  #
@@ -683,9 +690,9 @@ module OpenAI
683
690
  #
684
691
  # @param partial_images [Integer] Number of partial images to generate in streaming mode, from 0 (default value) t
685
692
  #
686
- # @param quality [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Quality] The quality of the generated image. One of `low`, `medium`, `high`,
693
+ # @param quality [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Quality] The quality of the generated image. The GPT image models support `low`,
687
694
  #
688
- # @param size [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`
695
+ # @param size [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `
689
696
  #
690
697
  # @param type [Symbol, :image_generation] The type of the image generation tool. Always `image_generation`.
691
698
 
@@ -707,9 +714,11 @@ module OpenAI
707
714
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
708
715
  # the model will automatically determine the best background for the image.
709
716
  #
710
- # Transparent backgrounds are available for supported GPT Image models. For
711
- # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
712
- # using `transparent`, set the output format to `png` or `webp`.
717
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
718
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
719
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
720
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
721
+ # set the output format to `png` or `webp`.
713
722
  #
714
723
  # @see OpenAI::Models::Responses::Tool::ImageGeneration#background
715
724
  module Background
@@ -767,7 +776,9 @@ module OpenAI
767
776
  end
768
777
 
769
778
  # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
770
- # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
779
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
780
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
781
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
771
782
  # `chatgpt-image-latest`. Default: `gpt-image-1`.
772
783
  #
773
784
  # @see OpenAI::Models::Responses::Tool::ImageGeneration#model
@@ -784,6 +795,18 @@ module OpenAI
784
795
 
785
796
  variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_2026_04_21 }
786
797
 
798
+ variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST }
799
+
800
+ variant(
801
+ const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST_2026_09_08 }
802
+ )
803
+
804
+ variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE }
805
+
806
+ variant(
807
+ const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE_2026_09_08 }
808
+ )
809
+
787
810
  variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_1_5 }
788
811
 
789
812
  variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::CHATGPT_IMAGE_LATEST }
@@ -801,6 +824,10 @@ module OpenAI
801
824
  GPT_IMAGE_1_MINI = :"gpt-image-1-mini"
802
825
  GPT_IMAGE_2 = :"gpt-image-2"
803
826
  GPT_IMAGE_2_2026_04_21 = :"gpt-image-2-2026-04-21"
827
+ GPT_IMAGE_2_5_SUNBURST = :"gpt-image-2.5-sunburst"
828
+ GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08"
829
+ GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare"
830
+ GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08"
804
831
  GPT_IMAGE_1_5 = :"gpt-image-1.5"
805
832
  CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest"
806
833
 
@@ -835,8 +862,10 @@ module OpenAI
835
862
  # @return [Array<Symbol>]
836
863
  end
837
864
 
838
- # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.
839
- # Default: `auto`.
865
+ # The quality of the generated image. The GPT image models support `low`,
866
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
867
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
868
+ # `auto`.
840
869
  #
841
870
  # @see OpenAI::Models::Responses::Tool::ImageGeneration#quality
842
871
  module Quality
@@ -845,23 +874,26 @@ module OpenAI
845
874
  LOW = :low
846
875
  MEDIUM = :medium
847
876
  HIGH = :high
877
+ XHIGH = :xhigh
878
+ MAX = :max
848
879
  AUTO = :auto
849
880
 
850
881
  # @!method self.values
851
882
  # @return [Array<Symbol>]
852
883
  end
853
884
 
854
- # The size of the generated images. For `gpt-image-2` and
855
- # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
856
- # strings, for example `1536x864`. Width and height must both be divisible by 16
857
- # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
858
- # `2560x1440` are experimental, and the maximum supported resolution is
859
- # `3840x2160`. The requested size must also satisfy the model's current pixel and
860
- # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
861
- # supported by the GPT image models; `auto` is supported for models that allow
862
- # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
863
- # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
864
- # `1024x1792`.
885
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
886
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
887
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
888
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
889
+ # Width and height must both be divisible by 16 and the requested aspect ratio
890
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
891
+ # the maximum supported resolution is `3840x2160`. The requested size must also
892
+ # satisfy the model's current pixel and edge limits. The standard sizes
893
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
894
+ # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
895
+ # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
896
+ # `1024x1024`, `1792x1024`, or `1024x1792`.
865
897
  #
866
898
  # @see OpenAI::Models::Responses::Tool::ImageGeneration#size
867
899
  module Size
@@ -55,8 +55,8 @@ module OpenAI
55
55
  # @see OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent#data
56
56
  class Data < OpenAI::Internal::Type::BaseModel
57
57
  # @!attribute session_id
58
- # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
59
- # as `call_id` in `realtime.call.incoming`.
58
+ # The `live_...` ID of the pending SIP session. Forward this value unchanged when
59
+ # accepting or rejecting the call through the Live API.
60
60
  #
61
61
  # @return [String]
62
62
  required :session_id, String
@@ -76,7 +76,7 @@ module OpenAI
76
76
  #
77
77
  # Event data payload.
78
78
  #
79
- # @param session_id [String] The Transceiver `rtc_...` ID of the pending SIP session. The same
79
+ # @param session_id [String] The `live_...` ID of the pending SIP session. Forward this value
80
80
  #
81
81
  # @param sip_headers [Array<OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader>] Headers from the SIP Invite.
82
82