openai 0.101.1 → 0.102.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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/beta/agents/environment_create_params.rb +300 -0
  5. data/lib/openai/models/beta/agents/environment_info.rb +4 -1
  6. data/lib/openai/models/beta/agents/environment_list_params.rb +78 -0
  7. data/lib/openai/models/beta/environment_param.rb +12 -1
  8. data/lib/openai/models/webhooks/agent_environment_failed_webhook_event.rb +73 -0
  9. data/lib/openai/models/webhooks/agent_environment_ready_webhook_event.rb +73 -0
  10. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +9 -3
  11. data/lib/openai/models/webhooks/webhook_create_params.rb +2 -0
  12. data/lib/openai/models/webhooks/webhook_test_params.rb +2 -0
  13. data/lib/openai/models/webhooks/webhook_update_params.rb +2 -0
  14. data/lib/openai/resources/beta/agents/environments/files.rb +4 -2
  15. data/lib/openai/resources/beta/agents/environments/templates.rb +10 -5
  16. data/lib/openai/resources/beta/agents/environments.rb +80 -1
  17. data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -5
  18. data/lib/openai/resources/beta/agents/sessions/events.rb +10 -4
  19. data/lib/openai/resources/beta/agents/sessions/items.rb +2 -1
  20. data/lib/openai/resources/beta/agents/sessions/subagents/items.rb +2 -1
  21. data/lib/openai/resources/beta/agents/sessions/subagents/turns/items.rb +2 -1
  22. data/lib/openai/resources/beta/agents/sessions/subagents/turns.rb +4 -2
  23. data/lib/openai/resources/beta/agents/sessions/subagents.rb +4 -2
  24. data/lib/openai/resources/beta/agents/sessions/traces.rb +2 -1
  25. data/lib/openai/resources/beta/agents/sessions/turns/items.rb +2 -1
  26. data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -2
  27. data/lib/openai/resources/beta/agents/sessions.rb +16 -7
  28. data/lib/openai/resources/beta/agents/vaults/credentials.rb +10 -5
  29. data/lib/openai/resources/beta/agents/vaults.rb +8 -4
  30. data/lib/openai/resources/beta/agents.rb +10 -5
  31. data/lib/openai/resources/beta/assistants.rb +10 -5
  32. data/lib/openai/resources/beta/chatkit/sessions.rb +4 -2
  33. data/lib/openai/resources/beta/chatkit/threads.rb +8 -4
  34. data/lib/openai/resources/beta/threads/messages.rb +10 -5
  35. data/lib/openai/resources/beta/threads/runs/steps.rb +4 -2
  36. data/lib/openai/resources/beta/threads/runs.rb +24 -10
  37. data/lib/openai/resources/beta/threads.rb +16 -7
  38. data/lib/openai/resources/vector_stores/file_batches.rb +8 -10
  39. data/lib/openai/resources/vector_stores/files.rb +12 -12
  40. data/lib/openai/resources/vector_stores.rb +12 -6
  41. data/lib/openai/resources/webhooks.rb +1 -1
  42. data/lib/openai/version.rb +1 -1
  43. data/lib/openai.rb +4 -0
  44. data/rbi/openai/models/beta/agents/environment_create_params.rbi +499 -0
  45. data/rbi/openai/models/beta/agents/environment_info.rbi +3 -0
  46. data/rbi/openai/models/beta/agents/environment_list_params.rbi +136 -0
  47. data/rbi/openai/models/beta/environment_param.rbi +15 -0
  48. data/rbi/openai/models/webhooks/agent_environment_failed_webhook_event.rbi +134 -0
  49. data/rbi/openai/models/webhooks/agent_environment_ready_webhook_event.rbi +134 -0
  50. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +4 -2
  51. data/rbi/openai/models/webhooks/webhook_create_params.rbi +8 -0
  52. data/rbi/openai/models/webhooks/webhook_test_params.rbi +8 -0
  53. data/rbi/openai/models/webhooks/webhook_update_params.rbi +8 -0
  54. data/rbi/openai/resources/beta/agents/environments.rbi +53 -0
  55. data/rbi/openai/resources/webhooks.rbi +2 -0
  56. data/sig/openai/models/beta/agents/environment_create_params.rbs +268 -0
  57. data/sig/openai/models/beta/agents/environment_info.rbs +5 -1
  58. data/sig/openai/models/beta/agents/environment_list_params.rbs +97 -0
  59. data/sig/openai/models/beta/environment_param.rbs +14 -0
  60. data/sig/openai/models/webhooks/agent_environment_failed_webhook_event.rbs +70 -0
  61. data/sig/openai/models/webhooks/agent_environment_ready_webhook_event.rbs +70 -0
  62. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +3 -1
  63. data/sig/openai/models/webhooks/webhook_create_params.rbs +4 -0
  64. data/sig/openai/models/webhooks/webhook_test_params.rbs +4 -0
  65. data/sig/openai/models/webhooks/webhook_update_params.rbs +4 -0
  66. data/sig/openai/resources/beta/agents/environments.rbs +15 -0
  67. data/sig/openai/resources/webhooks.rbs +3 -1
  68. metadata +13 -1
@@ -59,10 +59,11 @@ module OpenAI
59
59
  @client.request(
60
60
  method: :post,
61
61
  path: "agents",
62
+ headers: {"openai-beta" => "agents=v1"},
62
63
  body: parsed,
63
64
  model: OpenAI::Beta::Agent,
64
65
  security: {bearer_auth: true},
65
- options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **options}
66
+ options: options
66
67
  )
67
68
  end
68
69
 
@@ -83,9 +84,10 @@ module OpenAI
83
84
  @client.request(
84
85
  method: :get,
85
86
  path: ["agents/%1$s", agent_id],
87
+ headers: {"openai-beta" => "agents=v1"},
86
88
  model: OpenAI::Beta::Agent,
87
89
  security: {bearer_auth: true},
88
- options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **params[:request_options].to_h}
90
+ options: params[:request_options]
89
91
  )
90
92
  end
91
93
 
@@ -138,10 +140,11 @@ module OpenAI
138
140
  @client.request(
139
141
  method: :post,
140
142
  path: ["agents/%1$s", agent_id],
143
+ headers: {"openai-beta" => "agents=v1"},
141
144
  body: parsed,
142
145
  model: OpenAI::Beta::Agent,
143
146
  security: {bearer_auth: true},
144
- options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **options}
147
+ options: options
145
148
  )
146
149
  end
147
150
 
@@ -171,10 +174,11 @@ module OpenAI
171
174
  method: :get,
172
175
  path: "agents",
173
176
  query: query,
177
+ headers: {"openai-beta" => "agents=v1"},
174
178
  page: OpenAI::Internal::CursorPage,
175
179
  model: OpenAI::Beta::Agent,
176
180
  security: {bearer_auth: true},
177
- options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **options}
181
+ options: options
178
182
  )
179
183
  end
180
184
 
@@ -195,9 +199,10 @@ module OpenAI
195
199
  @client.request(
196
200
  method: :delete,
197
201
  path: ["agents/%1$s", agent_id],
202
+ headers: {"openai-beta" => "agents=v1"},
198
203
  model: OpenAI::Beta::AgentDeleted,
199
204
  security: {bearer_auth: true},
200
- options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **params[:request_options].to_h}
205
+ options: params[:request_options]
201
206
  )
202
207
  end
203
208
 
@@ -99,10 +99,11 @@ module OpenAI
99
99
  @client.request(
100
100
  method: :post,
101
101
  path: "assistants",
102
+ headers: {"openai-beta" => "assistants=v2"},
102
103
  body: parsed,
103
104
  model: OpenAI::Beta::Assistant,
104
105
  security: {bearer_auth: true},
105
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
106
+ options: options
106
107
  )
107
108
  end
108
109
 
@@ -124,9 +125,10 @@ module OpenAI
124
125
  @client.request(
125
126
  method: :get,
126
127
  path: ["assistants/%1$s", assistant_id],
128
+ headers: {"openai-beta" => "assistants=v2"},
127
129
  model: OpenAI::Beta::Assistant,
128
130
  security: {bearer_auth: true},
129
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **params[:request_options].to_h}
131
+ options: params[:request_options]
130
132
  )
131
133
  end
132
134
 
@@ -227,10 +229,11 @@ module OpenAI
227
229
  @client.request(
228
230
  method: :post,
229
231
  path: ["assistants/%1$s", assistant_id],
232
+ headers: {"openai-beta" => "assistants=v2"},
230
233
  body: parsed,
231
234
  model: OpenAI::Beta::Assistant,
232
235
  security: {bearer_auth: true},
233
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
236
+ options: options
234
237
  )
235
238
  end
236
239
 
@@ -272,10 +275,11 @@ module OpenAI
272
275
  method: :get,
273
276
  path: "assistants",
274
277
  query: query,
278
+ headers: {"openai-beta" => "assistants=v2"},
275
279
  page: OpenAI::Internal::CursorPage,
276
280
  model: OpenAI::Beta::Assistant,
277
281
  security: {bearer_auth: true},
278
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
282
+ options: options
279
283
  )
280
284
  end
281
285
 
@@ -297,9 +301,10 @@ module OpenAI
297
301
  @client.request(
298
302
  method: :delete,
299
303
  path: ["assistants/%1$s", assistant_id],
304
+ headers: {"openai-beta" => "assistants=v2"},
300
305
  model: OpenAI::Beta::AssistantDeleted,
301
306
  security: {bearer_auth: true},
302
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **params[:request_options].to_h}
307
+ options: params[:request_options]
303
308
  )
304
309
  end
305
310
 
@@ -36,10 +36,11 @@ module OpenAI
36
36
  @client.request(
37
37
  method: :post,
38
38
  path: "chatkit/sessions",
39
+ headers: {"openai-beta" => "chatkit_beta=v1"},
39
40
  body: parsed,
40
41
  model: OpenAI::Beta::ChatKit::ChatSession,
41
42
  security: {bearer_auth: true},
42
- options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options}
43
+ options: options
43
44
  )
44
45
  end
45
46
 
@@ -61,9 +62,10 @@ module OpenAI
61
62
  @client.request(
62
63
  method: :post,
63
64
  path: ["chatkit/sessions/%1$s/cancel", session_id],
65
+ headers: {"openai-beta" => "chatkit_beta=v1"},
64
66
  model: OpenAI::Beta::ChatKit::ChatSession,
65
67
  security: {bearer_auth: true},
66
- options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **params[:request_options].to_h}
68
+ options: params[:request_options]
67
69
  )
68
70
  end
69
71
 
@@ -21,9 +21,10 @@ module OpenAI
21
21
  @client.request(
22
22
  method: :get,
23
23
  path: ["chatkit/threads/%1$s", thread_id],
24
+ headers: {"openai-beta" => "chatkit_beta=v1"},
24
25
  model: OpenAI::Beta::ChatKit::ChatKitThread,
25
26
  security: {bearer_auth: true},
26
- options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **params[:request_options].to_h}
27
+ options: params[:request_options]
27
28
  )
28
29
  end
29
30
 
@@ -61,10 +62,11 @@ module OpenAI
61
62
  method: :get,
62
63
  path: "chatkit/threads",
63
64
  query: query,
65
+ headers: {"openai-beta" => "chatkit_beta=v1"},
64
66
  page: OpenAI::Internal::ConversationCursorPage,
65
67
  model: OpenAI::Beta::ChatKit::ChatKitThread,
66
68
  security: {bearer_auth: true},
67
- options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options}
69
+ options: options
68
70
  )
69
71
  end
70
72
 
@@ -84,9 +86,10 @@ module OpenAI
84
86
  @client.request(
85
87
  method: :delete,
86
88
  path: ["chatkit/threads/%1$s", thread_id],
89
+ headers: {"openai-beta" => "chatkit_beta=v1"},
87
90
  model: OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse,
88
91
  security: {bearer_auth: true},
89
- options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **params[:request_options].to_h}
92
+ options: params[:request_options]
90
93
  )
91
94
  end
92
95
 
@@ -123,10 +126,11 @@ module OpenAI
123
126
  method: :get,
124
127
  path: ["chatkit/threads/%1$s/items", thread_id],
125
128
  query: query,
129
+ headers: {"openai-beta" => "chatkit_beta=v1"},
126
130
  page: OpenAI::Internal::ConversationCursorPage,
127
131
  model: OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data,
128
132
  security: {bearer_auth: true},
129
- options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options}
133
+ options: options
130
134
  )
131
135
  end
132
136
 
@@ -51,10 +51,11 @@ module OpenAI
51
51
  @client.request(
52
52
  method: :post,
53
53
  path: ["threads/%1$s/messages", thread_id],
54
+ headers: {"openai-beta" => "assistants=v2"},
54
55
  body: parsed,
55
56
  model: OpenAI::Beta::Threads::Message,
56
57
  security: {bearer_auth: true},
57
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
58
+ options: options
58
59
  )
59
60
  end
60
61
 
@@ -86,9 +87,10 @@ module OpenAI
86
87
  @client.request(
87
88
  method: :get,
88
89
  path: ["threads/%1$s/messages/%2$s", thread_id, message_id],
90
+ headers: {"openai-beta" => "assistants=v2"},
89
91
  model: OpenAI::Beta::Threads::Message,
90
92
  security: {bearer_auth: true},
91
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
93
+ options: options
92
94
  )
93
95
  end
94
96
 
@@ -126,10 +128,11 @@ module OpenAI
126
128
  @client.request(
127
129
  method: :post,
128
130
  path: ["threads/%1$s/messages/%2$s", thread_id, message_id],
131
+ headers: {"openai-beta" => "assistants=v2"},
129
132
  body: parsed,
130
133
  model: OpenAI::Beta::Threads::Message,
131
134
  security: {bearer_auth: true},
132
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
135
+ options: options
133
136
  )
134
137
  end
135
138
 
@@ -179,10 +182,11 @@ module OpenAI
179
182
  method: :get,
180
183
  path: ["threads/%1$s/messages", thread_id],
181
184
  query: query,
185
+ headers: {"openai-beta" => "assistants=v2"},
182
186
  page: OpenAI::Internal::CursorPage,
183
187
  model: OpenAI::Beta::Threads::Message,
184
188
  security: {bearer_auth: true},
185
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
189
+ options: options
186
190
  )
187
191
  end
188
192
 
@@ -212,9 +216,10 @@ module OpenAI
212
216
  @client.request(
213
217
  method: :delete,
214
218
  path: ["threads/%1$s/messages/%2$s", thread_id, message_id],
219
+ headers: {"openai-beta" => "assistants=v2"},
215
220
  model: OpenAI::Beta::Threads::MessageDeleted,
216
221
  security: {bearer_auth: true},
217
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
222
+ options: options
218
223
  )
219
224
  end
220
225
 
@@ -54,9 +54,10 @@ module OpenAI
54
54
  method: :get,
55
55
  path: ["threads/%1$s/runs/%2$s/steps/%3$s", thread_id, run_id, step_id],
56
56
  query: query,
57
+ headers: {"openai-beta" => "assistants=v2"},
57
58
  model: OpenAI::Beta::Threads::Runs::RunStep,
58
59
  security: {bearer_auth: true},
59
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
60
+ options: options
60
61
  )
61
62
  end
62
63
 
@@ -118,10 +119,11 @@ module OpenAI
118
119
  method: :get,
119
120
  path: ["threads/%1$s/runs/%2$s/steps", thread_id, run_id],
120
121
  query: query,
122
+ headers: {"openai-beta" => "assistants=v2"},
121
123
  page: OpenAI::Internal::CursorPage,
122
124
  model: OpenAI::Beta::Threads::Runs::RunStep,
123
125
  security: {bearer_auth: true},
124
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
126
+ options: options
125
127
  )
126
128
  end
127
129
 
@@ -166,10 +166,11 @@ module OpenAI
166
166
  method: :post,
167
167
  path: ["threads/%1$s/runs", thread_id],
168
168
  query: query,
169
+ headers: {"openai-beta" => "assistants=v2"},
169
170
  body: parsed.except(*query_params),
170
171
  model: OpenAI::Beta::Threads::Run,
171
172
  security: {bearer_auth: true},
172
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
173
+ options: options
173
174
  )
174
175
  end
175
176
 
@@ -328,12 +329,16 @@ module OpenAI
328
329
  method: :post,
329
330
  path: ["threads/%1$s/runs", thread_id],
330
331
  query: query,
331
- headers: {"accept" => "text/event-stream", "accept-encoding" => "identity"},
332
+ headers: {
333
+ "openai-beta" => "assistants=v2",
334
+ "accept" => "text/event-stream",
335
+ "accept-encoding" => "identity"
336
+ },
332
337
  body: parsed.except(*query_params),
333
338
  stream: OpenAI::Internal::Stream,
334
339
  model: OpenAI::Beta::AssistantStreamEvent,
335
340
  security: {bearer_auth: true},
336
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
341
+ options: options
337
342
  )
338
343
  end
339
344
 
@@ -365,9 +370,10 @@ module OpenAI
365
370
  @client.request(
366
371
  method: :get,
367
372
  path: ["threads/%1$s/runs/%2$s", thread_id, run_id],
373
+ headers: {"openai-beta" => "assistants=v2"},
368
374
  model: OpenAI::Beta::Threads::Run,
369
375
  security: {bearer_auth: true},
370
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
376
+ options: options
371
377
  )
372
378
  end
373
379
 
@@ -407,10 +413,11 @@ module OpenAI
407
413
  @client.request(
408
414
  method: :post,
409
415
  path: ["threads/%1$s/runs/%2$s", thread_id, run_id],
416
+ headers: {"openai-beta" => "assistants=v2"},
410
417
  body: parsed,
411
418
  model: OpenAI::Beta::Threads::Run,
412
419
  security: {bearer_auth: true},
413
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
420
+ options: options
414
421
  )
415
422
  end
416
423
 
@@ -455,10 +462,11 @@ module OpenAI
455
462
  method: :get,
456
463
  path: ["threads/%1$s/runs", thread_id],
457
464
  query: query,
465
+ headers: {"openai-beta" => "assistants=v2"},
458
466
  page: OpenAI::Internal::CursorPage,
459
467
  model: OpenAI::Beta::Threads::Run,
460
468
  security: {bearer_auth: true},
461
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
469
+ options: options
462
470
  )
463
471
  end
464
472
 
@@ -488,9 +496,10 @@ module OpenAI
488
496
  @client.request(
489
497
  method: :post,
490
498
  path: ["threads/%1$s/runs/%2$s/cancel", thread_id, run_id],
499
+ headers: {"openai-beta" => "assistants=v2"},
491
500
  model: OpenAI::Beta::Threads::Run,
492
501
  security: {bearer_auth: true},
493
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
502
+ options: options
494
503
  )
495
504
  end
496
505
 
@@ -536,10 +545,11 @@ module OpenAI
536
545
  @client.request(
537
546
  method: :post,
538
547
  path: ["threads/%1$s/runs/%2$s/submit_tool_outputs", thread_id, run_id],
548
+ headers: {"openai-beta" => "assistants=v2"},
539
549
  body: parsed,
540
550
  model: OpenAI::Beta::Threads::Run,
541
551
  security: {bearer_auth: true},
542
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
552
+ options: options
543
553
  )
544
554
  end
545
555
 
@@ -586,12 +596,16 @@ module OpenAI
586
596
  @client.request(
587
597
  method: :post,
588
598
  path: ["threads/%1$s/runs/%2$s/submit_tool_outputs", thread_id, run_id],
589
- headers: {"accept" => "text/event-stream", "accept-encoding" => "identity"},
599
+ headers: {
600
+ "openai-beta" => "assistants=v2",
601
+ "accept" => "text/event-stream",
602
+ "accept-encoding" => "identity"
603
+ },
590
604
  body: parsed,
591
605
  stream: OpenAI::Internal::Stream,
592
606
  model: OpenAI::Beta::AssistantStreamEvent,
593
607
  security: {bearer_auth: true},
594
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
608
+ options: options
595
609
  )
596
610
  end
597
611
 
@@ -50,10 +50,11 @@ module OpenAI
50
50
  @client.request(
51
51
  method: :post,
52
52
  path: "threads",
53
+ headers: {"openai-beta" => "assistants=v2"},
53
54
  body: parsed,
54
55
  model: OpenAI::Beta::Thread,
55
56
  security: {bearer_auth: true},
56
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
57
+ options: options
57
58
  )
58
59
  end
59
60
 
@@ -75,9 +76,10 @@ module OpenAI
75
76
  @client.request(
76
77
  method: :get,
77
78
  path: ["threads/%1$s", thread_id],
79
+ headers: {"openai-beta" => "assistants=v2"},
78
80
  model: OpenAI::Beta::Thread,
79
81
  security: {bearer_auth: true},
80
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **params[:request_options].to_h}
82
+ options: params[:request_options]
81
83
  )
82
84
  end
83
85
 
@@ -114,10 +116,11 @@ module OpenAI
114
116
  @client.request(
115
117
  method: :post,
116
118
  path: ["threads/%1$s", thread_id],
119
+ headers: {"openai-beta" => "assistants=v2"},
117
120
  body: parsed,
118
121
  model: OpenAI::Beta::Thread,
119
122
  security: {bearer_auth: true},
120
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
123
+ options: options
121
124
  )
122
125
  end
123
126
 
@@ -139,9 +142,10 @@ module OpenAI
139
142
  @client.request(
140
143
  method: :delete,
141
144
  path: ["threads/%1$s", thread_id],
145
+ headers: {"openai-beta" => "assistants=v2"},
142
146
  model: OpenAI::Beta::ThreadDeleted,
143
147
  security: {bearer_auth: true},
144
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **params[:request_options].to_h}
148
+ options: params[:request_options]
145
149
  )
146
150
  end
147
151
 
@@ -272,10 +276,11 @@ module OpenAI
272
276
  @client.request(
273
277
  method: :post,
274
278
  path: "threads/runs",
279
+ headers: {"openai-beta" => "assistants=v2"},
275
280
  body: parsed,
276
281
  model: OpenAI::Beta::Threads::Run,
277
282
  security: {bearer_auth: true},
278
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
283
+ options: options
279
284
  )
280
285
  end
281
286
 
@@ -412,12 +417,16 @@ module OpenAI
412
417
  @client.request(
413
418
  method: :post,
414
419
  path: "threads/runs",
415
- headers: {"accept" => "text/event-stream", "accept-encoding" => "identity"},
420
+ headers: {
421
+ "openai-beta" => "assistants=v2",
422
+ "accept" => "text/event-stream",
423
+ "accept-encoding" => "identity"
424
+ },
416
425
  body: parsed,
417
426
  stream: OpenAI::Internal::Stream,
418
427
  model: OpenAI::Beta::AssistantStreamEvent,
419
428
  security: {bearer_auth: true},
420
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
429
+ options: options
421
430
  )
422
431
  end
423
432
 
@@ -50,16 +50,11 @@ module OpenAI
50
50
  @client.request(
51
51
  method: :post,
52
52
  path: ["vector_stores/%1$s/file_batches", vector_store_id],
53
+ headers: {"openai-beta" => "assistants=v2"},
53
54
  body: parsed,
54
55
  model: OpenAI::VectorStores::VectorStoreFileBatch,
55
56
  security: {bearer_auth: true},
56
- options: {
57
- **options,
58
- extra_headers: OpenAI::Internal::Util.normalized_headers(
59
- {"OpenAI-Beta" => "assistants=v2"},
60
- options[:extra_headers].to_h
61
- )
62
- }
57
+ options: options
63
58
  )
64
59
  end
65
60
 
@@ -144,9 +139,10 @@ module OpenAI
144
139
  @client.request(
145
140
  method: :get,
146
141
  path: ["vector_stores/%1$s/file_batches/%2$s", vector_store_id, batch_id],
142
+ headers: {"openai-beta" => "assistants=v2"},
147
143
  model: OpenAI::VectorStores::VectorStoreFileBatch,
148
144
  security: {bearer_auth: true},
149
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
145
+ options: options
150
146
  )
151
147
  end
152
148
 
@@ -175,9 +171,10 @@ module OpenAI
175
171
  @client.request(
176
172
  method: :post,
177
173
  path: ["vector_stores/%1$s/file_batches/%2$s/cancel", vector_store_id, batch_id],
174
+ headers: {"openai-beta" => "assistants=v2"},
178
175
  model: OpenAI::VectorStores::VectorStoreFileBatch,
179
176
  security: {bearer_auth: true},
180
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
177
+ options: options
181
178
  )
182
179
  end
183
180
 
@@ -231,10 +228,11 @@ module OpenAI
231
228
  method: :get,
232
229
  path: ["vector_stores/%1$s/file_batches/%2$s/files", vector_store_id, batch_id],
233
230
  query: query,
231
+ headers: {"openai-beta" => "assistants=v2"},
234
232
  page: OpenAI::Internal::CursorPage,
235
233
  model: OpenAI::VectorStores::VectorStoreFile,
236
234
  security: {bearer_auth: true},
237
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
235
+ options: options
238
236
  )
239
237
  end
240
238
 
@@ -43,16 +43,11 @@ module OpenAI
43
43
  @client.request(
44
44
  method: :post,
45
45
  path: ["vector_stores/%1$s/files", vector_store_id],
46
+ headers: {"openai-beta" => "assistants=v2"},
46
47
  body: parsed,
47
48
  model: OpenAI::VectorStores::VectorStoreFile,
48
49
  security: {bearer_auth: true},
49
- options: {
50
- **options,
51
- extra_headers: OpenAI::Internal::Util.normalized_headers(
52
- {"OpenAI-Beta" => "assistants=v2"},
53
- options[:extra_headers].to_h
54
- )
55
- }
50
+ options: options
56
51
  )
57
52
  end
58
53
 
@@ -132,9 +127,10 @@ module OpenAI
132
127
  @client.request(
133
128
  method: :get,
134
129
  path: ["vector_stores/%1$s/files/%2$s", vector_store_id, file_id],
130
+ headers: {"openai-beta" => "assistants=v2"},
135
131
  model: OpenAI::VectorStores::VectorStoreFile,
136
132
  security: {bearer_auth: true},
137
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
133
+ options: options
138
134
  )
139
135
  end
140
136
 
@@ -169,10 +165,11 @@ module OpenAI
169
165
  @client.request(
170
166
  method: :post,
171
167
  path: ["vector_stores/%1$s/files/%2$s", vector_store_id, file_id],
168
+ headers: {"openai-beta" => "assistants=v2"},
172
169
  body: parsed,
173
170
  model: OpenAI::VectorStores::VectorStoreFile,
174
171
  security: {bearer_auth: true},
175
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
172
+ options: options
176
173
  )
177
174
  end
178
175
 
@@ -218,10 +215,11 @@ module OpenAI
218
215
  method: :get,
219
216
  path: ["vector_stores/%1$s/files", vector_store_id],
220
217
  query: query,
218
+ headers: {"openai-beta" => "assistants=v2"},
221
219
  page: OpenAI::Internal::CursorPage,
222
220
  model: OpenAI::VectorStores::VectorStoreFile,
223
221
  security: {bearer_auth: true},
224
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
222
+ options: options
225
223
  )
226
224
  end
227
225
 
@@ -252,9 +250,10 @@ module OpenAI
252
250
  @client.request(
253
251
  method: :delete,
254
252
  path: ["vector_stores/%1$s/files/%2$s", vector_store_id, file_id],
253
+ headers: {"openai-beta" => "assistants=v2"},
255
254
  model: OpenAI::VectorStores::VectorStoreFileDeleted,
256
255
  security: {bearer_auth: true},
257
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
256
+ options: options
258
257
  )
259
258
  end
260
259
 
@@ -416,10 +415,11 @@ module OpenAI
416
415
  @client.request(
417
416
  method: :get,
418
417
  path: ["vector_stores/%1$s/files/%2$s/content", vector_store_id, file_id],
418
+ headers: {"openai-beta" => "assistants=v2"},
419
419
  page: OpenAI::Internal::Page,
420
420
  model: OpenAI::Models::VectorStores::FileContentResponse,
421
421
  security: {bearer_auth: true},
422
- options: {extra_headers: {"OpenAI-Beta" => "assistants=v2"}, **options}
422
+ options: options
423
423
  )
424
424
  end
425
425