openai 0.117.0 → 0.119.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 (154) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +1 -1
  5. data/lib/openai/helpers/data_residency.rb +4 -1
  6. data/lib/openai/models/admin/organization/projects/project_optional_service_tier.rb +24 -0
  7. data/lib/openai/models/admin/organization/projects/project_service_tier_settings.rb +88 -0
  8. data/lib/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rb +29 -0
  9. data/lib/openai/models/admin/organization/projects/service_tier_setting_update_params.rb +92 -0
  10. data/lib/openai/models/all_models.rb +1 -0
  11. data/lib/openai/models/beta/beta_compacted_response.rb +34 -1
  12. data/lib/openai/models/beta/beta_response.rb +35 -1
  13. data/lib/openai/models/beta/beta_response_input_item.rb +45 -1
  14. data/lib/openai/models/beta/beta_response_item.rb +45 -1
  15. data/lib/openai/models/beta/beta_response_output_item.rb +45 -1
  16. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +186 -13
  17. data/lib/openai/models/beta/beta_response_usage.rb +33 -1
  18. data/lib/openai/models/beta/beta_responses_client_event.rb +58 -10
  19. data/lib/openai/models/beta/beta_tool.rb +164 -13
  20. data/lib/openai/models/beta/response_compact_params.rb +47 -4
  21. data/lib/openai/models/beta/response_create_params.rb +54 -10
  22. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  23. data/lib/openai/models/chat/completion_create_params.rb +3 -3
  24. data/lib/openai/models/conversations/conversation_item.rb +45 -1
  25. data/lib/openai/models/image_edit_params.rb +72 -16
  26. data/lib/openai/models/image_generate_params.rb +160 -8
  27. data/lib/openai/models/image_model.rb +2 -0
  28. data/lib/openai/models/images_response.rb +55 -4
  29. data/lib/openai/models/realtime/realtime_audio_config_input.rb +14 -1
  30. data/lib/openai/models/realtime/realtime_session_create_response.rb +14 -1
  31. data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +14 -1
  32. data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +14 -1
  33. data/lib/openai/models/realtime/realtime_translation_session.rb +14 -1
  34. data/lib/openai/models/realtime/realtime_translation_session_create_request.rb +14 -1
  35. data/lib/openai/models/realtime/realtime_translation_session_update_request.rb +14 -1
  36. data/lib/openai/models/responses/compacted_response.rb +37 -1
  37. data/lib/openai/models/responses/response.rb +35 -1
  38. data/lib/openai/models/responses/response_compact_params.rb +53 -4
  39. data/lib/openai/models/responses/response_create_params.rb +57 -10
  40. data/lib/openai/models/responses/response_input_item.rb +45 -1
  41. data/lib/openai/models/responses/response_item.rb +45 -1
  42. data/lib/openai/models/responses/response_output_item.rb +45 -1
  43. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +186 -13
  44. data/lib/openai/models/responses/response_usage.rb +33 -1
  45. data/lib/openai/models/responses/responses_client_event.rb +58 -10
  46. data/lib/openai/models/responses/tool.rb +164 -13
  47. data/lib/openai/models/responses_model.rb +1 -0
  48. data/lib/openai/resources/admin/organization/projects/service_tier_settings.rb +77 -0
  49. data/lib/openai/resources/admin/organization/projects.rb +6 -0
  50. data/lib/openai/resources/admin/organization.rb +6 -6
  51. data/lib/openai/resources/beta/responses.rb +18 -9
  52. data/lib/openai/resources/chat/completions.rb +2 -2
  53. data/lib/openai/resources/images.rb +102 -18
  54. data/lib/openai/resources/responses.rb +15 -6
  55. data/lib/openai/version.rb +1 -1
  56. data/lib/openai.rb +5 -0
  57. data/rbi/openai/models/admin/organization/projects/project_optional_service_tier.rbi +45 -0
  58. data/rbi/openai/models/admin/organization/projects/project_service_tier_settings.rbi +143 -0
  59. data/rbi/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbi +63 -0
  60. data/rbi/openai/models/admin/organization/projects/service_tier_setting_update_params.rbi +183 -0
  61. data/rbi/openai/models/all_models.rbi +1 -0
  62. data/rbi/openai/models/beta/beta_compacted_response.rbi +67 -1
  63. data/rbi/openai/models/beta/beta_response.rbi +63 -0
  64. data/rbi/openai/models/beta/beta_response_input_item.rbi +82 -1
  65. data/rbi/openai/models/beta/beta_response_item.rbi +82 -1
  66. data/rbi/openai/models/beta/beta_response_output_item.rbi +82 -1
  67. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +338 -13
  68. data/rbi/openai/models/beta/beta_response_usage.rbi +66 -3
  69. data/rbi/openai/models/beta/beta_responses_client_event.rbi +118 -9
  70. data/rbi/openai/models/beta/beta_tool.rbi +245 -13
  71. data/rbi/openai/models/beta/response_compact_params.rbi +84 -3
  72. data/rbi/openai/models/beta/response_create_params.rbi +91 -9
  73. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  74. data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
  75. data/rbi/openai/models/conversations/conversation_item.rbi +84 -1
  76. data/rbi/openai/models/image_edit_params.rbi +76 -14
  77. data/rbi/openai/models/image_generate_params.rbi +218 -6
  78. data/rbi/openai/models/image_model.rbi +2 -0
  79. data/rbi/openai/models/images_response.rbi +90 -3
  80. data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +17 -1
  81. data/rbi/openai/models/realtime/realtime_session_create_response.rbi +17 -1
  82. data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +17 -1
  83. data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +17 -1
  84. data/rbi/openai/models/realtime/realtime_translation_session.rbi +19 -3
  85. data/rbi/openai/models/realtime/realtime_translation_session_create_request.rbi +19 -3
  86. data/rbi/openai/models/realtime/realtime_translation_session_update_request.rbi +19 -3
  87. data/rbi/openai/models/responses/compacted_response.rbi +67 -1
  88. data/rbi/openai/models/responses/response.rbi +63 -0
  89. data/rbi/openai/models/responses/response_compact_params.rbi +91 -3
  90. data/rbi/openai/models/responses/response_create_params.rbi +97 -9
  91. data/rbi/openai/models/responses/response_input_item.rbi +82 -1
  92. data/rbi/openai/models/responses/response_item.rbi +82 -1
  93. data/rbi/openai/models/responses/response_output_item.rbi +82 -1
  94. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +340 -13
  95. data/rbi/openai/models/responses/response_usage.rbi +66 -3
  96. data/rbi/openai/models/responses/responses_client_event.rbi +118 -9
  97. data/rbi/openai/models/responses/tool.rbi +248 -13
  98. data/rbi/openai/models/responses_model.rbi +1 -0
  99. data/rbi/openai/resources/admin/organization/projects/service_tier_settings.rbi +67 -0
  100. data/rbi/openai/resources/admin/organization/projects.rbi +3 -0
  101. data/rbi/openai/resources/admin/organization.rbi +3 -3
  102. data/rbi/openai/resources/beta/responses.rbi +15 -6
  103. data/rbi/openai/resources/chat/completions.rbi +2 -2
  104. data/rbi/openai/resources/images.rbi +98 -14
  105. data/rbi/openai/resources/responses.rbi +14 -3
  106. data/sig/openai/models/admin/organization/projects/project_optional_service_tier.rbs +23 -0
  107. data/sig/openai/models/admin/organization/projects/project_service_tier_settings.rbs +72 -0
  108. data/sig/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbs +32 -0
  109. data/sig/openai/models/admin/organization/projects/service_tier_setting_update_params.rbs +91 -0
  110. data/sig/openai/models/all_models.rbs +2 -0
  111. data/sig/openai/models/beta/beta_compacted_response.rbs +42 -2
  112. data/sig/openai/models/beta/beta_response.rbs +42 -1
  113. data/sig/openai/models/beta/beta_response_input_item.rbs +51 -3
  114. data/sig/openai/models/beta/beta_response_item.rbs +51 -3
  115. data/sig/openai/models/beta/beta_response_output_item.rbs +51 -3
  116. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +188 -15
  117. data/sig/openai/models/beta/beta_response_usage.rbs +40 -3
  118. data/sig/openai/models/beta/beta_responses_client_event.rbs +67 -10
  119. data/sig/openai/models/beta/beta_tool.rbs +188 -15
  120. data/sig/openai/models/beta/response_compact_params.rbs +58 -2
  121. data/sig/openai/models/beta/response_create_params.rbs +67 -10
  122. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  123. data/sig/openai/models/chat/completion_create_params.rbs +3 -3
  124. data/sig/openai/models/conversations/conversation_item.rbs +51 -3
  125. data/sig/openai/models/image_edit_params.rbs +63 -12
  126. data/sig/openai/models/image_generate_params.rbs +150 -5
  127. data/sig/openai/models/image_model.rbs +4 -0
  128. data/sig/openai/models/images_response.rbs +59 -4
  129. data/sig/openai/models/realtime/realtime_audio_config_input.rbs +20 -1
  130. data/sig/openai/models/realtime/realtime_session_create_response.rbs +20 -1
  131. data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +20 -1
  132. data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +20 -1
  133. data/sig/openai/models/realtime/realtime_translation_session.rbs +22 -3
  134. data/sig/openai/models/realtime/realtime_translation_session_create_request.rbs +22 -3
  135. data/sig/openai/models/realtime/realtime_translation_session_update_request.rbs +22 -3
  136. data/sig/openai/models/responses/compacted_response.rbs +42 -2
  137. data/sig/openai/models/responses/response.rbs +42 -1
  138. data/sig/openai/models/responses/response_compact_params.rbs +60 -2
  139. data/sig/openai/models/responses/response_create_params.rbs +67 -10
  140. data/sig/openai/models/responses/response_input_item.rbs +51 -3
  141. data/sig/openai/models/responses/response_item.rbs +51 -3
  142. data/sig/openai/models/responses/response_output_item.rbs +51 -3
  143. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +188 -15
  144. data/sig/openai/models/responses/response_usage.rbs +40 -3
  145. data/sig/openai/models/responses/responses_client_event.rbs +67 -10
  146. data/sig/openai/models/responses/tool.rbs +188 -15
  147. data/sig/openai/models/responses_model.rbs +2 -0
  148. data/sig/openai/resources/admin/organization/projects/service_tier_settings.rbs +25 -0
  149. data/sig/openai/resources/admin/organization/projects.rbs +2 -0
  150. data/sig/openai/resources/admin/organization.rbs +2 -2
  151. data/sig/openai/resources/beta/responses.rbs +3 -0
  152. data/sig/openai/resources/images.rbs +14 -0
  153. data/sig/openai/resources/responses.rbs +4 -0
  154. metadata +16 -1
@@ -99,6 +99,14 @@ module OpenAI
99
99
 
100
100
  # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionAudioInput#noise_reduction
101
101
  class NoiseReduction < OpenAI::Internal::Type::BaseModel
102
+ # @!attribute strength
103
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
104
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
105
+ # update preserves the current strength.
106
+ #
107
+ # @return [Float, nil]
108
+ optional :strength, Float
109
+
102
110
  # @!attribute type
103
111
  # Type of noise reduction. `near_field` is for close-talking microphones such as
104
112
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -107,13 +115,18 @@ module OpenAI
107
115
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
108
116
  optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
109
117
 
110
- # @!method initialize(type: nil)
118
+ # @!method initialize(strength: nil, type: nil)
111
119
  # Configuration for input audio noise reduction. This can be set to `null` to turn
112
120
  # off. Noise reduction filters audio added to the input audio buffer before it is
113
121
  # sent to VAD and the model. Filtering the audio can improve VAD and turn
114
122
  # detection accuracy (reducing false positives) and model performance by improving
115
123
  # perception of the input audio.
116
124
  #
125
+ # @param strength [Float]
126
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
127
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
128
+ # update preserves the current strength.
129
+ #
117
130
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
118
131
  # Type of noise reduction. `near_field` is for close-talking microphones such as
119
132
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -138,6 +138,14 @@ module OpenAI
138
138
 
139
139
  # @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input#noise_reduction
140
140
  class NoiseReduction < OpenAI::Internal::Type::BaseModel
141
+ # @!attribute strength
142
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
143
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
144
+ # update preserves the current strength.
145
+ #
146
+ # @return [Float, nil]
147
+ optional :strength, Float
148
+
141
149
  # @!attribute type
142
150
  # Type of noise reduction. `near_field` is for close-talking microphones such as
143
151
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -146,9 +154,14 @@ module OpenAI
146
154
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
147
155
  optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
148
156
 
149
- # @!method initialize(type: nil)
157
+ # @!method initialize(strength: nil, type: nil)
150
158
  # Configuration for input audio noise reduction.
151
159
  #
160
+ # @param strength [Float]
161
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
162
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
163
+ # update preserves the current strength.
164
+ #
152
165
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
153
166
  # Type of noise reduction. `near_field` is for close-talking microphones such as
154
167
  # headphones, `far_field` is for far-field microphones such as laptop or
@@ -116,13 +116,26 @@ module OpenAI
116
116
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
117
117
  required :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
118
118
 
119
- # @!method initialize(type:)
119
+ # @!attribute strength
120
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
121
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
122
+ # update preserves the current strength.
123
+ #
124
+ # @return [Float, nil]
125
+ optional :strength, Float
126
+
127
+ # @!method initialize(type:, strength: nil)
120
128
  # Optional input noise reduction.
121
129
  #
122
130
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
123
131
  # Type of noise reduction. `near_field` is for close-talking microphones such as
124
132
  # headphones, `far_field` is for far-field microphones such as laptop or
125
133
  # conference room microphones.
134
+ #
135
+ # @param strength [Float]
136
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
137
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
138
+ # update preserves the current strength.
126
139
  end
127
140
 
128
141
  # @see OpenAI::Models::Realtime::RealtimeTranslationSession::Audio::Input#transcription
@@ -91,13 +91,26 @@ module OpenAI
91
91
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
92
92
  required :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
93
93
 
94
- # @!method initialize(type:)
94
+ # @!attribute strength
95
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
96
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
97
+ # update preserves the current strength.
98
+ #
99
+ # @return [Float, nil]
100
+ optional :strength, Float
101
+
102
+ # @!method initialize(type:, strength: nil)
95
103
  # Optional input noise reduction. Set to `null` to disable it.
96
104
  #
97
105
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
98
106
  # Type of noise reduction. `near_field` is for close-talking microphones such as
99
107
  # headphones, `far_field` is for far-field microphones such as laptop or
100
108
  # conference room microphones.
109
+ #
110
+ # @param strength [Float]
111
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
112
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
113
+ # update preserves the current strength.
101
114
  end
102
115
 
103
116
  # @see OpenAI::Models::Realtime::RealtimeTranslationSessionCreateRequest::Audio::Input#transcription
@@ -81,13 +81,26 @@ module OpenAI
81
81
  # @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
82
82
  required :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
83
83
 
84
- # @!method initialize(type:)
84
+ # @!attribute strength
85
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
86
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
87
+ # update preserves the current strength.
88
+ #
89
+ # @return [Float, nil]
90
+ optional :strength, Float
91
+
92
+ # @!method initialize(type:, strength: nil)
85
93
  # Optional input noise reduction. Set to `null` to disable it.
86
94
  #
87
95
  # @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType]
88
96
  # Type of noise reduction. `near_field` is for close-talking microphones such as
89
97
  # headphones, `far_field` is for far-field microphones such as laptop or
90
98
  # conference room microphones.
99
+ #
100
+ # @param strength [Float]
101
+ # Input noise suppression strength. Higher values apply more suppression. Defaults
102
+ # to 1 when noise reduction is first enabled. Omitting strength from a session
103
+ # update preserves the current strength.
91
104
  end
92
105
 
93
106
  # @see OpenAI::Models::Realtime::RealtimeTranslationSessionUpdateRequest::Audio::Input#transcription
@@ -37,7 +37,12 @@ module OpenAI
37
37
  # @return [OpenAI::Models::Responses::ResponseUsage]
38
38
  required :usage, -> { OpenAI::Responses::ResponseUsage }
39
39
 
40
- # @!method initialize(id:, created_at:, output:, usage:, object: :"response.compaction")
40
+ # @!attribute image
41
+ #
42
+ # @return [OpenAI::Models::Responses::CompactedResponse::Image, nil]
43
+ optional :image, -> { OpenAI::Responses::CompactedResponse::Image }
44
+
45
+ # @!method initialize(id:, created_at:, output:, usage:, image: nil, object: :"response.compaction")
41
46
  # @param id [String]
42
47
  # The unique identifier for the compacted response.
43
48
  #
@@ -52,8 +57,39 @@ module OpenAI
52
57
  # Token accounting for the compaction pass, including cached, reasoning, and total
53
58
  # tokens.
54
59
  #
60
+ # @param image [OpenAI::Models::Responses::CompactedResponse::Image]
61
+ #
55
62
  # @param object [Symbol, :"response.compaction"]
56
63
  # The object type. Always `response.compaction`.
64
+
65
+ # @see OpenAI::Models::Responses::CompactedResponse#image
66
+ class Image < OpenAI::Internal::Type::BaseModel
67
+ # @!attribute context_compression
68
+ # Effective image context optimization policy.
69
+ #
70
+ # @return [Symbol, OpenAI::Models::Responses::CompactedResponse::Image::ContextCompression]
71
+ required(
72
+ :context_compression,
73
+ enum: -> { OpenAI::Responses::CompactedResponse::Image::ContextCompression }
74
+ )
75
+
76
+ # @!method initialize(context_compression:)
77
+ # @param context_compression [Symbol, OpenAI::Models::Responses::CompactedResponse::Image::ContextCompression]
78
+ # Effective image context optimization policy.
79
+
80
+ # Effective image context optimization policy.
81
+ #
82
+ # @see OpenAI::Models::Responses::CompactedResponse::Image#context_compression
83
+ module ContextCompression
84
+ extend OpenAI::Internal::Type::Enum
85
+
86
+ ENABLED = :enabled
87
+ DISABLED = :disabled
88
+
89
+ # @!method self.values
90
+ # @return [Array<Symbol>]
91
+ end
92
+ end
57
93
  end
58
94
  end
59
95
  end
@@ -164,6 +164,11 @@ module OpenAI
164
164
  # @return [OpenAI::Models::Responses::Response::Conversation, nil]
165
165
  optional :conversation, -> { OpenAI::Responses::Response::Conversation }, nil?: true
166
166
 
167
+ # @!attribute image
168
+ #
169
+ # @return [OpenAI::Models::Responses::Response::Image, nil]
170
+ optional :image, -> { OpenAI::Responses::Response::Image }
171
+
167
172
  # @!attribute max_output_tokens
168
173
  # An upper bound for the number of tokens that can be generated for a response,
169
174
  # including visible output tokens and
@@ -375,7 +380,7 @@ module OpenAI
375
380
  # @return [String, nil]
376
381
  optional :user, String
377
382
 
378
- # @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, tool_usage: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
383
+ # @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, image: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, tool_usage: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
379
384
  # @param id [String]
380
385
  # Unique identifier for this Response.
381
386
  #
@@ -476,6 +481,8 @@ module OpenAI
476
481
  # The conversation that this response belonged to. Input items and output items
477
482
  # from this response were automatically added to this conversation.
478
483
  #
484
+ # @param image [OpenAI::Models::Responses::Response::Image]
485
+ #
479
486
  # @param max_output_tokens [Integer, nil]
480
487
  # An upper bound for the number of tokens that can be generated for a response,
481
488
  # including visible output tokens and
@@ -787,6 +794,32 @@ module OpenAI
787
794
  # The unique ID of the conversation that this response was associated with.
788
795
  end
789
796
 
797
+ # @see OpenAI::Models::Responses::Response#image
798
+ class Image < OpenAI::Internal::Type::BaseModel
799
+ # @!attribute context_compression
800
+ # Effective image context optimization policy.
801
+ #
802
+ # @return [Symbol, OpenAI::Models::Responses::Response::Image::ContextCompression]
803
+ required :context_compression, enum: -> { OpenAI::Responses::Response::Image::ContextCompression }
804
+
805
+ # @!method initialize(context_compression:)
806
+ # @param context_compression [Symbol, OpenAI::Models::Responses::Response::Image::ContextCompression]
807
+ # Effective image context optimization policy.
808
+
809
+ # Effective image context optimization policy.
810
+ #
811
+ # @see OpenAI::Models::Responses::Response::Image#context_compression
812
+ module ContextCompression
813
+ extend OpenAI::Internal::Type::Enum
814
+
815
+ ENABLED = :enabled
816
+ DISABLED = :disabled
817
+
818
+ # @!method self.values
819
+ # @return [Array<Symbol>]
820
+ end
821
+ end
822
+
790
823
  # @see OpenAI::Models::Responses::Response#moderation
791
824
  class Moderation < OpenAI::Internal::Type::BaseModel
792
825
  # @!attribute input
@@ -1239,6 +1272,7 @@ module OpenAI
1239
1272
  extend OpenAI::Internal::Type::Enum
1240
1273
 
1241
1274
  TTL_30M = :"30m"
1275
+ TTL_12H = :"12h"
1242
1276
 
1243
1277
  # @!method self.values
1244
1278
  # @return [Array<Symbol>]
@@ -18,6 +18,12 @@ module OpenAI
18
18
  # @return [Symbol, String, OpenAI::Models::Responses::ResponseCompactParams::Model, nil]
19
19
  required :model, union: -> { OpenAI::Responses::ResponseCompactParams::Model }, nil?: true
20
20
 
21
+ # @!attribute image
22
+ # Request level image options.
23
+ #
24
+ # @return [OpenAI::Models::Responses::ResponseCompactParams::Image, nil]
25
+ optional :image, -> { OpenAI::Responses::ResponseCompactParams::Image }
26
+
21
27
  # @!attribute input
22
28
  # Text, image, or file inputs to the model, used to generate a response
23
29
  #
@@ -55,7 +61,7 @@ module OpenAI
55
61
  # request can write up to four breakpoints. For cache matching, OpenAI considers
56
62
  # up to the latest 80 breakpoints in the conversation, without a content-block
57
63
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
58
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
64
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
59
65
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
60
66
  # for current details.
61
67
  #
@@ -99,7 +105,7 @@ module OpenAI
99
105
  # @return [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil]
100
106
  optional :service_tier, enum: -> { OpenAI::Responses::ResponseCompactParams::ServiceTier }, nil?: true
101
107
 
102
- # @!method initialize(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, service_tier: nil, request_options: {})
108
+ # @!method initialize(model:, image: nil, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, service_tier: nil, request_options: {})
103
109
  # @param model [Symbol, String, OpenAI::Models::Responses::ResponseCompactParams::Model, nil]
104
110
  # Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide
105
111
  # range of models with different capabilities, performance characteristics, and
@@ -107,6 +113,9 @@ module OpenAI
107
113
  # [model guide](https://developers.openai.com/api/docs/models) to browse and
108
114
  # compare available models.
109
115
  #
116
+ # @param image [OpenAI::Models::Responses::ResponseCompactParams::Image]
117
+ # Request level image options.
118
+ #
110
119
  # @param input [String, Array<OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Responses::ResponseInputItem::Message, OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput, OpenAI::Models::Responses::ResponseInputItem::ToolSearchCall, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam, OpenAI::Models::Responses::ResponseInputItem::AdditionalTools, OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam, OpenAI::Models::Responses::ResponseReasoningItem, OpenAI::Models::Responses::ResponseCompactionItemParam, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall, OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::ShellCall, OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput, OpenAI::Models::Responses::ResponseInputItem::McpListTools, OpenAI::Models::Responses::ResponseInputItem::McpApprovalRequest, OpenAI::Models::Responses::ResponseInputItem::McpApprovalResponse, OpenAI::Models::Responses::ResponseInputItem::McpCall, OpenAI::Models::Responses::ResponseCustomToolCallOutput, OpenAI::Models::Responses::ResponseCustomToolCall, OpenAI::Models::Responses::ResponseInputItem::CompactionTrigger, OpenAI::Models::Responses::ResponseInputItem::ItemReference, OpenAI::Models::Responses::ResponseInputItem::Program, OpenAI::Models::Responses::ResponseInputItem::ProgramOutput>, nil]
111
120
  # Text, image, or file inputs to the model, used to generate a response
112
121
  #
@@ -132,7 +141,7 @@ module OpenAI
132
141
  # request can write up to four breakpoints. For cache matching, OpenAI considers
133
142
  # up to the latest 80 breakpoints in the conversation, without a content-block
134
143
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
135
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
144
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
136
145
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
137
146
  # for current details.
138
147
  #
@@ -405,6 +414,8 @@ module OpenAI
405
414
 
406
415
  variant const: -> { OpenAI::Models::Responses::ResponseCompactParams::Model::GPT_ROSALIND_RESEARCH }
407
416
 
417
+ variant const: -> { OpenAI::Models::Responses::ResponseCompactParams::Model::GPT_6_ROSALIND }
418
+
408
419
  variant String
409
420
 
410
421
  # @!method self.variants
@@ -785,10 +796,48 @@ module OpenAI
785
796
  GPT_DAYBREAK_RED_LATEST = :"gpt-daybreak-red-latest"
786
797
  GPT_5_6_CYBER = :"gpt-5.6-cyber"
787
798
  GPT_ROSALIND_RESEARCH = :"gpt-rosalind-research"
799
+ GPT_6_ROSALIND = :"gpt-6-rosalind"
788
800
 
789
801
  # @!endgroup
790
802
  end
791
803
 
804
+ class Image < OpenAI::Internal::Type::BaseModel
805
+ # @!attribute context_compression
806
+ # Controls image context optimization. Defaults to `auto`, which uses the model,
807
+ # transport, and input to select a policy. Use `enabled` to require compression
808
+ # support or `disabled` to turn it off.
809
+ #
810
+ # @return [Symbol, OpenAI::Models::Responses::ResponseCompactParams::Image::ContextCompression, nil]
811
+ optional(
812
+ :context_compression,
813
+ enum: -> { OpenAI::Responses::ResponseCompactParams::Image::ContextCompression }
814
+ )
815
+
816
+ # @!method initialize(context_compression: nil)
817
+ # Request level image options.
818
+ #
819
+ # @param context_compression [Symbol, OpenAI::Models::Responses::ResponseCompactParams::Image::ContextCompression]
820
+ # Controls image context optimization. Defaults to `auto`, which uses the model,
821
+ # transport, and input to select a policy. Use `enabled` to require compression
822
+ # support or `disabled` to turn it off.
823
+
824
+ # Controls image context optimization. Defaults to `auto`, which uses the model,
825
+ # transport, and input to select a policy. Use `enabled` to require compression
826
+ # support or `disabled` to turn it off.
827
+ #
828
+ # @see OpenAI::Models::Responses::ResponseCompactParams::Image#context_compression
829
+ module ContextCompression
830
+ extend OpenAI::Internal::Type::Enum
831
+
832
+ AUTO = :auto
833
+ ENABLED = :enabled
834
+ DISABLED = :disabled
835
+
836
+ # @!method self.values
837
+ # @return [Array<Symbol>]
838
+ end
839
+ end
840
+
792
841
  # Text, image, or file inputs to the model, used to generate a response
793
842
  module Input
794
843
  extend OpenAI::Internal::Type::Union
@@ -833,7 +882,7 @@ module OpenAI
833
882
  # request can write up to four breakpoints. For cache matching, OpenAI considers
834
883
  # up to the latest 80 breakpoints in the conversation, without a content-block
835
884
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
836
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
885
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
837
886
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
838
887
  # for current details.
839
888
  #
@@ -50,6 +50,12 @@ module OpenAI
50
50
  nil?: true
51
51
  )
52
52
 
53
+ # @!attribute image
54
+ # Request level image options.
55
+ #
56
+ # @return [OpenAI::Models::Responses::ResponseCreateParams::Image, nil]
57
+ optional :image, -> { OpenAI::Responses::ResponseCreateParams::Image }
58
+
53
59
  # @!attribute include
54
60
  # Specify additional output data to include in the model response. Currently
55
61
  # supported values are:
@@ -182,7 +188,7 @@ module OpenAI
182
188
  # request can write up to four breakpoints. For cache matching, OpenAI considers
183
189
  # up to the latest 80 breakpoints in the conversation, without a content-block
184
190
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
185
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
191
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
186
192
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
187
193
  # for current details.
188
194
  #
@@ -382,7 +388,7 @@ module OpenAI
382
388
  # @return [String, nil]
383
389
  optional :user, String
384
390
 
385
- # @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, request_options: {})
391
+ # @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, image: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, request_options: {})
386
392
  # @param access_programs [OpenAI::Models::Responses::ResponseCreateParams::AccessPrograms]
387
393
  # Domain-specific access programs to use for this request.
388
394
  #
@@ -399,6 +405,9 @@ module OpenAI
399
405
  # items from this response are automatically added to this conversation after this
400
406
  # response completes.
401
407
  #
408
+ # @param image [OpenAI::Models::Responses::ResponseCreateParams::Image]
409
+ # Request level image options.
410
+ #
402
411
  # @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
403
412
  # Specify additional output data to include in the model response. Currently
404
413
  # supported values are:
@@ -491,7 +500,7 @@ module OpenAI
491
500
  # request can write up to four breakpoints. For cache matching, OpenAI considers
492
501
  # up to the latest 80 breakpoints in the conversation, without a content-block
493
502
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
494
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
503
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
495
504
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
496
505
  # for current details.
497
506
  #
@@ -726,6 +735,43 @@ module OpenAI
726
735
  # @return [Array(String, OpenAI::Models::Responses::ResponseConversationParam)]
727
736
  end
728
737
 
738
+ class Image < OpenAI::Internal::Type::BaseModel
739
+ # @!attribute context_compression
740
+ # Controls image context optimization. Defaults to `auto`, which uses the model,
741
+ # transport, and input to select a policy. Use `enabled` to require compression
742
+ # support or `disabled` to turn it off.
743
+ #
744
+ # @return [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Image::ContextCompression, nil]
745
+ optional(
746
+ :context_compression,
747
+ enum: -> { OpenAI::Responses::ResponseCreateParams::Image::ContextCompression }
748
+ )
749
+
750
+ # @!method initialize(context_compression: nil)
751
+ # Request level image options.
752
+ #
753
+ # @param context_compression [Symbol, OpenAI::Models::Responses::ResponseCreateParams::Image::ContextCompression]
754
+ # Controls image context optimization. Defaults to `auto`, which uses the model,
755
+ # transport, and input to select a policy. Use `enabled` to require compression
756
+ # support or `disabled` to turn it off.
757
+
758
+ # Controls image context optimization. Defaults to `auto`, which uses the model,
759
+ # transport, and input to select a policy. Use `enabled` to require compression
760
+ # support or `disabled` to turn it off.
761
+ #
762
+ # @see OpenAI::Models::Responses::ResponseCreateParams::Image#context_compression
763
+ module ContextCompression
764
+ extend OpenAI::Internal::Type::Enum
765
+
766
+ AUTO = :auto
767
+ ENABLED = :enabled
768
+ DISABLED = :disabled
769
+
770
+ # @!method self.values
771
+ # @return [Array<Symbol>]
772
+ end
773
+ end
774
+
729
775
  # Text, image, or file inputs to the model, used to generate a response.
730
776
  #
731
777
  # Learn more:
@@ -887,8 +933,8 @@ module OpenAI
887
933
 
888
934
  # @!attribute ttl
889
935
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
890
- # written by the request. Defaults to `30m`, which is currently the only supported
891
- # value. The backend may retain cache entries for longer.
936
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
937
+ # backend may retain cache entries for longer.
892
938
  #
893
939
  # @return [Symbol, OpenAI::Models::Responses::ResponseCreateParams::PromptCacheOptions::Ttl, nil]
894
940
  optional :ttl, enum: -> { OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::Ttl }
@@ -900,7 +946,7 @@ module OpenAI
900
946
  # request can write up to four breakpoints. For cache matching, OpenAI considers
901
947
  # up to the latest 80 breakpoints in the conversation, without a content-block
902
948
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
903
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
949
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
904
950
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
905
951
  # for current details.
906
952
  #
@@ -922,8 +968,8 @@ module OpenAI
922
968
  #
923
969
  # @param ttl [Symbol, OpenAI::Models::Responses::ResponseCreateParams::PromptCacheOptions::Ttl]
924
970
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
925
- # written by the request. Defaults to `30m`, which is currently the only supported
926
- # value. The backend may retain cache entries for longer.
971
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
972
+ # backend may retain cache entries for longer.
927
973
 
928
974
  # Controls whether OpenAI automatically creates an implicit cache breakpoint.
929
975
  # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
@@ -944,14 +990,15 @@ module OpenAI
944
990
  end
945
991
 
946
992
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
947
- # written by the request. Defaults to `30m`, which is currently the only supported
948
- # value. The backend may retain cache entries for longer.
993
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
994
+ # backend may retain cache entries for longer.
949
995
  #
950
996
  # @see OpenAI::Models::Responses::ResponseCreateParams::PromptCacheOptions#ttl
951
997
  module Ttl
952
998
  extend OpenAI::Internal::Type::Enum
953
999
 
954
1000
  TTL_30M = :"30m"
1001
+ TTL_12H = :"12h"
955
1002
 
956
1003
  # @!method self.values
957
1004
  # @return [Array<Symbol>]
@@ -719,7 +719,12 @@ module OpenAI
719
719
  nil?: true
720
720
  )
721
721
 
722
- # @!method initialize(id:, result:, status:, action: nil, background: nil, error: nil, output_format: nil, quality: nil, revised_prompt: nil, size: nil, type: :image_generation_call)
722
+ # @!attribute svg_usage
723
+ #
724
+ # @return [OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::SvgUsage, nil]
725
+ optional :svg_usage, -> { OpenAI::Responses::ResponseInputItem::ImageGenerationCall::SvgUsage }
726
+
727
+ # @!method initialize(id:, result:, status:, action: nil, background: nil, error: nil, output_format: nil, quality: nil, revised_prompt: nil, size: nil, svg_usage: nil, type: :image_generation_call)
723
728
  # An image generation request made by the model.
724
729
  #
725
730
  # @param id [String]
@@ -753,6 +758,8 @@ module OpenAI
753
758
  # @param size [String, Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size, nil]
754
759
  # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
755
760
  #
761
+ # @param svg_usage [OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::SvgUsage]
762
+ #
756
763
  # @param type [Symbol, :image_generation_call]
757
764
  # The type of the image generation call. Always `image_generation_call`.
758
765
 
@@ -905,6 +912,8 @@ module OpenAI
905
912
  PNG = :png
906
913
  WEBP = :webp
907
914
  JPEG = :jpeg
915
+ GIF = :gif
916
+ SVG = :svg
908
917
 
909
918
  # @!method self.values
910
919
  # @return [Array<Symbol>]
@@ -965,6 +974,41 @@ module OpenAI
965
974
 
966
975
  # @!endgroup
967
976
  end
977
+
978
+ # @see OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall#svg_usage
979
+ class SvgUsage < OpenAI::Internal::Type::BaseModel
980
+ # @!attribute input_tokens
981
+ #
982
+ # @return [Integer]
983
+ required :input_tokens, Integer
984
+
985
+ # @!attribute model
986
+ #
987
+ # @return [String]
988
+ required :model, String
989
+
990
+ # @!attribute output_tokens
991
+ #
992
+ # @return [Integer]
993
+ required :output_tokens, Integer
994
+
995
+ # @!attribute reasoning_tokens
996
+ #
997
+ # @return [Integer]
998
+ required :reasoning_tokens, Integer
999
+
1000
+ # @!attribute total_tokens
1001
+ #
1002
+ # @return [Integer]
1003
+ required :total_tokens, Integer
1004
+
1005
+ # @!method initialize(input_tokens:, model:, output_tokens:, reasoning_tokens:, total_tokens:)
1006
+ # @param input_tokens [Integer]
1007
+ # @param model [String]
1008
+ # @param output_tokens [Integer]
1009
+ # @param reasoning_tokens [Integer]
1010
+ # @param total_tokens [Integer]
1011
+ end
968
1012
  end
969
1013
 
970
1014
  class LocalShellCall < OpenAI::Internal::Type::BaseModel