openai 0.124.0 → 0.126.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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -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/all_models.rb +1 -0
  8. data/lib/openai/models/beta/agent.rb +2 -2
  9. data/lib/openai/models/beta/agent_create_params.rb +9 -9
  10. data/lib/openai/models/beta/agent_session.rb +2 -2
  11. data/lib/openai/models/beta/agent_update_params.rb +9 -12
  12. data/lib/openai/models/beta/agents/automation_agent_config.rb +2 -2
  13. data/lib/openai/models/beta/agents/automation_target_param.rb +9 -12
  14. data/lib/openai/models/beta/agents/one_time_automation.rb +28 -1
  15. data/lib/openai/models/beta/agents/periodic_automation.rb +28 -1
  16. data/lib/openai/models/beta/agents/session_create_params.rb +9 -12
  17. data/lib/openai/models/beta/beta_response.rb +9 -0
  18. data/lib/openai/models/beta/beta_responses_client_event.rb +76 -1
  19. data/lib/openai/models/beta/response_compact_params.rb +9 -0
  20. data/lib/openai/models/beta/response_create_params.rb +70 -1
  21. data/lib/openai/models/chat_model.rb +2 -0
  22. data/lib/openai/models/live/session_config.rb +12 -1
  23. data/lib/openai/models/live/session_resource.rb +12 -1
  24. data/lib/openai/models/responses/response_compact_params.rb +9 -0
  25. data/lib/openai/models/responses/response_create_params.rb +61 -1
  26. data/lib/openai/models/responses/responses_client_event.rb +65 -1
  27. data/lib/openai/models/responses_model.rb +1 -0
  28. data/lib/openai/resources/beta/agents/sessions/events.rb +1 -0
  29. data/lib/openai/resources/beta/agents/sessions.rb +1 -0
  30. data/lib/openai/resources/beta/agents.rb +2 -3
  31. data/lib/openai/resources/beta/responses.rb +12 -2
  32. data/lib/openai/resources/responses.rb +12 -2
  33. data/lib/openai/version.rb +1 -1
  34. data/rbi/openai/internal/transport/base_client.rbi +4 -1
  35. data/rbi/openai/internal/type/base_stream.rbi +5 -0
  36. data/rbi/openai/models/all_models.rbi +1 -0
  37. data/rbi/openai/models/beta/agent.rbi +2 -2
  38. data/rbi/openai/models/beta/agent_create_params.rbi +9 -9
  39. data/rbi/openai/models/beta/agent_session.rbi +2 -2
  40. data/rbi/openai/models/beta/agent_update_params.rbi +9 -12
  41. data/rbi/openai/models/beta/agents/automation_agent_config.rbi +2 -2
  42. data/rbi/openai/models/beta/agents/automation_target_param.rbi +9 -12
  43. data/rbi/openai/models/beta/agents/one_time_automation.rbi +28 -1
  44. data/rbi/openai/models/beta/agents/periodic_automation.rbi +28 -1
  45. data/rbi/openai/models/beta/agents/session_create_params.rbi +9 -12
  46. data/rbi/openai/models/beta/beta_response.rbi +3 -0
  47. data/rbi/openai/models/beta/beta_responses_client_event.rbi +145 -0
  48. data/rbi/openai/models/beta/response_compact_params.rbi +3 -0
  49. data/rbi/openai/models/beta/response_create_params.rbi +116 -0
  50. data/rbi/openai/models/chat_model.rbi +2 -0
  51. data/rbi/openai/models/live/session_config.rbi +12 -0
  52. data/rbi/openai/models/live/session_resource.rbi +12 -0
  53. data/rbi/openai/models/responses/response_compact_params.rbi +3 -0
  54. data/rbi/openai/models/responses/response_create_params.rbi +117 -0
  55. data/rbi/openai/models/responses/responses_client_event.rbi +135 -0
  56. data/rbi/openai/models/responses_model.rbi +1 -0
  57. data/rbi/openai/resources/beta/agents.rbi +2 -3
  58. data/rbi/openai/resources/beta/responses.rbi +10 -0
  59. data/rbi/openai/resources/responses.rbi +12 -0
  60. data/sig/openai/internal/transport/base_client.rbs +1 -0
  61. data/sig/openai/internal/type/base_stream.rbs +2 -0
  62. data/sig/openai/models/all_models.rbs +2 -0
  63. data/sig/openai/models/beta/agent.rbs +2 -2
  64. data/sig/openai/models/beta/agent_create_params.rbs +8 -8
  65. data/sig/openai/models/beta/agent_session.rbs +2 -2
  66. data/sig/openai/models/beta/agent_update_params.rbs +8 -10
  67. data/sig/openai/models/beta/agents/automation_agent_config.rbs +2 -2
  68. data/sig/openai/models/beta/agents/automation_target_param.rbs +8 -10
  69. data/sig/openai/models/beta/agents/one_time_automation.rbs +20 -2
  70. data/sig/openai/models/beta/agents/periodic_automation.rbs +20 -2
  71. data/sig/openai/models/beta/agents/session_create_params.rbs +8 -10
  72. data/sig/openai/models/beta/beta_response.rbs +6 -0
  73. data/sig/openai/models/beta/beta_responses_client_event.rbs +79 -0
  74. data/sig/openai/models/beta/response_compact_params.rbs +6 -0
  75. data/sig/openai/models/beta/response_create_params.rbs +79 -0
  76. data/sig/openai/models/chat_model.rbs +4 -0
  77. data/sig/openai/models/live/session_config.rbs +10 -0
  78. data/sig/openai/models/live/session_resource.rbs +10 -0
  79. data/sig/openai/models/responses/response_compact_params.rbs +6 -0
  80. data/sig/openai/models/responses/response_create_params.rbs +73 -0
  81. data/sig/openai/models/responses/responses_client_event.rbs +73 -0
  82. data/sig/openai/models/responses_model.rbs +2 -0
  83. data/sig/openai/resources/beta/responses.rbs +2 -0
  84. data/sig/openai/resources/responses.rbs +3 -0
  85. metadata +1 -1
@@ -43,6 +43,20 @@ module OpenAI
43
43
  sig { returns(T.nilable(T::Boolean)) }
44
44
  attr_accessor :background
45
45
 
46
+ # Options for background execution on HTTP requests. The `2h` and `8h` completion
47
+ # windows require `background: true`, Standard processing, and `stream: false` or
48
+ # omitted.
49
+ sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions)) }
50
+ attr_reader :background_options
51
+
52
+ sig {
53
+ params(
54
+ background_options: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::OrHash
55
+ )
56
+ .void
57
+ }
58
+ attr_writer :background_options
59
+
46
60
  # Context management configuration for this request.
47
61
  sig {
48
62
  returns(T.nilable(T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement]))
@@ -508,6 +522,8 @@ module OpenAI
508
522
 
509
523
  background: T.nilable(T::Boolean),
510
524
 
525
+ background_options: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::OrHash,
526
+
511
527
  context_management: T.nilable(
512
528
  T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement::OrHash]
513
529
  ),
@@ -620,6 +636,11 @@ module OpenAI
620
636
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
621
637
  background: nil,
622
638
 
639
+ # Options for background execution on HTTP requests. The `2h` and `8h` completion
640
+ # windows require `background: true`, Standard processing, and `stream: false` or
641
+ # omitted.
642
+ background_options: nil,
643
+
623
644
  # Context management configuration for this request.
624
645
  context_management: nil,
625
646
 
@@ -898,6 +919,9 @@ module OpenAI
898
919
  type: Symbol,
899
920
  access_programs: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::AccessPrograms),
900
921
  background: T.nilable(T::Boolean),
922
+ background_options: T.nilable(
923
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions
924
+ ),
901
925
  context_management: T.nilable(
902
926
  T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement]
903
927
  ),
@@ -1087,6 +1111,117 @@ module OpenAI
1087
1111
  end
1088
1112
  end
1089
1113
 
1114
+ class BackgroundOptions < OpenAI::Internal::Type::BaseModel
1115
+ OrHash = T.type_alias do
1116
+ T.any(
1117
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions,
1118
+ OpenAI::Internal::AnyHash
1119
+ )
1120
+ end
1121
+
1122
+ # The completion window for background execution. Defaults to `soonest`; `2h` and
1123
+ # `8h` select discounted background execution.
1124
+ sig {
1125
+ returns(
1126
+ T.nilable(
1127
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::OrSymbol
1128
+ )
1129
+ )
1130
+ }
1131
+ attr_reader :completion_window
1132
+
1133
+ sig {
1134
+ params(
1135
+ completion_window: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::OrSymbol
1136
+ )
1137
+ .void
1138
+ }
1139
+ attr_writer :completion_window
1140
+
1141
+ # A customer-provided opaque identifier used to prioritize related background
1142
+ # requests. It does not add prior history to the input.
1143
+ sig { returns(T.nilable(String)) }
1144
+ attr_reader :continuation_id
1145
+
1146
+ sig { params(continuation_id: String).void }
1147
+ attr_writer :continuation_id
1148
+
1149
+ # Options for background execution on HTTP requests. The `2h` and `8h` completion
1150
+ # windows require `background: true`, Standard processing, and `stream: false` or
1151
+ # omitted.
1152
+ sig do
1153
+ params(
1154
+
1155
+ completion_window: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::OrSymbol,
1156
+
1157
+ continuation_id: String
1158
+ )
1159
+ .returns(T.attached_class)
1160
+ end
1161
+ def self.new(
1162
+
1163
+ # The completion window for background execution. Defaults to `soonest`; `2h` and
1164
+ # `8h` select discounted background execution.
1165
+ completion_window: nil,
1166
+
1167
+ # A customer-provided opaque identifier used to prioritize related background
1168
+ # requests. It does not add prior history to the input.
1169
+
1170
+ continuation_id: nil
1171
+ )
1172
+ end
1173
+
1174
+ sig do
1175
+ override.returns(
1176
+ {
1177
+ completion_window: T.nilable(
1178
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::OrSymbol
1179
+ ),
1180
+ continuation_id: T.nilable(String)
1181
+ }
1182
+ )
1183
+ end
1184
+ def to_hash
1185
+ end
1186
+
1187
+ # The completion window for background execution. Defaults to `soonest`; `2h` and
1188
+ # `8h` select discounted background execution.
1189
+ module CompletionWindow
1190
+ extend OpenAI::Internal::Type::Enum
1191
+
1192
+ TaggedSymbol = T.type_alias {
1193
+ T.all(
1194
+ Symbol,
1195
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow
1196
+ )
1197
+ }
1198
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1199
+
1200
+ SOONEST = T.let(
1201
+ :soonest,
1202
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::TaggedSymbol
1203
+ )
1204
+ COMPLETION_WINDOW_2H = T.let(
1205
+ :"2h",
1206
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::TaggedSymbol
1207
+ )
1208
+ COMPLETION_WINDOW_8H = T.let(
1209
+ :"8h",
1210
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::TaggedSymbol
1211
+ )
1212
+
1213
+ sig {
1214
+ override.returns(
1215
+ T::Array[
1216
+ OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::CompletionWindow::TaggedSymbol
1217
+ ]
1218
+ )
1219
+ }
1220
+ def self.values
1221
+ end
1222
+ end
1223
+ end
1224
+
1090
1225
  class ContextManagement < OpenAI::Internal::Type::BaseModel
1091
1226
  OrHash = T.type_alias do
1092
1227
  T.any(
@@ -66,6 +66,7 @@ module OpenAI
66
66
  OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
67
67
  )
68
68
  GPT_6_ROSALIND = T.let(:"gpt-6-rosalind", OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol)
69
+ GPT_6_2_ASTRA_LAW = T.let(:"gpt-6.2-astra-law", OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol)
69
70
 
70
71
  sig { override.returns(T::Array[OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol]) }
71
72
  def self.values
@@ -53,7 +53,7 @@ module OpenAI
53
53
  def create(
54
54
  # The model to use for the agent. The requested model name is preserved.
55
55
  model:,
56
- # Context compaction settings. Omission or null enables background compaction.
56
+ # Context compaction settings. Omission or null uses blocking compaction.
57
57
  compaction: nil,
58
58
  # Experimental agent settings. All experimental features default to disabled.
59
59
  experimental: nil,
@@ -128,8 +128,7 @@ module OpenAI
128
128
  # The ID of the reusable agent.
129
129
  agent_id,
130
130
  # Context compaction settings. Omit to keep the current settings. A supplied
131
- # object replaces the settings; null or an empty object enables background
132
- # compaction.
131
+ # object replaces the settings; null or an empty object uses blocking compaction.
133
132
  compaction: nil,
134
133
  # Experimental settings to merge by key. Omitted settings keep their current
135
134
  # values.
@@ -57,6 +57,7 @@ module OpenAI
57
57
  params(
58
58
  access_programs: OpenAI::Beta::ResponseCreateParams::AccessPrograms::OrHash,
59
59
  background: T.nilable(T::Boolean),
60
+ background_options: OpenAI::Beta::ResponseCreateParams::BackgroundOptions::OrHash,
60
61
  context_management: T.nilable(T::Array[OpenAI::Beta::ResponseCreateParams::ContextManagement::OrHash]),
61
62
  conversation: T.nilable(T.any(String, OpenAI::Beta::BetaResponseConversationParam::OrHash)),
62
63
  image: OpenAI::Beta::ResponseCreateParams::Image::OrHash,
@@ -129,6 +130,10 @@ module OpenAI
129
130
  # Body param: Whether to run the model response in the background.
130
131
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
131
132
  background: nil,
133
+ # Body param: Options for background execution on HTTP requests. The `2h` and `8h`
134
+ # completion windows require `background: true`, Standard processing, and
135
+ # `stream: false` or omitted.
136
+ background_options: nil,
132
137
  # Body param: Context management configuration for this request.
133
138
  context_management: nil,
134
139
  # Body param: The conversation that this response belongs to. Items from this
@@ -380,6 +385,7 @@ module OpenAI
380
385
  params(
381
386
  access_programs: OpenAI::Beta::ResponseCreateParams::AccessPrograms::OrHash,
382
387
  background: T.nilable(T::Boolean),
388
+ background_options: OpenAI::Beta::ResponseCreateParams::BackgroundOptions::OrHash,
383
389
  context_management: T.nilable(T::Array[OpenAI::Beta::ResponseCreateParams::ContextManagement::OrHash]),
384
390
  conversation: T.nilable(T.any(String, OpenAI::Beta::BetaResponseConversationParam::OrHash)),
385
391
  image: OpenAI::Beta::ResponseCreateParams::Image::OrHash,
@@ -456,6 +462,10 @@ module OpenAI
456
462
  # Body param: Whether to run the model response in the background.
457
463
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
458
464
  background: nil,
465
+ # Body param: Options for background execution on HTTP requests. The `2h` and `8h`
466
+ # completion windows require `background: true`, Standard processing, and
467
+ # `stream: false` or omitted.
468
+ background_options: nil,
459
469
  # Body param: Context management configuration for this request.
460
470
  context_management: nil,
461
471
  # Body param: The conversation that this response belongs to. Items from this
@@ -55,6 +55,7 @@ module OpenAI
55
55
  params(
56
56
  access_programs: OpenAI::Responses::ResponseCreateParams::AccessPrograms::OrHash,
57
57
  background: T.nilable(T::Boolean),
58
+ background_options: OpenAI::Responses::ResponseCreateParams::BackgroundOptions::OrHash,
58
59
  context_management: T.nilable(T::Array[OpenAI::Responses::ResponseCreateParams::ContextManagement::OrHash]),
59
60
  conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam::OrHash)),
60
61
  image: OpenAI::Responses::ResponseCreateParams::Image::OrHash,
@@ -125,6 +126,10 @@ module OpenAI
125
126
  # Whether to run the model response in the background.
126
127
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
127
128
  background: nil,
129
+ # Options for background execution on HTTP requests. The `2h` and `8h` completion
130
+ # windows require `background: true`, Standard processing, and `stream: false` or
131
+ # omitted.
132
+ background_options: nil,
128
133
  # Context management configuration for this request.
129
134
  context_management: nil,
130
135
  # The conversation that this response belongs to. Items from this conversation are
@@ -365,6 +370,7 @@ module OpenAI
365
370
  params(
366
371
  access_programs: OpenAI::Responses::ResponseCreateParams::AccessPrograms::OrHash,
367
372
  background: T.nilable(T::Boolean),
373
+ background_options: OpenAI::Responses::ResponseCreateParams::BackgroundOptions::OrHash,
368
374
  context_management: T.nilable(T::Array[OpenAI::Responses::ResponseCreateParams::ContextManagement::OrHash]),
369
375
  conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam::OrHash)),
370
376
  image: OpenAI::Responses::ResponseCreateParams::Image::OrHash,
@@ -441,6 +447,10 @@ module OpenAI
441
447
  # Whether to run the model response in the background.
442
448
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
443
449
  background: nil,
450
+ # Options for background execution on HTTP requests. The `2h` and `8h` completion
451
+ # windows require `background: true`, Standard processing, and `stream: false` or
452
+ # omitted.
453
+ background_options: nil,
444
454
  # Context management configuration for this request.
445
455
  context_management: nil,
446
456
  # The conversation that this response belongs to. Items from this conversation are
@@ -873,6 +883,7 @@ module OpenAI
873
883
  params(
874
884
  access_programs: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::AccessPrograms::OrHash,
875
885
  background: T.nilable(T::Boolean),
886
+ background_options: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::BackgroundOptions::OrHash,
876
887
  context_management: T.nilable(
877
888
  T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement::OrHash]
878
889
  ),
@@ -946,6 +957,7 @@ module OpenAI
946
957
  def create(
947
958
  access_programs: nil,
948
959
  background: nil,
960
+ background_options: nil,
949
961
  context_management: nil,
950
962
  conversation: nil,
951
963
  generate: nil,
@@ -19,6 +19,7 @@ module OpenAI
19
19
  | (^(top arg0) -> top))?,
20
20
  page: Class?,
21
21
  stream: Class?,
22
+ ?stream_mode: (:legacy | :events)?,
22
23
  model: OpenAI::Internal::Type::Converter::input?,
23
24
  security: ::Hash[(:bearer_auth | :admin_api_key_auth), bool]?,
24
25
  options: OpenAI::request_opts?
@@ -14,6 +14,8 @@ module OpenAI
14
14
 
15
15
  def close: -> void
16
16
 
17
+ def set_stream_mode: (:legacy | :events mode) -> self
18
+
17
19
  def observe: (
18
20
  context: OpenAI::Internal::Logging::Context,
19
21
  response: OpenAI::HTTPClient::Response
@@ -31,6 +31,7 @@ module OpenAI
31
31
  | :"gpt-6-cyber"
32
32
  | :"gpt-rosalind-research"
33
33
  | :"gpt-6-rosalind"
34
+ | :"gpt-6.2-astra-law"
34
35
 
35
36
  module ResponsesOnlyModel
36
37
  extend OpenAI::Internal::Type::Enum
@@ -57,6 +58,7 @@ module OpenAI
57
58
  GPT_6_CYBER: :"gpt-6-cyber"
58
59
  GPT_ROSALIND_RESEARCH: :"gpt-rosalind-research"
59
60
  GPT_6_ROSALIND: :"gpt-6-rosalind"
61
+ GPT_6_2_ASTRA_LAW: :"gpt-6.2-astra-law"
60
62
 
61
63
  def self?.values: -> ::Array[OpenAI::Models::AllModels::responses_only_model]
62
64
  end
@@ -163,11 +163,11 @@ module OpenAI
163
163
  type compaction = { async: bool }
164
164
 
165
165
  class Compaction < OpenAI::Internal::Type::BaseModel
166
- # Whether context is compacted in the background. Defaults to true.
166
+ # Whether context is compacted in the background. Defaults to false.
167
167
  attr_accessor async: bool
168
168
 
169
169
  # @param async
170
- # Whether context is compacted in the background. Defaults to true.
170
+ # Whether context is compacted in the background. Defaults to false.
171
171
  def initialize: (async: bool) -> void
172
172
 
173
173
  def to_hash: -> { async: bool }
@@ -24,7 +24,7 @@ module OpenAI
24
24
  # The model to use for the agent. The requested model name is preserved.
25
25
  attr_accessor model: String
26
26
 
27
- # Context compaction settings. Omission or null enables background compaction.
27
+ # Context compaction settings. Omission or null uses blocking compaction.
28
28
  attr_accessor compaction: OpenAI::Beta::AgentCreateParams::Compaction?
29
29
 
30
30
  # Experimental agent settings. All experimental features default to disabled.
@@ -67,7 +67,7 @@ module OpenAI
67
67
  # @param model
68
68
  # The model to use for the agent. The requested model name is preserved.
69
69
  # @param compaction
70
- # Context compaction settings. Omission or null enables background compaction.
70
+ # Context compaction settings. Omission or null uses blocking compaction.
71
71
  # @param experimental
72
72
  # Experimental agent settings. All experimental features default to disabled.
73
73
  # @param instructions
@@ -124,15 +124,15 @@ module OpenAI
124
124
  type compaction = { ?async: bool? }
125
125
 
126
126
  class Compaction < OpenAI::Internal::Type::BaseModel
127
- # Whether to compact context in the background. Omission or null defaults to true.
128
- # Set to false to use blocking compaction. Background compaction may increase
129
- # token usage.
127
+ # Whether to compact context in the background. Omission or null defaults to
128
+ # false. Set to true to enable background compaction. Background compaction may
129
+ # increase token usage.
130
130
  attr_accessor async: bool?
131
131
 
132
132
  # @param async
133
- # Whether to compact context in the background. Omission or null defaults to true.
134
- # Set to false to use blocking compaction. Background compaction may increase
135
- # token usage.
133
+ # Whether to compact context in the background. Omission or null defaults to
134
+ # false. Set to true to enable background compaction. Background compaction may
135
+ # increase token usage.
136
136
  def initialize: (?async: bool?) -> void
137
137
 
138
138
  def to_hash: -> { ?async: bool? }
@@ -280,11 +280,11 @@ module OpenAI
280
280
  type compaction = { async: bool }
281
281
 
282
282
  class Compaction < OpenAI::Internal::Type::BaseModel
283
- # Whether context is compacted in the background. Defaults to true.
283
+ # Whether context is compacted in the background. Defaults to false.
284
284
  attr_accessor async: bool
285
285
 
286
286
  # @param async
287
- # Whether context is compacted in the background. Defaults to true.
287
+ # Whether context is compacted in the background. Defaults to false.
288
288
  def initialize: (async: bool) -> void
289
289
 
290
290
  def to_hash: -> { async: bool }
@@ -25,8 +25,7 @@ module OpenAI
25
25
  attr_accessor agent_id: String
26
26
 
27
27
  # Context compaction settings. Omit to keep the current settings. A supplied
28
- # object replaces the settings; null or an empty object enables background
29
- # compaction.
28
+ # object replaces the settings; null or an empty object uses blocking compaction.
30
29
  attr_accessor compaction: OpenAI::Beta::AgentUpdateParams::Compaction?
31
30
 
32
31
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -76,8 +75,7 @@ module OpenAI
76
75
 
77
76
  # @param compaction
78
77
  # Context compaction settings. Omit to keep the current settings. A supplied
79
- # object replaces the settings; null or an empty object enables background
80
- # compaction.
78
+ # object replaces the settings; null or an empty object uses blocking compaction.
81
79
  # @param experimental
82
80
  # Experimental settings to merge by key. Omitted settings keep their current
83
81
  # values.
@@ -139,15 +137,15 @@ module OpenAI
139
137
  type compaction = { ?async: bool? }
140
138
 
141
139
  class Compaction < OpenAI::Internal::Type::BaseModel
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
  attr_accessor async: bool?
146
144
 
147
145
  # @param async
148
- # Whether to compact context in the background. Omission or null defaults to true.
149
- # Set to false to use blocking compaction. Background compaction may increase
150
- # token usage.
146
+ # Whether to compact context in the background. Omission or null defaults to
147
+ # false. Set to true to enable background compaction. Background compaction may
148
+ # increase token usage.
151
149
  def initialize: (?async: bool?) -> void
152
150
 
153
151
  def to_hash: -> { ?async: bool? }
@@ -114,11 +114,11 @@ module OpenAI
114
114
  type compaction = { async: bool }
115
115
 
116
116
  class Compaction < OpenAI::Internal::Type::BaseModel
117
- # Whether context is compacted in the background. Defaults to true.
117
+ # Whether context is compacted in the background. Defaults to false.
118
118
  attr_accessor async: bool
119
119
 
120
120
  # @param async
121
- # Whether context is compacted in the background. Defaults to true.
121
+ # Whether context is compacted in the background. Defaults to false.
122
122
  def initialize: (async: bool) -> void
123
123
 
124
124
  def to_hash: -> { async: bool }
@@ -99,8 +99,7 @@ module OpenAI
99
99
 
100
100
  class Agent < OpenAI::Internal::Type::BaseModel
101
101
  # Context compaction settings. Omit to keep the current settings. A supplied
102
- # object replaces the settings; null or an empty object enables background
103
- # compaction.
102
+ # object replaces the settings; null or an empty object uses blocking compaction.
104
103
  attr_accessor compaction: OpenAI::Beta::Agents::AutomationTargetParam::NewSession::Agent::Compaction?
105
104
 
106
105
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -143,8 +142,7 @@ module OpenAI
143
142
 
144
143
  # @param compaction
145
144
  # Context compaction settings. Omit to keep the current settings. A supplied
146
- # object replaces the settings; null or an empty object enables background
147
- # compaction.
145
+ # object replaces the settings; null or an empty object uses blocking compaction.
148
146
  # @param experimental
149
147
  # Experimental settings to merge by key. Omitted settings keep their current
150
148
  # values.
@@ -193,15 +191,15 @@ module OpenAI
193
191
  type compaction = { ?async: bool? }
194
192
 
195
193
  class Compaction < OpenAI::Internal::Type::BaseModel
196
- # Whether to compact context in the background. Omission or null defaults to true.
197
- # Set to false to use blocking compaction. Background compaction may increase
198
- # token usage.
194
+ # Whether to compact context in the background. Omission or null defaults to
195
+ # false. Set to true to enable background compaction. Background compaction may
196
+ # increase token usage.
199
197
  attr_accessor async: bool?
200
198
 
201
199
  # @param async
202
- # Whether to compact context in the background. Omission or null defaults to true.
203
- # Set to false to use blocking compaction. Background compaction may increase
204
- # token usage.
200
+ # Whether to compact context in the background. Omission or null defaults to
201
+ # false. Set to true to enable background compaction. Background compaction may
202
+ # increase token usage.
205
203
  def initialize: (?async: bool?) -> void
206
204
 
207
205
  def to_hash: -> { ?async: bool? }
@@ -13,7 +13,8 @@ module OpenAI
13
13
  run_at: Integer,
14
14
  status: OpenAI::Models::Beta::Agents::OneTimeAutomation::status,
15
15
  target: OpenAI::Models::Beta::Agents::automation_target,
16
- ?type: :once
16
+ ?type: :once,
17
+ ?pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason?
17
18
  }
18
19
 
19
20
  class OneTimeAutomation < OpenAI::Internal::Type::BaseModel
@@ -47,6 +48,9 @@ module OpenAI
47
48
  # The type of the object. Always `once`.
48
49
  attr_accessor type: :once
49
50
 
51
+ # Why the service paused this schedule, or null for other schedules.
52
+ attr_accessor pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason?
53
+
50
54
  # @param id
51
55
  # The automation ID.
52
56
  # @param created_at
@@ -63,6 +67,8 @@ module OpenAI
63
67
  # Completion means the schedule has finished, not the agent's work.
64
68
  # @param target
65
69
  # The session configuration or existing session receiving invocations.
70
+ # @param pause_reason
71
+ # Why the service paused this schedule, or null for other schedules.
66
72
  # @param object
67
73
  # Always `agent.automation`.
68
74
  # @param type
@@ -76,6 +82,7 @@ module OpenAI
76
82
  run_at: Integer,
77
83
  status: OpenAI::Models::Beta::Agents::OneTimeAutomation::status,
78
84
  target: OpenAI::Models::Beta::Agents::automation_target,
85
+ ?pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason?,
79
86
  ?object: :"agent.automation",
80
87
  ?type: :once
81
88
  ) -> void
@@ -90,7 +97,8 @@ module OpenAI
90
97
  run_at: Integer,
91
98
  status: OpenAI::Models::Beta::Agents::OneTimeAutomation::status,
92
99
  target: OpenAI::Models::Beta::Agents::automation_target,
93
- ?type: :once
100
+ ?type: :once,
101
+ ?pause_reason: OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason?
94
102
  }
95
103
 
96
104
  type status = :active | :paused | :completed
@@ -104,6 +112,16 @@ module OpenAI
104
112
 
105
113
  def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::OneTimeAutomation::status]
106
114
  end
115
+
116
+ type pause_reason = :target_session_failed
117
+
118
+ module PauseReason
119
+ extend OpenAI::Internal::Type::Enum
120
+
121
+ TARGET_SESSION_FAILED: :target_session_failed
122
+
123
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::OneTimeAutomation::pause_reason]
124
+ end
107
125
  end
108
126
  end
109
127
  end
@@ -14,7 +14,8 @@ module OpenAI
14
14
  status: OpenAI::Models::Beta::Agents::PeriodicAutomation::status,
15
15
  target: OpenAI::Models::Beta::Agents::automation_target,
16
16
  timezone: String,
17
- ?type: :periodic
17
+ ?type: :periodic,
18
+ ?pause_reason: OpenAI::Models::Beta::Agents::PeriodicAutomation::pause_reason?
18
19
  }
19
20
 
20
21
  class PeriodicAutomation < OpenAI::Internal::Type::BaseModel
@@ -51,6 +52,9 @@ module OpenAI
51
52
  # The type of the object. Always `periodic`.
52
53
  attr_accessor type: :periodic
53
54
 
55
+ # Why the service paused this schedule, or null for other schedules.
56
+ attr_accessor pause_reason: OpenAI::Models::Beta::Agents::PeriodicAutomation::pause_reason?
57
+
54
58
  # @param id
55
59
  # The automation ID.
56
60
  # @param created_at
@@ -69,6 +73,8 @@ module OpenAI
69
73
  # The session configuration or existing session receiving invocations.
70
74
  # @param timezone
71
75
  # The timezone used to interpret the expression.
76
+ # @param pause_reason
77
+ # Why the service paused this schedule, or null for other schedules.
72
78
  # @param object
73
79
  # Always `agent.automation`.
74
80
  # @param type
@@ -83,6 +89,7 @@ module OpenAI
83
89
  status: OpenAI::Models::Beta::Agents::PeriodicAutomation::status,
84
90
  target: OpenAI::Models::Beta::Agents::automation_target,
85
91
  timezone: String,
92
+ ?pause_reason: OpenAI::Models::Beta::Agents::PeriodicAutomation::pause_reason?,
86
93
  ?object: :"agent.automation",
87
94
  ?type: :periodic
88
95
  ) -> void
@@ -98,7 +105,8 @@ module OpenAI
98
105
  status: OpenAI::Models::Beta::Agents::PeriodicAutomation::status,
99
106
  target: OpenAI::Models::Beta::Agents::automation_target,
100
107
  timezone: String,
101
- ?type: :periodic
108
+ ?type: :periodic,
109
+ ?pause_reason: OpenAI::Models::Beta::Agents::PeriodicAutomation::pause_reason?
102
110
  }
103
111
 
104
112
  type status = :active | :paused
@@ -111,6 +119,16 @@ module OpenAI
111
119
 
112
120
  def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::PeriodicAutomation::status]
113
121
  end
122
+
123
+ type pause_reason = :target_session_failed
124
+
125
+ module PauseReason
126
+ extend OpenAI::Internal::Type::Enum
127
+
128
+ TARGET_SESSION_FAILED: :target_session_failed
129
+
130
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::PeriodicAutomation::pause_reason]
131
+ end
114
132
  end
115
133
  end
116
134
  end
@@ -150,8 +150,7 @@ module OpenAI
150
150
 
151
151
  class Agent < OpenAI::Internal::Type::BaseModel
152
152
  # Context compaction settings. Omit to keep the current settings. A supplied
153
- # object replaces the settings; null or an empty object enables background
154
- # compaction.
153
+ # object replaces the settings; null or an empty object uses blocking compaction.
155
154
  attr_accessor compaction: OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction?
156
155
 
157
156
  # Experimental settings to merge by key. Omitted settings keep their current
@@ -194,8 +193,7 @@ module OpenAI
194
193
 
195
194
  # @param compaction
196
195
  # Context compaction settings. Omit to keep the current settings. A supplied
197
- # object replaces the settings; null or an empty object enables background
198
- # compaction.
196
+ # object replaces the settings; null or an empty object uses blocking compaction.
199
197
  # @param experimental
200
198
  # Experimental settings to merge by key. Omitted settings keep their current
201
199
  # values.
@@ -244,15 +242,15 @@ module OpenAI
244
242
  type compaction = { ?async: bool? }
245
243
 
246
244
  class Compaction < OpenAI::Internal::Type::BaseModel
247
- # Whether to compact context in the background. Omission or null defaults to true.
248
- # Set to false to use blocking compaction. Background compaction may increase
249
- # token usage.
245
+ # Whether to compact context in the background. Omission or null defaults to
246
+ # false. Set to true to enable background compaction. Background compaction may
247
+ # increase token usage.
250
248
  attr_accessor async: bool?
251
249
 
252
250
  # @param async
253
- # Whether to compact context in the background. Omission or null defaults to true.
254
- # Set to false to use blocking compaction. Background compaction may increase
255
- # token usage.
251
+ # Whether to compact context in the background. Omission or null defaults to
252
+ # false. Set to true to enable background compaction. Background compaction may
253
+ # increase token usage.
256
254
  def initialize: (?async: bool?) -> void
257
255
 
258
256
  def to_hash: -> { ?async: bool? }