openai 0.124.0 → 0.125.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/openai/internal/stream.rb +1 -1
  5. data/lib/openai/internal/transport/base_client.rb +11 -2
  6. data/lib/openai/internal/type/base_stream.rb +10 -0
  7. data/lib/openai/models/beta/agent.rb +2 -2
  8. data/lib/openai/models/beta/agent_create_params.rb +9 -9
  9. data/lib/openai/models/beta/agent_session.rb +2 -2
  10. data/lib/openai/models/beta/agent_update_params.rb +9 -12
  11. data/lib/openai/models/beta/agents/automation_agent_config.rb +2 -2
  12. data/lib/openai/models/beta/agents/automation_target_param.rb +9 -12
  13. data/lib/openai/models/beta/agents/one_time_automation.rb +28 -1
  14. data/lib/openai/models/beta/agents/periodic_automation.rb +28 -1
  15. data/lib/openai/models/beta/agents/session_create_params.rb +9 -12
  16. data/lib/openai/models/live/session_config.rb +12 -1
  17. data/lib/openai/models/live/session_resource.rb +12 -1
  18. data/lib/openai/resources/beta/agents/sessions/events.rb +1 -0
  19. data/lib/openai/resources/beta/agents/sessions.rb +1 -0
  20. data/lib/openai/resources/beta/agents.rb +2 -3
  21. data/lib/openai/version.rb +1 -1
  22. data/rbi/openai/internal/transport/base_client.rbi +4 -1
  23. data/rbi/openai/internal/type/base_stream.rbi +5 -0
  24. data/rbi/openai/models/beta/agent.rbi +2 -2
  25. data/rbi/openai/models/beta/agent_create_params.rbi +9 -9
  26. data/rbi/openai/models/beta/agent_session.rbi +2 -2
  27. data/rbi/openai/models/beta/agent_update_params.rbi +9 -12
  28. data/rbi/openai/models/beta/agents/automation_agent_config.rbi +2 -2
  29. data/rbi/openai/models/beta/agents/automation_target_param.rbi +9 -12
  30. data/rbi/openai/models/beta/agents/one_time_automation.rbi +28 -1
  31. data/rbi/openai/models/beta/agents/periodic_automation.rbi +28 -1
  32. data/rbi/openai/models/beta/agents/session_create_params.rbi +9 -12
  33. data/rbi/openai/models/live/session_config.rbi +12 -0
  34. data/rbi/openai/models/live/session_resource.rbi +12 -0
  35. data/rbi/openai/resources/beta/agents.rbi +2 -3
  36. data/sig/openai/internal/transport/base_client.rbs +1 -0
  37. data/sig/openai/internal/type/base_stream.rbs +2 -0
  38. data/sig/openai/models/beta/agent.rbs +2 -2
  39. data/sig/openai/models/beta/agent_create_params.rbs +8 -8
  40. data/sig/openai/models/beta/agent_session.rbs +2 -2
  41. data/sig/openai/models/beta/agent_update_params.rbs +8 -10
  42. data/sig/openai/models/beta/agents/automation_agent_config.rbs +2 -2
  43. data/sig/openai/models/beta/agents/automation_target_param.rbs +8 -10
  44. data/sig/openai/models/beta/agents/one_time_automation.rbs +20 -2
  45. data/sig/openai/models/beta/agents/periodic_automation.rbs +20 -2
  46. data/sig/openai/models/beta/agents/session_create_params.rbs +8 -10
  47. data/sig/openai/models/live/session_config.rbs +10 -0
  48. data/sig/openai/models/live/session_resource.rbs +10 -0
  49. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 468c6854a77128dea031a2f51ad887dfb74b27d676484d545006b9e9b36846e9
4
- data.tar.gz: 7dc618fb0669ee9511f2974c870884c84bd9aca08991d74b7b0082df22f4a3d5
3
+ metadata.gz: b5cd2a7ee337aebf6fbf11cdeb052a2851dfadc9fcefb7b0ca6bf84b2a8c68e5
4
+ data.tar.gz: f9f4fd6019c8dbc2822f739df88cb57ae01fa66b081d4bbe571676a2eec79734
5
5
  SHA512:
6
- metadata.gz: 3bcfb152d97f4bfdaa0c435e9a6d86ca403bd5db8f3c8beeec666620cf643d4b6b377c371568821bfd2dcfff0c332225e8f950760fc29905fb76f12c41f6232e
7
- data.tar.gz: 793ca3f90a15bc17ea78905549f4dc52a14ad09c0c4e9de478367cf39f858753f023f4ddc26300a2aa886d393a0ee92346bc0b9aecb2be5559d23d415f554c00
6
+ metadata.gz: fa3c1a6bcb6ba2982c9cadd983bc61b96975b13b11a9a4661be125c1f4affc75e14de83daadcb0f33d23b4f629523994d3db7cc0a85f5e755846419a6f1fbfe4
7
+ data.tar.gz: 674c65a1a2a2f725082597dbd96bb9114d6375a74dcd14761697c2ba1330fb8c25450e78973eec380f5cf3cb6896b8bd8d5436236d366e7484bb5501f71fecdc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.125.0](https://github.com/openai/openai-ruby/compare/v0.124.0...v0.125.0) (2026-11-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add schedule pause reasons ([#1068](https://github.com/openai/openai-ruby/issues/1068)) ([59b49f1](https://github.com/openai/openai-ruby/commit/59b49f1238b5515d9ce27991cc3f20c414689b27))
9
+ * **api:** deliver beta Agents session errors as stream events ([#1071](https://github.com/openai/openai-ruby/issues/1071)) ([372cde2](https://github.com/openai/openai-ruby/commit/372cde20c488904df4cd8d0ecc0159e86eab85af))
10
+
3
11
  ## [0.124.0](https://github.com/openai/openai-ruby/compare/v0.123.0...v0.124.0) (2026-11-12)
4
12
 
5
13
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.124.0"
18
+ gem "openai", "~> 0.125.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -30,7 +30,7 @@ module OpenAI
30
30
  next
31
31
  in {data: String => data}
32
32
  case JSON.parse(data, symbolize_names: true)
33
- in {error: error}
33
+ in {error: error} if @stream_mode != :events
34
34
  message = case error
35
35
  in String
36
36
  error
@@ -54,6 +54,7 @@ module OpenAI
54
54
  :unwrap,
55
55
  :page,
56
56
  :stream,
57
+ :stream_mode,
57
58
  :model,
58
59
  :security,
59
60
  :options
@@ -390,6 +391,8 @@ module OpenAI
390
391
  #
391
392
  # @option req [Class<OpenAI::Internal::Type::BaseStream>, nil] :stream
392
393
  #
394
+ # @option req [Symbol, :legacy, :events, nil] :stream_mode
395
+ #
393
396
  # @option req [OpenAI::Internal::Type::Converter, Class, nil] :model
394
397
  #
395
398
  # @option req [Hash{Symbol=>Boolean}, nil] :security
@@ -776,7 +779,7 @@ module OpenAI
776
779
  # Execute the request specified by `req`. This is the method that all resource
777
780
  # methods call into.
778
781
  #
779
- # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: OpenAI::Internal::Type::Unknown, security: {bearer_auth: true, admin_api_key_auth: true}, options: {})
782
+ # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, stream_mode: nil, model: OpenAI::Internal::Type::Unknown, security: {bearer_auth: true, admin_api_key_auth: true}, options: {})
780
783
  #
781
784
  # @param method [Symbol]
782
785
  #
@@ -794,6 +797,9 @@ module OpenAI
794
797
  #
795
798
  # @param stream [Class<OpenAI::Internal::Type::BaseStream>, nil]
796
799
  #
800
+ # @param stream_mode [Symbol, :legacy, :events, nil]
801
+ # Deliver domain error events instead of raising when set to `:events`.
802
+ #
797
803
  # @param model [OpenAI::Internal::Type::Converter, Class, nil]
798
804
  #
799
805
  # @param security [Hash{Symbol=>Boolean}, nil]
@@ -948,7 +954,7 @@ module OpenAI
948
954
 
949
955
  case req
950
956
  in {stream: Class => st}
951
- st.new(
957
+ stream = st.new(
952
958
  model: model,
953
959
  url: url,
954
960
  response_metadata: response_metadata,
@@ -956,6 +962,8 @@ module OpenAI
956
962
  unwrap: unwrap,
957
963
  stream: decoded
958
964
  )
965
+ stream.set_stream_mode(req[:stream_mode]) if req[:stream_mode]
966
+ stream
959
967
  in {page: Class => page}
960
968
  page.new(client: self, req: req, response_metadata: response_metadata, page_data: decoded)
961
969
  else
@@ -1011,6 +1019,7 @@ module OpenAI
1011
1019
  stream: T.nilable(
1012
1020
  T::Class[OpenAI::Internal::Type::BaseStream[T.anything, OpenAI::Internal::Type::BaseModel]]
1013
1021
  ),
1022
+ stream_mode: T.nilable(Symbol),
1014
1023
  model: T.nilable(OpenAI::Internal::Type::Converter::Input),
1015
1024
  security: T.nilable(T::Hash[Symbol, T::Boolean]),
1016
1025
  options: T.nilable(OpenAI::RequestOptions::OrHash)
@@ -39,6 +39,16 @@ module OpenAI
39
39
  # @return [void]
40
40
  def close = OpenAI::Internal::Util.close_fused!(@iterator)
41
41
 
42
+ # Configure event delivery without changing custom stream initializers.
43
+ #
44
+ # @api private
45
+ # @param mode [Symbol, :legacy, :events]
46
+ # @return [self]
47
+ def set_stream_mode(mode)
48
+ @stream_mode = mode
49
+ self
50
+ end
51
+
42
52
  # Attach request lifecycle logging without changing the stream's identity.
43
53
  #
44
54
  # @api private
@@ -165,7 +165,7 @@ module OpenAI
165
165
  # @see OpenAI::Models::Beta::Agent#compaction
166
166
  class Compaction < OpenAI::Internal::Type::BaseModel
167
167
  # @!attribute async
168
- # Whether context is compacted in the background. Defaults to true.
168
+ # Whether context is compacted in the background. Defaults to false.
169
169
  #
170
170
  # @return [Boolean]
171
171
  required :async, OpenAI::Internal::Type::Boolean
@@ -174,7 +174,7 @@ module OpenAI
174
174
  # The effective context compaction settings.
175
175
  #
176
176
  # @param async [Boolean]
177
- # Whether context is compacted in the background. Defaults to true.
177
+ # Whether context is compacted in the background. Defaults to false.
178
178
  end
179
179
 
180
180
  # @see OpenAI::Models::Beta::Agent#experimental
@@ -15,7 +15,7 @@ module OpenAI
15
15
  required :model, String
16
16
 
17
17
  # @!attribute compaction
18
- # Context compaction settings. Omission or null enables background compaction.
18
+ # Context compaction settings. Omission or null uses blocking compaction.
19
19
  #
20
20
  # @return [OpenAI::Models::Beta::AgentCreateParams::Compaction, nil]
21
21
  optional :compaction, -> { OpenAI::Beta::AgentCreateParams::Compaction }, nil?: true
@@ -88,7 +88,7 @@ module OpenAI
88
88
  # The model to use for the agent. The requested model name is preserved.
89
89
  #
90
90
  # @param compaction [OpenAI::Models::Beta::AgentCreateParams::Compaction, nil]
91
- # Context compaction settings. Omission or null enables background compaction.
91
+ # Context compaction settings. Omission or null uses blocking compaction.
92
92
  #
93
93
  # @param experimental [OpenAI::Models::Beta::AgentCreateParams::Experimental]
94
94
  # Experimental agent settings. All experimental features default to disabled.
@@ -126,20 +126,20 @@ module OpenAI
126
126
 
127
127
  class Compaction < OpenAI::Internal::Type::BaseModel
128
128
  # @!attribute async
129
- # Whether to compact context in the background. Omission or null defaults to true.
130
- # Set to false to use blocking compaction. Background compaction may increase
131
- # token usage.
129
+ # Whether to compact context in the background. Omission or null defaults to
130
+ # false. Set to true to enable background compaction. Background compaction may
131
+ # increase token usage.
132
132
  #
133
133
  # @return [Boolean, nil]
134
134
  optional :async, OpenAI::Internal::Type::Boolean, nil?: true
135
135
 
136
136
  # @!method initialize(async: nil)
137
- # Context compaction settings. Omission or null enables background compaction.
137
+ # Context compaction settings. Omission or null uses blocking compaction.
138
138
  #
139
139
  # @param async [Boolean, nil]
140
- # Whether to compact context in the background. Omission or null defaults to true.
141
- # Set to false to use blocking compaction. Background compaction may increase
142
- # token usage.
140
+ # Whether to compact context in the background. Omission or null defaults to
141
+ # false. Set to true to enable background compaction. Background compaction may
142
+ # increase token usage.
143
143
  end
144
144
 
145
145
  class Experimental < OpenAI::Internal::Type::BaseModel
@@ -277,7 +277,7 @@ module OpenAI
277
277
  # @see OpenAI::Models::Beta::AgentSession::Agent#compaction
278
278
  class Compaction < OpenAI::Internal::Type::BaseModel
279
279
  # @!attribute async
280
- # Whether context is compacted in the background. Defaults to true.
280
+ # Whether context is compacted in the background. Defaults to false.
281
281
  #
282
282
  # @return [Boolean]
283
283
  required :async, OpenAI::Internal::Type::Boolean
@@ -286,7 +286,7 @@ module OpenAI
286
286
  # The effective context compaction settings.
287
287
  #
288
288
  # @param async [Boolean]
289
- # Whether context is compacted in the background. Defaults to true.
289
+ # Whether context is compacted in the background. Defaults to false.
290
290
  end
291
291
 
292
292
  # @see OpenAI::Models::Beta::AgentSession::Agent#experimental
@@ -15,8 +15,7 @@ module OpenAI
15
15
 
16
16
  # @!attribute compaction
17
17
  # Context compaction settings. Omit to keep the current settings. A supplied
18
- # object replaces the settings; null or an empty object enables background
19
- # compaction.
18
+ # object replaces the settings; null or an empty object uses blocking compaction.
20
19
  #
21
20
  # @return [OpenAI::Models::Beta::AgentUpdateParams::Compaction, nil]
22
21
  optional :compaction, -> { OpenAI::Beta::AgentUpdateParams::Compaction }, nil?: true
@@ -96,8 +95,7 @@ module OpenAI
96
95
  #
97
96
  # @param compaction [OpenAI::Models::Beta::AgentUpdateParams::Compaction, nil]
98
97
  # Context compaction settings. Omit to keep the current settings. A supplied
99
- # object replaces the settings; null or an empty object enables background
100
- # compaction.
98
+ # object replaces the settings; null or an empty object uses blocking compaction.
101
99
  #
102
100
  # @param experimental [OpenAI::Models::Beta::AgentUpdateParams::Experimental]
103
101
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -139,22 +137,21 @@ module OpenAI
139
137
 
140
138
  class Compaction < OpenAI::Internal::Type::BaseModel
141
139
  # @!attribute async
142
- # Whether to compact context in the background. Omission or null defaults to true.
143
- # Set to false to use blocking compaction. Background compaction may increase
144
- # token usage.
140
+ # Whether to compact context in the background. Omission or null defaults to
141
+ # false. Set to true to enable background compaction. Background compaction may
142
+ # increase token usage.
145
143
  #
146
144
  # @return [Boolean, nil]
147
145
  optional :async, OpenAI::Internal::Type::Boolean, nil?: true
148
146
 
149
147
  # @!method initialize(async: nil)
150
148
  # Context compaction settings. Omit to keep the current settings. A supplied
151
- # object replaces the settings; null or an empty object enables background
152
- # compaction.
149
+ # object replaces the settings; null or an empty object uses blocking compaction.
153
150
  #
154
151
  # @param async [Boolean, nil]
155
- # Whether to compact context in the background. Omission or null defaults to true.
156
- # Set to false to use blocking compaction. Background compaction may increase
157
- # token usage.
152
+ # Whether to compact context in the background. Omission or null defaults to
153
+ # false. Set to true to enable background compaction. Background compaction may
154
+ # increase token usage.
158
155
  end
159
156
 
160
157
  class Experimental < OpenAI::Internal::Type::BaseModel
@@ -109,7 +109,7 @@ module OpenAI
109
109
  # @see OpenAI::Models::Beta::Agents::AutomationAgentConfig#compaction
110
110
  class Compaction < OpenAI::Internal::Type::BaseModel
111
111
  # @!attribute async
112
- # Whether context is compacted in the background. Defaults to true.
112
+ # Whether context is compacted in the background. Defaults to false.
113
113
  #
114
114
  # @return [Boolean]
115
115
  required :async, OpenAI::Internal::Type::Boolean
@@ -118,7 +118,7 @@ module OpenAI
118
118
  # The effective context compaction settings.
119
119
  #
120
120
  # @param async [Boolean]
121
- # Whether context is compacted in the background. Defaults to true.
121
+ # Whether context is compacted in the background. Defaults to false.
122
122
  end
123
123
 
124
124
  # @see OpenAI::Models::Beta::Agents::AutomationAgentConfig#experimental
@@ -87,8 +87,7 @@ module OpenAI
87
87
  class Agent < OpenAI::Internal::Type::BaseModel
88
88
  # @!attribute compaction
89
89
  # Context compaction settings. Omit to keep the current settings. A supplied
90
- # object replaces the settings; null or an empty object enables background
91
- # compaction.
90
+ # object replaces the settings; null or an empty object uses blocking compaction.
92
91
  #
93
92
  # @return [OpenAI::Models::Beta::Agents::AutomationTargetParam::NewSession::Agent::Compaction, nil]
94
93
  optional(
@@ -170,8 +169,7 @@ module OpenAI
170
169
  #
171
170
  # @param compaction [OpenAI::Models::Beta::Agents::AutomationTargetParam::NewSession::Agent::Compaction, nil]
172
171
  # Context compaction settings. Omit to keep the current settings. A supplied
173
- # object replaces the settings; null or an empty object enables background
174
- # compaction.
172
+ # object replaces the settings; null or an empty object uses blocking compaction.
175
173
  #
176
174
  # @param experimental [OpenAI::Models::Beta::Agents::AutomationTargetParam::NewSession::Agent::Experimental]
177
175
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -205,22 +203,21 @@ module OpenAI
205
203
  # @see OpenAI::Models::Beta::Agents::AutomationTargetParam::NewSession::Agent#compaction
206
204
  class Compaction < OpenAI::Internal::Type::BaseModel
207
205
  # @!attribute async
208
- # Whether to compact context in the background. Omission or null defaults to true.
209
- # Set to false to use blocking compaction. Background compaction may increase
210
- # token usage.
206
+ # Whether to compact context in the background. Omission or null defaults to
207
+ # false. Set to true to enable background compaction. Background compaction may
208
+ # increase token usage.
211
209
  #
212
210
  # @return [Boolean, nil]
213
211
  optional :async, OpenAI::Internal::Type::Boolean, nil?: true
214
212
 
215
213
  # @!method initialize(async: nil)
216
214
  # Context compaction settings. Omit to keep the current settings. A supplied
217
- # object replaces the settings; null or an empty object enables background
218
- # compaction.
215
+ # object replaces the settings; null or an empty object uses blocking compaction.
219
216
  #
220
217
  # @param async [Boolean, nil]
221
- # Whether to compact context in the background. Omission or null defaults to true.
222
- # Set to false to use blocking compaction. Background compaction may increase
223
- # token usage.
218
+ # Whether to compact context in the background. Omission or null defaults to
219
+ # false. Set to true to enable background compaction. Background compaction may
220
+ # increase token usage.
224
221
  end
225
222
 
226
223
  # @see OpenAI::Models::Beta::Agents::AutomationTargetParam::NewSession::Agent#experimental
@@ -65,7 +65,19 @@ module OpenAI
65
65
  # @return [Symbol, :once]
66
66
  required :type, const: :once
67
67
 
68
- # @!method initialize(id:, created_at:, created_by:, metadata:, name:, run_at:, status:, target:, object: :"agent.automation", type: :once)
68
+ # @!attribute pause_reason
69
+ # Why the service paused this schedule, or null for other schedules.
70
+ #
71
+ # @return [Symbol, OpenAI::Models::Beta::Agents::OneTimeAutomation::PauseReason, nil]
72
+ optional(
73
+ :pause_reason,
74
+ enum: -> {
75
+ OpenAI::Beta::Agents::OneTimeAutomation::PauseReason
76
+ },
77
+ nil?: true
78
+ )
79
+
80
+ # @!method initialize(id:, created_at:, created_by:, metadata:, name:, run_at:, status:, target:, pause_reason: nil, object: :"agent.automation", type: :once)
69
81
  # Fields shared by periodic and one-time automations.
70
82
  #
71
83
  # @param id [String]
@@ -92,6 +104,9 @@ module OpenAI
92
104
  # @param target [OpenAI::Models::Beta::Agents::AutomationTarget::NewSession, OpenAI::Models::Beta::Agents::AutomationTarget::ExistingSession]
93
105
  # The session configuration or existing session receiving invocations.
94
106
  #
107
+ # @param pause_reason [Symbol, OpenAI::Models::Beta::Agents::OneTimeAutomation::PauseReason, nil]
108
+ # Why the service paused this schedule, or null for other schedules.
109
+ #
95
110
  # @param object [Symbol, :"agent.automation"]
96
111
  # Always `agent.automation`.
97
112
  #
@@ -111,6 +126,18 @@ module OpenAI
111
126
  # @!method self.values
112
127
  # @return [Array<Symbol>]
113
128
  end
129
+
130
+ # Why the service paused this schedule, or null for other schedules.
131
+ #
132
+ # @see OpenAI::Models::Beta::Agents::OneTimeAutomation#pause_reason
133
+ module PauseReason
134
+ extend OpenAI::Internal::Type::Enum
135
+
136
+ TARGET_SESSION_FAILED = :target_session_failed
137
+
138
+ # @!method self.values
139
+ # @return [Array<Symbol>]
140
+ end
114
141
  end
115
142
  end
116
143
  end
@@ -71,7 +71,19 @@ module OpenAI
71
71
  # @return [Symbol, :periodic]
72
72
  required :type, const: :periodic
73
73
 
74
- # @!method initialize(id:, created_at:, created_by:, expression:, metadata:, name:, status:, target:, timezone:, object: :"agent.automation", type: :periodic)
74
+ # @!attribute pause_reason
75
+ # Why the service paused this schedule, or null for other schedules.
76
+ #
77
+ # @return [Symbol, OpenAI::Models::Beta::Agents::PeriodicAutomation::PauseReason, nil]
78
+ optional(
79
+ :pause_reason,
80
+ enum: -> {
81
+ OpenAI::Beta::Agents::PeriodicAutomation::PauseReason
82
+ },
83
+ nil?: true
84
+ )
85
+
86
+ # @!method initialize(id:, created_at:, created_by:, expression:, metadata:, name:, status:, target:, timezone:, pause_reason: nil, object: :"agent.automation", type: :periodic)
75
87
  # Fields shared by periodic and one-time automations.
76
88
  #
77
89
  # @param id [String]
@@ -101,6 +113,9 @@ module OpenAI
101
113
  # @param timezone [String]
102
114
  # The timezone used to interpret the expression.
103
115
  #
116
+ # @param pause_reason [Symbol, OpenAI::Models::Beta::Agents::PeriodicAutomation::PauseReason, nil]
117
+ # Why the service paused this schedule, or null for other schedules.
118
+ #
104
119
  # @param object [Symbol, :"agent.automation"]
105
120
  # Always `agent.automation`.
106
121
  #
@@ -119,6 +134,18 @@ module OpenAI
119
134
  # @!method self.values
120
135
  # @return [Array<Symbol>]
121
136
  end
137
+
138
+ # Why the service paused this schedule, or null for other schedules.
139
+ #
140
+ # @see OpenAI::Models::Beta::Agents::PeriodicAutomation#pause_reason
141
+ module PauseReason
142
+ extend OpenAI::Internal::Type::Enum
143
+
144
+ TARGET_SESSION_FAILED = :target_session_failed
145
+
146
+ # @!method self.values
147
+ # @return [Array<Symbol>]
148
+ end
122
149
  end
123
150
  end
124
151
  end
@@ -133,8 +133,7 @@ module OpenAI
133
133
  class Agent < OpenAI::Internal::Type::BaseModel
134
134
  # @!attribute compaction
135
135
  # Context compaction settings. Omit to keep the current settings. A supplied
136
- # object replaces the settings; null or an empty object enables background
137
- # compaction.
136
+ # object replaces the settings; null or an empty object uses blocking compaction.
138
137
  #
139
138
  # @return [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Compaction, nil]
140
139
  optional(
@@ -214,8 +213,7 @@ module OpenAI
214
213
  #
215
214
  # @param compaction [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Compaction, nil]
216
215
  # Context compaction settings. Omit to keep the current settings. A supplied
217
- # object replaces the settings; null or an empty object enables background
218
- # compaction.
216
+ # object replaces the settings; null or an empty object uses blocking compaction.
219
217
  #
220
218
  # @param experimental [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Experimental]
221
219
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -249,22 +247,21 @@ module OpenAI
249
247
  # @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#compaction
250
248
  class Compaction < OpenAI::Internal::Type::BaseModel
251
249
  # @!attribute async
252
- # Whether to compact context in the background. Omission or null defaults to true.
253
- # Set to false to use blocking compaction. Background compaction may increase
254
- # token usage.
250
+ # Whether to compact context in the background. Omission or null defaults to
251
+ # false. Set to true to enable background compaction. Background compaction may
252
+ # increase token usage.
255
253
  #
256
254
  # @return [Boolean, nil]
257
255
  optional :async, OpenAI::Internal::Type::Boolean, nil?: true
258
256
 
259
257
  # @!method initialize(async: nil)
260
258
  # Context compaction settings. Omit to keep the current settings. A supplied
261
- # object replaces the settings; null or an empty object enables background
262
- # compaction.
259
+ # object replaces the settings; null or an empty object uses blocking compaction.
263
260
  #
264
261
  # @param async [Boolean, nil]
265
- # Whether to compact context in the background. Omission or null defaults to true.
266
- # Set to false to use blocking compaction. Background compaction may increase
267
- # token usage.
262
+ # Whether to compact context in the background. Omission or null defaults to
263
+ # false. Set to true to enable background compaction. Background compaction may
264
+ # increase token usage.
268
265
  end
269
266
 
270
267
  # @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#experimental
@@ -54,6 +54,13 @@ module OpenAI
54
54
  # @return [String, nil]
55
55
  optional :instructions, String, nil?: true
56
56
 
57
+ # @!attribute safety_identifier
58
+ # A stable identifier for your end user, used for safety monitoring and abuse
59
+ # detection.
60
+ #
61
+ # @return [String, nil]
62
+ optional :safety_identifier, String, nil?: true
63
+
57
64
  # @!attribute store
58
65
  # Whether to store the session for later forking and recording download. Defaults
59
66
  # to false for new sessions.
@@ -70,7 +77,7 @@ module OpenAI
70
77
  # @return [Array<OpenAI::Models::Live::DecisionTrigger>, nil]
71
78
  optional :triggers, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger] }
72
79
 
73
- # @!method initialize(model:, audio: nil, client: nil, delegation: nil, input: nil, instructions: nil, store: nil, triggers: nil)
80
+ # @!method initialize(model:, audio: nil, client: nil, delegation: nil, input: nil, instructions: nil, safety_identifier: nil, store: nil, triggers: nil)
74
81
  # Initial configuration for a Live session, including its model, conversation
75
82
  # instructions, audio, and delegated task handling.
76
83
  #
@@ -106,6 +113,10 @@ module OpenAI
106
113
  # Limited to 16,384 client-supplied tokens. Omitted or blank instructions use
107
114
  # server defaults. Immutable after startup.
108
115
  #
116
+ # @param safety_identifier [String, nil]
117
+ # A stable identifier for your end user, used for safety monitoring and abuse
118
+ # detection.
119
+ #
109
120
  # @param store [Boolean]
110
121
  # Whether to store the session for later forking and recording download. Defaults
111
122
  # to false for new sessions.
@@ -75,6 +75,13 @@ module OpenAI
75
75
  # @return [String, nil]
76
76
  optional :instructions, String, nil?: true
77
77
 
78
+ # @!attribute safety_identifier
79
+ # A stable identifier for your end user, used for safety monitoring and abuse
80
+ # detection.
81
+ #
82
+ # @return [String, nil]
83
+ optional :safety_identifier, String, nil?: true
84
+
78
85
  # @!attribute store
79
86
  # Whether to store the session for later forking and recording download. Defaults
80
87
  # to false for new sessions.
@@ -91,7 +98,7 @@ module OpenAI
91
98
  # @return [Array<OpenAI::Models::Live::DecisionTrigger>, nil]
92
99
  optional :triggers, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger] }
93
100
 
94
- # @!method initialize(id:, expires_at:, model:, audio: nil, client: nil, delegation: nil, input: nil, instructions: nil, store: nil, triggers: nil, status: :active)
101
+ # @!method initialize(id:, expires_at:, model:, audio: nil, client: nil, delegation: nil, input: nil, instructions: nil, safety_identifier: nil, store: nil, triggers: nil, status: :active)
95
102
  # The resolved Live session configuration and server-assigned session metadata.
96
103
  #
97
104
  # @param id [String]
@@ -133,6 +140,10 @@ module OpenAI
133
140
  # Limited to 16,384 client-supplied tokens. Omitted or blank instructions use
134
141
  # server defaults. Immutable after startup.
135
142
  #
143
+ # @param safety_identifier [String, nil]
144
+ # A stable identifier for your end user, used for safety monitoring and abuse
145
+ # detection.
146
+ #
136
147
  # @param store [Boolean]
137
148
  # Whether to store the session for later forking and recording download. Defaults
138
149
  # to false for new sessions.
@@ -76,6 +76,7 @@ module OpenAI
76
76
  "accept" => "text/event-stream",
77
77
  "accept-encoding" => "identity"
78
78
  },
79
+ stream_mode: :events,
79
80
  stream: OpenAI::Internal::Stream,
80
81
  model: OpenAI::Beta::AgentSessionEvent,
81
82
  security: {bearer_auth: true},
@@ -172,6 +172,7 @@ module OpenAI
172
172
  "accept-encoding" => "identity"
173
173
  },
174
174
  body: parsed,
175
+ stream_mode: :events,
175
176
  stream: OpenAI::Helpers::Beta::Agents::CreationStream,
176
177
  model: OpenAI::Beta::AgentSessionEvent,
177
178
  security: {bearer_auth: true},
@@ -25,7 +25,7 @@ module OpenAI
25
25
  # The model to use for the agent. The requested model name is preserved.
26
26
  #
27
27
  # @param compaction [OpenAI::Models::Beta::AgentCreateParams::Compaction, nil]
28
- # Context compaction settings. Omission or null enables background compaction.
28
+ # Context compaction settings. Omission or null uses blocking compaction.
29
29
  #
30
30
  # @param experimental [OpenAI::Models::Beta::AgentCreateParams::Experimental]
31
31
  # Experimental agent settings. All experimental features default to disabled.
@@ -111,8 +111,7 @@ module OpenAI
111
111
  #
112
112
  # @param compaction [OpenAI::Models::Beta::AgentUpdateParams::Compaction, nil]
113
113
  # Context compaction settings. Omit to keep the current settings. A supplied
114
- # object replaces the settings; null or an empty object enables background
115
- # compaction.
114
+ # object replaces the settings; null or an empty object uses blocking compaction.
116
115
  #
117
116
  # @param experimental [OpenAI::Models::Beta::AgentUpdateParams::Experimental]
118
117
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.124.0"
4
+ VERSION = "0.125.0"
5
5
  end
@@ -52,6 +52,7 @@ module OpenAI
52
52
  ]
53
53
  ]
54
54
  ),
55
+ stream_mode: T.nilable(Symbol),
55
56
  model: T.nilable(OpenAI::Internal::Type::Converter::Input),
56
57
  security: T.nilable(T::Hash[Symbol, T::Boolean]),
57
58
  options: T.nilable(OpenAI::RequestOptions::OrHash)
@@ -340,7 +341,7 @@ module OpenAI
340
341
  # Execute the request specified by `req`. This is the method that all resource
341
342
  # methods call into.
342
343
  #
343
- # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: OpenAI::Internal::Type::Unknown, security: {bearer_auth: true, admin_api_key_auth: true}, options: {})
344
+ # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, stream_mode: nil, model: OpenAI::Internal::Type::Unknown, security: {bearer_auth: true, admin_api_key_auth: true}, options: {})
344
345
  sig do
345
346
  params(
346
347
  method: Symbol,
@@ -384,6 +385,7 @@ module OpenAI
384
385
  ]
385
386
  ]
386
387
  ),
388
+ stream_mode: T.nilable(Symbol),
387
389
  model: T.nilable(OpenAI::Internal::Type::Converter::Input),
388
390
  security: T.nilable(T::Hash[Symbol, T::Boolean]),
389
391
  options: T.nilable(OpenAI::RequestOptions::OrHash)
@@ -399,6 +401,7 @@ module OpenAI
399
401
  unwrap: nil,
400
402
  page: nil,
401
403
  stream: nil,
404
+ stream_mode: nil,
402
405
  model: OpenAI::Internal::Type::Unknown,
403
406
  security: {bearer_auth: true, admin_api_key_auth: true},
404
407
  options: {}
@@ -29,6 +29,11 @@ module OpenAI
29
29
  def close
30
30
  end
31
31
 
32
+ # @api private
33
+ sig { params(mode: Symbol).returns(T.self_type) }
34
+ def set_stream_mode(mode)
35
+ end
36
+
32
37
  # @api private
33
38
  sig do
34
39
  params(