openai 0.105.0 → 0.106.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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/external_storage_configuration.rb +1 -0
  5. data/lib/openai/models/beta/agent_create_params.rb +3 -0
  6. data/lib/openai/models/beta/agent_update_params.rb +3 -0
  7. data/lib/openai/models/beta/agents/session_create_params.rb +3 -0
  8. data/lib/openai/models/beta/agents/session_update_params.rb +3 -0
  9. data/lib/openai/models/beta/assistant_update_params.rb +12 -0
  10. data/lib/openai/models/beta/beta_response.rb +12 -0
  11. data/lib/openai/models/beta/beta_responses_client_event.rb +12 -0
  12. data/lib/openai/models/beta/response_compact_params.rb +12 -0
  13. data/lib/openai/models/beta/response_create_params.rb +12 -0
  14. data/lib/openai/models/chat_model.rb +12 -0
  15. data/lib/openai/models/decision_create_params.rb +112 -1
  16. data/lib/openai/models/decision_input_image.rb +14 -1
  17. data/lib/openai/models/decision_input_text.rb +15 -1
  18. data/lib/openai/models/decision_prompt_cache_breakpoint.rb +21 -0
  19. data/lib/openai/models/live/sideband_server_event.rb +243 -3
  20. data/lib/openai/models/responses/response_compact_params.rb +12 -0
  21. data/lib/openai/models.rb +2 -0
  22. data/lib/openai/resources/beta/responses.rb +19 -0
  23. data/lib/openai/resources/decisions.rb +15 -1
  24. data/lib/openai/version.rb +1 -1
  25. data/lib/openai.rb +1 -0
  26. data/rbi/openai/models/admin/organization/external_storage_configuration.rbi +1 -0
  27. data/rbi/openai/models/beta/agent_create_params.rbi +3 -0
  28. data/rbi/openai/models/beta/agent_update_params.rbi +3 -0
  29. data/rbi/openai/models/beta/agents/session_create_params.rbi +3 -0
  30. data/rbi/openai/models/beta/agents/session_update_params.rbi +3 -0
  31. data/rbi/openai/models/decision_create_params.rbi +146 -0
  32. data/rbi/openai/models/decision_input_image.rbi +22 -1
  33. data/rbi/openai/models/decision_input_text.rbi +21 -1
  34. data/rbi/openai/models/decision_prompt_cache_breakpoint.rbi +48 -0
  35. data/rbi/openai/models/live/output_audio_delta_event.rbi +1 -1
  36. data/rbi/openai/models/live/sideband_server_event.rbi +406 -3
  37. data/rbi/openai/models.rbi +2 -0
  38. data/rbi/openai/resources/beta/responses.rbi +17 -0
  39. data/rbi/openai/resources/decisions.rbi +14 -0
  40. data/sig/openai/models/admin/organization/external_storage_configuration.rbs +2 -1
  41. data/sig/openai/models/beta/agent_create_params.rbs +5 -1
  42. data/sig/openai/models/beta/agent_update_params.rbs +5 -1
  43. data/sig/openai/models/beta/agents/session_create_params.rbs +5 -1
  44. data/sig/openai/models/beta/agents/session_update_params.rbs +5 -1
  45. data/sig/openai/models/decision_create_params.rbs +106 -0
  46. data/sig/openai/models/decision_input_image.rbs +18 -2
  47. data/sig/openai/models/decision_input_text.rbs +29 -3
  48. data/sig/openai/models/decision_prompt_cache_breakpoint.rbs +16 -0
  49. data/sig/openai/models/live/sideband_server_event.rbs +225 -0
  50. data/sig/openai/models.rbs +2 -0
  51. data/sig/openai/resources/beta/responses.rbs +7 -0
  52. data/sig/openai/resources/decisions.rbs +3 -0
  53. metadata +4 -1
@@ -3,8 +3,8 @@
3
3
  module OpenAI
4
4
  module Models
5
5
  module Live
6
- # Server events received by an attached Live sideband WebSocket. Audio deltas are
7
- # delivered over the primary connection.
6
+ # Server events received by an attached Live sideband WebSocket, including
7
+ # reflected input and output audio and transport notifications.
8
8
  module SidebandServerEvent
9
9
  extend OpenAI::Internal::Type::Union
10
10
 
@@ -70,8 +70,248 @@ module OpenAI
70
70
  # An informational notice about the Live session, such as the event permissions applied to a frontend data channel.
71
71
  variant :info, -> { OpenAI::Live::InfoEvent }
72
72
 
73
+ # Input audio received from the primary transport and reflected to a Live sideband connection before model-input muting.
74
+ variant :"session.input_audio.append", -> { OpenAI::Live::SidebandServerEvent::SessionInputAudioAppend }
75
+
76
+ # An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in delivery order using the configured session audio format. Sideband connections receive reflected output audio with timestamps.
77
+ variant :"session.output_audio.delta", -> { OpenAI::Live::OutputAudioDeltaEvent }
78
+
79
+ # A SIP DTMF keypress received from the caller. Delivered only to sideband observers.
80
+ variant :"transport.dtmf.received", -> { OpenAI::Live::SidebandServerEvent::TransportDtmfReceived }
81
+
82
+ # A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command.
83
+ variant :"transport.dtmf.send", -> { OpenAI::Live::SidebandServerEvent::TransportDtmfSend }
84
+
85
+ # The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband observers.
86
+ variant :"transport.ringing", -> { OpenAI::Live::SidebandServerEvent::TransportRinging }
87
+
88
+ # The outbound SIP provider leg answered and media is established. Delivered only to sideband observers.
89
+ variant :"transport.answered", -> { OpenAI::Live::SidebandServerEvent::TransportAnswered }
90
+
91
+ # An asynchronous outbound SIP setup failure. Delivered only to sideband observers.
92
+ variant :"transport.failed", -> { OpenAI::Live::SidebandServerEvent::TransportFailed }
93
+
94
+ class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
95
+ # @!attribute audio
96
+ # Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
97
+ # reflected to the sideband before model-input muting. This server event uses the
98
+ # same audio key as the client command, but is not an acknowledgment of it.
99
+ #
100
+ # @return [String]
101
+ required :audio, String
102
+
103
+ # @!attribute type
104
+ # The event type, always `session.input_audio.append`.
105
+ #
106
+ # @return [Symbol, :"session.input_audio.append"]
107
+ required :type, const: :"session.input_audio.append"
108
+
109
+ # @!method initialize(audio:, type: :"session.input_audio.append")
110
+ # Input audio received from the primary transport and reflected to a Live sideband
111
+ # connection before model-input muting.
112
+ #
113
+ # @param audio [String]
114
+ # Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
115
+ # reflected to the sideband before model-input muting. This server event uses the
116
+ # same audio key as the client command, but is not an acknowledgment of it.
117
+ #
118
+ # @param type [Symbol, :"session.input_audio.append"]
119
+ # The event type, always `session.input_audio.append`.
120
+ end
121
+
122
+ class TransportDtmfReceived < OpenAI::Internal::Type::BaseModel
123
+ # @!attribute event
124
+ #
125
+ # @return [String]
126
+ required :event, String
127
+
128
+ # @!attribute event_id
129
+ #
130
+ # @return [String]
131
+ required :event_id, String
132
+
133
+ # @!attribute type
134
+ #
135
+ # @return [Symbol, :"transport.dtmf.received"]
136
+ required :type, const: :"transport.dtmf.received"
137
+
138
+ # @!method initialize(event:, event_id:, type: :"transport.dtmf.received")
139
+ # A SIP DTMF keypress received from the caller. Delivered only to sideband
140
+ # observers.
141
+ #
142
+ # @param event [String]
143
+ # @param event_id [String]
144
+ # @param type [Symbol, :"transport.dtmf.received"]
145
+ end
146
+
147
+ class TransportDtmfSend < OpenAI::Internal::Type::BaseModel
148
+ # @!attribute event
149
+ #
150
+ # @return [String]
151
+ required :event, String
152
+
153
+ # @!attribute event_id
154
+ #
155
+ # @return [String]
156
+ required :event_id, String
157
+
158
+ # @!attribute type
159
+ #
160
+ # @return [Symbol, :"transport.dtmf.send"]
161
+ required :type, const: :"transport.dtmf.send"
162
+
163
+ # @!attribute client_event_id
164
+ # The event_id of the client command, when supplied.
165
+ #
166
+ # @return [String, nil]
167
+ optional :client_event_id, String
168
+
169
+ # @!method initialize(event:, event_id:, client_event_id: nil, type: :"transport.dtmf.send")
170
+ # A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
171
+ # sideband observers; this is not a client command.
172
+ #
173
+ # @param event [String]
174
+ #
175
+ # @param event_id [String]
176
+ #
177
+ # @param client_event_id [String]
178
+ # The event_id of the client command, when supplied.
179
+ #
180
+ # @param type [Symbol, :"transport.dtmf.send"]
181
+ end
182
+
183
+ class TransportRinging < OpenAI::Internal::Type::BaseModel
184
+ # @!attribute event_id
185
+ #
186
+ # @return [String]
187
+ required :event_id, String
188
+
189
+ # @!attribute session_id
190
+ # The canonical Live session ID.
191
+ #
192
+ # @return [String]
193
+ required :session_id, String
194
+
195
+ # @!attribute type
196
+ #
197
+ # @return [Symbol, :"transport.ringing"]
198
+ required :type, const: :"transport.ringing"
199
+
200
+ # @!method initialize(event_id:, session_id:, type: :"transport.ringing")
201
+ # The outbound SIP provider leg is ringing or providing early media. Delivered
202
+ # only to sideband observers.
203
+ #
204
+ # @param event_id [String]
205
+ #
206
+ # @param session_id [String]
207
+ # The canonical Live session ID.
208
+ #
209
+ # @param type [Symbol, :"transport.ringing"]
210
+ end
211
+
212
+ class TransportAnswered < OpenAI::Internal::Type::BaseModel
213
+ # @!attribute event_id
214
+ #
215
+ # @return [String]
216
+ required :event_id, String
217
+
218
+ # @!attribute session_id
219
+ # The canonical Live session ID.
220
+ #
221
+ # @return [String]
222
+ required :session_id, String
223
+
224
+ # @!attribute type
225
+ #
226
+ # @return [Symbol, :"transport.answered"]
227
+ required :type, const: :"transport.answered"
228
+
229
+ # @!method initialize(event_id:, session_id:, type: :"transport.answered")
230
+ # The outbound SIP provider leg answered and media is established. Delivered only
231
+ # to sideband observers.
232
+ #
233
+ # @param event_id [String]
234
+ #
235
+ # @param session_id [String]
236
+ # The canonical Live session ID.
237
+ #
238
+ # @param type [Symbol, :"transport.answered"]
239
+ end
240
+
241
+ class TransportFailed < OpenAI::Internal::Type::BaseModel
242
+ # @!attribute error
243
+ #
244
+ # @return [OpenAI::Models::Live::SidebandServerEvent::TransportFailed::Error]
245
+ required :error, -> { OpenAI::Live::SidebandServerEvent::TransportFailed::Error }
246
+
247
+ # @!attribute event_id
248
+ #
249
+ # @return [String]
250
+ required :event_id, String
251
+
252
+ # @!attribute session_id
253
+ # The canonical Live session ID.
254
+ #
255
+ # @return [String]
256
+ required :session_id, String
257
+
258
+ # @!attribute type
259
+ #
260
+ # @return [Symbol, :"transport.failed"]
261
+ required :type, const: :"transport.failed"
262
+
263
+ # @!method initialize(error:, event_id:, session_id:, type: :"transport.failed")
264
+ # An asynchronous outbound SIP setup failure. Delivered only to sideband
265
+ # observers.
266
+ #
267
+ # @param error [OpenAI::Models::Live::SidebandServerEvent::TransportFailed::Error]
268
+ #
269
+ # @param event_id [String]
270
+ #
271
+ # @param session_id [String]
272
+ # The canonical Live session ID.
273
+ #
274
+ # @param type [Symbol, :"transport.failed"]
275
+
276
+ # @see OpenAI::Models::Live::SidebandServerEvent::TransportFailed#error
277
+ class Error < OpenAI::Internal::Type::BaseModel
278
+ # @!attribute code
279
+ # The call setup failure code.
280
+ #
281
+ # @return [String]
282
+ required :code, String
283
+
284
+ # @!attribute message
285
+ #
286
+ # @return [String]
287
+ required :message, String
288
+
289
+ # @!attribute type
290
+ #
291
+ # @return [Symbol, :call_error]
292
+ required :type, const: :call_error
293
+
294
+ # @!attribute param
295
+ # The parameter related to the error, if any. Empty when no parameter applies.
296
+ #
297
+ # @return [String, nil]
298
+ optional :param, String
299
+
300
+ # @!method initialize(code:, message:, param: nil, type: :call_error)
301
+ # @param code [String]
302
+ # The call setup failure code.
303
+ #
304
+ # @param message [String]
305
+ #
306
+ # @param param [String]
307
+ # The parameter related to the error, if any. Empty when no parameter applies.
308
+ #
309
+ # @param type [Symbol, :call_error]
310
+ end
311
+ end
312
+
73
313
  # @!method self.variants
74
- # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent)]
314
+ # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::SidebandServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfReceived, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfSend, OpenAI::Models::Live::SidebandServerEvent::TransportRinging, OpenAI::Models::Live::SidebandServerEvent::TransportAnswered, OpenAI::Models::Live::SidebandServerEvent::TransportFailed)]
75
315
  end
76
316
  end
77
317
  end
@@ -486,7 +486,13 @@ module OpenAI
486
486
  # https://developers.openai.com/api/docs/deprecations for details and recommended
487
487
  # replacements.
488
488
  GPT_5_CHAT_LATEST = :"gpt-5-chat-latest"
489
+ # @deprecated Announced shutdown date: 2027-01-14. See
490
+ # https://developers.openai.com/api/docs/deprecations for details and recommended
491
+ # replacements.
489
492
  GPT_4_1 = :"gpt-4.1"
493
+ # @deprecated Announced shutdown date: 2027-01-14. See
494
+ # https://developers.openai.com/api/docs/deprecations for details and recommended
495
+ # replacements.
490
496
  GPT_4_1_MINI = :"gpt-4.1-mini"
491
497
  # @deprecated Announced shutdown date: 2026-10-23. See
492
498
  # https://developers.openai.com/api/docs/deprecations for details and recommended
@@ -552,6 +558,9 @@ module OpenAI
552
558
  # https://developers.openai.com/api/docs/deprecations for details and recommended
553
559
  # replacements.
554
560
  O1_MINI_2024_09_12 = :"o1-mini-2024-09-12"
561
+ # @deprecated Announced shutdown date: 2027-01-14. See
562
+ # https://developers.openai.com/api/docs/deprecations for details and recommended
563
+ # replacements.
555
564
  GPT_4O = :"gpt-4o"
556
565
  # @deprecated Announced shutdown date: 2027-01-14. See
557
566
  # https://developers.openai.com/api/docs/deprecations for details and recommended
@@ -621,6 +630,9 @@ module OpenAI
621
630
  # https://developers.openai.com/api/docs/deprecations for details and recommended
622
631
  # replacements.
623
632
  CODEX_MINI_LATEST = :"codex-mini-latest"
633
+ # @deprecated Announced shutdown date: 2027-01-14. See
634
+ # https://developers.openai.com/api/docs/deprecations for details and recommended
635
+ # replacements.
624
636
  GPT_4O_MINI = :"gpt-4o-mini"
625
637
  # @deprecated Announced shutdown date: 2027-01-14. See
626
638
  # https://developers.openai.com/api/docs/deprecations for details and recommended
data/lib/openai/models.rb CHANGED
@@ -125,6 +125,8 @@ module OpenAI
125
125
 
126
126
  DecisionInputText = OpenAI::Models::DecisionInputText
127
127
 
128
+ DecisionPromptCacheBreakpoint = OpenAI::Models::DecisionPromptCacheBreakpoint
129
+
128
130
  DeletedSkill = OpenAI::Models::DeletedSkill
129
131
 
130
132
  Embedding = OpenAI::Models::Embedding
@@ -1,10 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../../helpers/websocket/resource"
4
+
3
5
  module OpenAI
4
6
  module Resources
5
7
  class Beta
6
8
  # Create and manage model responses.
7
9
  class Responses
10
+ include OpenAI::WebSocket::Resource
11
+
12
+ # @api private
13
+ def __websocket_request(query: {})
14
+ {method: :get, path: "responses", query: query, security: {bearer_auth: true}}
15
+ end
16
+
17
+ # @api private
18
+ def __websocket_client_event
19
+ OpenAI::Models::Beta::BetaResponsesClientEvent
20
+ end
21
+
22
+ # @api private
23
+ def __websocket_server_event
24
+ OpenAI::Models::Beta::BetaResponsesServerEvent
25
+ end
26
+
8
27
  # Create and manage model responses.
9
28
  # @return [OpenAI::Resources::Beta::Responses::InputItems]
10
29
  attr_reader :input_items
@@ -6,7 +6,7 @@ module OpenAI
6
6
  # Use this endpoint to quickly answer classification or scoring questions about
7
7
  # some input. You can ask multiple questions in one request.
8
8
  #
9
- # @overload create(input:, model:, questions:, safety_identifier: nil, request_options: {})
9
+ # @overload create(input:, model:, questions:, prompt_cache_key: nil, prompt_cache_options: nil, safety_identifier: nil, request_options: {})
10
10
  #
11
11
  # @param input [String, Array<OpenAI::Models::DecisionInputMessage>]
12
12
  # The text or images to evaluate for every question. Provide a text string or user
@@ -21,6 +21,20 @@ module OpenAI
21
21
  # Ask 1–200 questions about the input. Each question can be a predicate, choice,
22
22
  # or score. Answers come back in the same order.
23
23
  #
24
+ # @param prompt_cache_key [String, nil]
25
+ # Partition prompt cache reuse by caller-provided key.
26
+ #
27
+ # @param prompt_cache_options [OpenAI::Models::DecisionCreateParams::PromptCacheOptions, nil]
28
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
29
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
30
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
31
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
32
+ # up to the latest 80 breakpoints in the conversation, without a content-block
33
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
34
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
35
+ # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
36
+ # for current details.
37
+ #
24
38
  # @param safety_identifier [String, nil]
25
39
  # Opaque caller-provided end-user identifier, scoped by the verified org. Match
26
40
  # Responses' limit; this is never the authenticated user identity.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.105.0"
4
+ VERSION = "0.106.0"
5
5
  end
data/lib/openai.rb CHANGED
@@ -973,6 +973,7 @@ require_relative "openai/models/decision_input_image"
973
973
  require_relative "openai/models/decision_input_message"
974
974
  require_relative "openai/models/decision_input_part"
975
975
  require_relative "openai/models/decision_input_text"
976
+ require_relative "openai/models/decision_prompt_cache_breakpoint"
976
977
  require_relative "openai/models/deleted_skill"
977
978
  require_relative "openai/models/embedding"
978
979
  require_relative "openai/models/embedding_create_params"
@@ -128,6 +128,7 @@ module OpenAI
128
128
  :validated,
129
129
  OpenAI::Admin::Organization::ExternalStorageConfiguration::Status::TaggedSymbol
130
130
  )
131
+ DEGRADED = T.let(:degraded, OpenAI::Admin::Organization::ExternalStorageConfiguration::Status::TaggedSymbol)
131
132
  UNHEALTHY = T.let(
132
133
  :unhealthy,
133
134
  OpenAI::Admin::Organization::ExternalStorageConfiguration::Status::TaggedSymbol
@@ -208,6 +208,9 @@ module OpenAI
208
208
  # Uses the fast service tier.
209
209
  FAST = T.let(:fast, OpenAI::Beta::AgentCreateParams::ServiceTier::TaggedSymbol)
210
210
 
211
+ # Uses the ultrafast service tier.
212
+ ULTRAFAST = T.let(:ultrafast, OpenAI::Beta::AgentCreateParams::ServiceTier::TaggedSymbol)
213
+
211
214
  sig { override.returns(T::Array[OpenAI::Beta::AgentCreateParams::ServiceTier::TaggedSymbol]) }
212
215
  def self.values
213
216
  end
@@ -219,6 +219,9 @@ module OpenAI
219
219
  # Uses the fast service tier.
220
220
  FAST = T.let(:fast, OpenAI::Beta::AgentUpdateParams::ServiceTier::TaggedSymbol)
221
221
 
222
+ # Uses the ultrafast service tier.
223
+ ULTRAFAST = T.let(:ultrafast, OpenAI::Beta::AgentUpdateParams::ServiceTier::TaggedSymbol)
224
+
222
225
  sig { override.returns(T::Array[OpenAI::Beta::AgentUpdateParams::ServiceTier::TaggedSymbol]) }
223
226
  def self.values
224
227
  end
@@ -333,6 +333,9 @@ module OpenAI
333
333
  # Uses the fast service tier.
334
334
  FAST = T.let(:fast, OpenAI::Beta::Agents::SessionCreateParams::Agent::ServiceTier::TaggedSymbol)
335
335
 
336
+ # Uses the ultrafast service tier.
337
+ ULTRAFAST = T.let(:ultrafast, OpenAI::Beta::Agents::SessionCreateParams::Agent::ServiceTier::TaggedSymbol)
338
+
336
339
  sig {
337
340
  override.returns(T::Array[OpenAI::Beta::Agents::SessionCreateParams::Agent::ServiceTier::TaggedSymbol])
338
341
  }
@@ -251,6 +251,9 @@ module OpenAI
251
251
  # Uses the fast service tier.
252
252
  FAST = T.let(:fast, OpenAI::Beta::Agents::SessionUpdateParams::Agent::ServiceTier::TaggedSymbol)
253
253
 
254
+ # Uses the ultrafast service tier.
255
+ ULTRAFAST = T.let(:ultrafast, OpenAI::Beta::Agents::SessionUpdateParams::Agent::ServiceTier::TaggedSymbol)
256
+
254
257
  sig {
255
258
  override.returns(T::Array[OpenAI::Beta::Agents::SessionUpdateParams::Agent::ServiceTier::TaggedSymbol])
256
259
  }
@@ -41,6 +41,22 @@ module OpenAI
41
41
  }
42
42
  attr_accessor :questions
43
43
 
44
+ # Partition prompt cache reuse by caller-provided key.
45
+ sig { returns(T.nilable(String)) }
46
+ attr_accessor :prompt_cache_key
47
+
48
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
49
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
50
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
51
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
52
+ # up to the latest 80 breakpoints in the conversation, without a content-block
53
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
54
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
55
+ # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
56
+ # for current details.
57
+ sig { returns(T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::OrHash)) }
58
+ attr_accessor :prompt_cache_options
59
+
44
60
  # Opaque caller-provided end-user identifier, scoped by the verified org. Match
45
61
  # Responses' limit; this is never the authenticated user identity.
46
62
  sig { returns(T.nilable(String)) }
@@ -61,6 +77,10 @@ module OpenAI
61
77
  )
62
78
  ],
63
79
 
80
+ prompt_cache_key: T.nilable(String),
81
+
82
+ prompt_cache_options: T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::OrHash),
83
+
64
84
  safety_identifier: T.nilable(String),
65
85
 
66
86
  request_options: OpenAI::RequestOptions::OrHash
@@ -82,6 +102,20 @@ module OpenAI
82
102
  # or score. Answers come back in the same order.
83
103
  questions:,
84
104
 
105
+ # Partition prompt cache reuse by caller-provided key.
106
+ prompt_cache_key: nil,
107
+
108
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
109
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
110
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
111
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
112
+ # up to the latest 80 breakpoints in the conversation, without a content-block
113
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
114
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
115
+ # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
116
+ # for current details.
117
+ prompt_cache_options: nil,
118
+
85
119
  # Opaque caller-provided end-user identifier, scoped by the verified org. Match
86
120
  # Responses' limit; this is never the authenticated user identity.
87
121
  safety_identifier: nil,
@@ -102,6 +136,8 @@ module OpenAI
102
136
  OpenAI::DecisionCreateParams::Question::Score
103
137
  )
104
138
  ],
139
+ prompt_cache_key: T.nilable(String),
140
+ prompt_cache_options: T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::OrHash),
105
141
  safety_identifier: T.nilable(String),
106
142
  request_options: OpenAI::RequestOptions
107
143
  }
@@ -440,6 +476,116 @@ module OpenAI
440
476
 
441
477
  end
442
478
 
479
+ class PromptCacheOptions < OpenAI::Internal::Type::BaseModel
480
+ OrHash = T.type_alias do
481
+ T.any(
482
+ OpenAI::DecisionCreateParams::PromptCacheOptions,
483
+ OpenAI::Internal::AnyHash
484
+ )
485
+ end
486
+
487
+ # Controls whether OpenAI automatically creates an implicit cache breakpoint.
488
+ # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
489
+ # and writes up to the latest three explicit breakpoints in the request. With
490
+ # `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
491
+ # latest four explicit breakpoints. If there are no explicit breakpoints, the
492
+ # request does not use prompt caching.
493
+ sig { returns(T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::Mode::OrSymbol)) }
494
+ attr_accessor :mode
495
+
496
+ # The minimum lifetime applied to every implicit and explicit cache breakpoint
497
+ # written by the request. Defaults to `30m`, which is currently the only supported
498
+ # value. The backend may retain cache entries for longer.
499
+ sig { returns(T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl::OrSymbol)) }
500
+ attr_reader :ttl
501
+
502
+ sig { params(ttl: OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl::OrSymbol).void }
503
+ attr_writer :ttl
504
+
505
+ # Options for prompt caching. Supported for `gpt-5.6` and later models. By
506
+ # default, OpenAI automatically chooses one implicit cache breakpoint. You can add
507
+ # explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
508
+ # request can write up to four breakpoints. For cache matching, OpenAI considers
509
+ # up to the latest 80 breakpoints in the conversation, without a content-block
510
+ # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
511
+ # `ttl` defaults to `30m`, which is currently the only supported value. See the
512
+ # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
513
+ # for current details.
514
+ sig do
515
+ params(
516
+
517
+ mode: T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::Mode::OrSymbol),
518
+
519
+ ttl: OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl::OrSymbol
520
+ )
521
+ .returns(T.attached_class)
522
+ end
523
+ def self.new(
524
+
525
+ # Controls whether OpenAI automatically creates an implicit cache breakpoint.
526
+ # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
527
+ # and writes up to the latest three explicit breakpoints in the request. With
528
+ # `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
529
+ # latest four explicit breakpoints. If there are no explicit breakpoints, the
530
+ # request does not use prompt caching.
531
+ mode: nil,
532
+
533
+ # The minimum lifetime applied to every implicit and explicit cache breakpoint
534
+ # written by the request. Defaults to `30m`, which is currently the only supported
535
+ # value. The backend may retain cache entries for longer.
536
+
537
+ ttl: nil
538
+ )
539
+ end
540
+
541
+ sig do
542
+ override.returns(
543
+ {
544
+ mode: T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::Mode::OrSymbol),
545
+ ttl: OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl::OrSymbol
546
+ }
547
+ )
548
+ end
549
+ def to_hash
550
+ end
551
+
552
+ # Controls whether OpenAI automatically creates an implicit cache breakpoint.
553
+ # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
554
+ # and writes up to the latest three explicit breakpoints in the request. With
555
+ # `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
556
+ # latest four explicit breakpoints. If there are no explicit breakpoints, the
557
+ # request does not use prompt caching.
558
+ module Mode
559
+ extend OpenAI::Internal::Type::Enum
560
+
561
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::DecisionCreateParams::PromptCacheOptions::Mode) }
562
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
563
+
564
+ IMPLICIT = T.let(:implicit, OpenAI::DecisionCreateParams::PromptCacheOptions::Mode::TaggedSymbol)
565
+ EXPLICIT = T.let(:explicit, OpenAI::DecisionCreateParams::PromptCacheOptions::Mode::TaggedSymbol)
566
+
567
+ sig { override.returns(T::Array[OpenAI::DecisionCreateParams::PromptCacheOptions::Mode::TaggedSymbol]) }
568
+ def self.values
569
+ end
570
+ end
571
+
572
+ # The minimum lifetime applied to every implicit and explicit cache breakpoint
573
+ # written by the request. Defaults to `30m`, which is currently the only supported
574
+ # value. The backend may retain cache entries for longer.
575
+ module Ttl
576
+ extend OpenAI::Internal::Type::Enum
577
+
578
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl) }
579
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
580
+
581
+ TTL_30M = T.let(:"30m", OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl::TaggedSymbol)
582
+
583
+ sig { override.returns(T::Array[OpenAI::DecisionCreateParams::PromptCacheOptions::Ttl::TaggedSymbol]) }
584
+ def self.values
585
+ end
586
+ end
587
+ end
588
+
443
589
  end
444
590
 
445
591
  end
@@ -24,6 +24,15 @@ module OpenAI
24
24
  sig { returns(T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol)) }
25
25
  attr_accessor :detail
26
26
 
27
+ # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
28
+ # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
29
+ # token block.
30
+ sig { returns(T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)) }
31
+ attr_reader :prompt_cache_breakpoint
32
+
33
+ sig { params(prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)).void }
34
+ attr_writer :prompt_cache_breakpoint
35
+
27
36
  # An image provided as a base64 data URL or a publicly accessible HTTP(S) URL.
28
37
  # File IDs are not supported.
29
38
  sig do
@@ -33,6 +42,8 @@ module OpenAI
33
42
 
34
43
  detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol),
35
44
 
45
+ prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash),
46
+
36
47
  type: Symbol
37
48
  )
38
49
  .returns(T.attached_class)
@@ -46,13 +57,23 @@ module OpenAI
46
57
  # auto.
47
58
  detail: nil,
48
59
 
60
+ # Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
61
+ # from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
62
+ # token block.
63
+ prompt_cache_breakpoint: nil,
64
+
49
65
  type: :input_image
50
66
  )
51
67
  end
52
68
 
53
69
  sig do
54
70
  override.returns(
55
- {image_url: String, type: Symbol, detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol)}
71
+ {
72
+ image_url: String,
73
+ type: Symbol,
74
+ detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol),
75
+ prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)
76
+ }
56
77
  )
57
78
  end
58
79
  def to_hash