openai 0.69.0 → 0.71.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/README.md +51 -1
- data/lib/openai/client.rb +62 -8
- data/lib/openai/internal/provider.rb +31 -0
- data/lib/openai/internal/transport/base_client.rb +65 -21
- data/lib/openai/internal/util.rb +1 -1
- data/lib/openai/models/admin/organization/audit_log_list_params.rb +84 -0
- data/lib/openai/models/admin/organization/audit_log_list_response.rb +84 -0
- data/lib/openai/models/admin/organization/projects/api_key_list_params.rb +30 -1
- data/lib/openai/models/admin/organization/projects/project_api_key.rb +23 -1
- data/lib/openai/models/admin/organization/projects/project_service_account.rb +4 -3
- data/lib/openai/models/admin/organization/projects/service_account_create_params.rb +9 -1
- data/lib/openai/models/admin/organization/projects/service_account_create_response.rb +26 -6
- data/lib/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rb +54 -0
- data/lib/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rb +57 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_completions_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_costs_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_images_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +88 -13
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +88 -13
- data/lib/openai/models/beta/beta_response_input_item.rb +16 -32
- data/lib/openai/models/beta/beta_response_reasoning_item.rb +4 -3
- data/lib/openai/models/responses/response_reasoning_item.rb +4 -3
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +1 -4
- data/lib/openai/provider.rb +18 -0
- data/lib/openai/providers/bedrock.rb +489 -0
- data/lib/openai/resources/admin/organization/projects/api_keys.rb +3 -1
- data/lib/openai/resources/admin/organization/projects/service_accounts/api_keys.rb +60 -0
- data/lib/openai/resources/admin/organization/projects/service_accounts.rb +10 -3
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +6 -1
- data/rbi/openai/client.rbi +17 -0
- data/rbi/openai/internal/provider.rbi +51 -0
- data/rbi/openai/internal/transport/base_client.rbi +32 -0
- data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +420 -0
- data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +420 -0
- data/rbi/openai/models/admin/organization/projects/api_key_list_params.rbi +76 -0
- data/rbi/openai/models/admin/organization/projects/project_api_key.rbi +49 -0
- data/rbi/openai/models/admin/organization/projects/project_service_account.rbi +8 -3
- data/rbi/openai/models/admin/organization/projects/service_account_create_params.rbi +8 -0
- data/rbi/openai/models/admin/organization/projects/service_account_create_response.rbi +52 -8
- data/rbi/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rbi +84 -0
- data/rbi/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rbi +80 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +121 -16
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +121 -16
- data/rbi/openai/models/beta/beta_response_input_item.rbi +39 -46
- data/rbi/openai/models/beta/beta_response_reasoning_item.rbi +6 -4
- data/rbi/openai/models/responses/response_reasoning_item.rbi +6 -4
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -2
- data/rbi/openai/provider.rbi +9 -0
- data/rbi/openai/providers.rbi +33 -0
- data/rbi/openai/resources/admin/organization/projects/api_keys.rbi +8 -0
- data/rbi/openai/resources/admin/organization/projects/service_accounts/api_keys.rbi +45 -0
- data/rbi/openai/resources/admin/organization/projects/service_accounts.rbi +12 -2
- data/rbi/openai/resources/webhooks.rbi +1 -2
- data/sig/openai/client.rbs +7 -0
- data/sig/openai/internal/provider.rbs +29 -0
- data/sig/openai/internal/transport/base_client.rbs +17 -1
- data/sig/openai/models/admin/organization/audit_log_list_params.rbs +168 -0
- data/sig/openai/models/admin/organization/audit_log_list_response.rbs +168 -0
- data/sig/openai/models/admin/organization/projects/api_key_list_params.rbs +26 -1
- data/sig/openai/models/admin/organization/projects/project_api_key.rbs +16 -0
- data/sig/openai/models/admin/organization/projects/project_service_account.rbs +2 -1
- data/sig/openai/models/admin/organization/projects/service_account_create_params.rbs +9 -1
- data/sig/openai/models/admin/organization/projects/service_account_create_response.rbs +16 -5
- data/sig/openai/models/admin/organization/projects/service_accounts/api_key_create_params.rbs +53 -0
- data/sig/openai/models/admin/organization/projects/service_accounts/api_key_create_response.rbs +48 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_images_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +63 -0
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +63 -0
- data/sig/openai/models/beta/beta_response_input_item.rbs +18 -24
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +0 -1
- data/sig/openai/provider.rbs +5 -0
- data/sig/openai/providers.rbs +15 -0
- data/sig/openai/resources/admin/organization/projects/api_keys.rbs +1 -0
- data/sig/openai/resources/admin/organization/projects/service_accounts/api_keys.rbs +23 -0
- data/sig/openai/resources/admin/organization/projects/service_accounts.rbs +3 -0
- data/sig/openai/resources/webhooks.rbs +1 -2
- metadata +20 -5
- data/lib/openai/models/webhooks/safety_identifier_blocked_webhook_event.rb +0 -118
- data/rbi/openai/models/webhooks/safety_identifier_blocked_webhook_event.rbi +0 -209
- data/sig/openai/models/webhooks/safety_identifier_blocked_webhook_event.rbs +0 -99
|
@@ -160,8 +160,9 @@ module OpenAI
|
|
|
160
160
|
)
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
-
# The aggregated number of
|
|
164
|
-
#
|
|
163
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
164
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
165
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
165
166
|
sig { returns(Integer) }
|
|
166
167
|
attr_accessor :input_tokens
|
|
167
168
|
|
|
@@ -172,8 +173,9 @@ module OpenAI
|
|
|
172
173
|
sig { returns(Symbol) }
|
|
173
174
|
attr_accessor :object
|
|
174
175
|
|
|
175
|
-
# The aggregated number of
|
|
176
|
-
#
|
|
176
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
177
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
178
|
+
# tokens.
|
|
177
179
|
sig { returns(Integer) }
|
|
178
180
|
attr_accessor :output_tokens
|
|
179
181
|
|
|
@@ -187,22 +189,72 @@ module OpenAI
|
|
|
187
189
|
sig { returns(T.nilable(T::Boolean)) }
|
|
188
190
|
attr_accessor :batch
|
|
189
191
|
|
|
190
|
-
# The aggregated number of audio input tokens used
|
|
192
|
+
# The aggregated number of uncached audio input tokens used.
|
|
191
193
|
sig { returns(T.nilable(Integer)) }
|
|
192
194
|
attr_reader :input_audio_tokens
|
|
193
195
|
|
|
194
196
|
sig { params(input_audio_tokens: Integer).void }
|
|
195
197
|
attr_writer :input_audio_tokens
|
|
196
198
|
|
|
197
|
-
# The aggregated number of
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
# The aggregated number of input tokens written to the cache.
|
|
200
|
+
sig { returns(T.nilable(Integer)) }
|
|
201
|
+
attr_reader :input_cache_write_tokens
|
|
202
|
+
|
|
203
|
+
sig { params(input_cache_write_tokens: Integer).void }
|
|
204
|
+
attr_writer :input_cache_write_tokens
|
|
205
|
+
|
|
206
|
+
# The aggregated number of cached audio input tokens used.
|
|
207
|
+
sig { returns(T.nilable(Integer)) }
|
|
208
|
+
attr_reader :input_cached_audio_tokens
|
|
209
|
+
|
|
210
|
+
sig { params(input_cached_audio_tokens: Integer).void }
|
|
211
|
+
attr_writer :input_cached_audio_tokens
|
|
212
|
+
|
|
213
|
+
# The aggregated number of cached image input tokens used.
|
|
214
|
+
sig { returns(T.nilable(Integer)) }
|
|
215
|
+
attr_reader :input_cached_image_tokens
|
|
216
|
+
|
|
217
|
+
sig { params(input_cached_image_tokens: Integer).void }
|
|
218
|
+
attr_writer :input_cached_image_tokens
|
|
219
|
+
|
|
220
|
+
# The aggregated number of cached text input tokens used.
|
|
221
|
+
sig { returns(T.nilable(Integer)) }
|
|
222
|
+
attr_reader :input_cached_text_tokens
|
|
223
|
+
|
|
224
|
+
sig { params(input_cached_text_tokens: Integer).void }
|
|
225
|
+
attr_writer :input_cached_text_tokens
|
|
226
|
+
|
|
227
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
228
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
200
229
|
sig { returns(T.nilable(Integer)) }
|
|
201
230
|
attr_reader :input_cached_tokens
|
|
202
231
|
|
|
203
232
|
sig { params(input_cached_tokens: Integer).void }
|
|
204
233
|
attr_writer :input_cached_tokens
|
|
205
234
|
|
|
235
|
+
# The aggregated number of uncached image input tokens used.
|
|
236
|
+
sig { returns(T.nilable(Integer)) }
|
|
237
|
+
attr_reader :input_image_tokens
|
|
238
|
+
|
|
239
|
+
sig { params(input_image_tokens: Integer).void }
|
|
240
|
+
attr_writer :input_image_tokens
|
|
241
|
+
|
|
242
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
243
|
+
# tokens.
|
|
244
|
+
sig { returns(T.nilable(Integer)) }
|
|
245
|
+
attr_reader :input_text_tokens
|
|
246
|
+
|
|
247
|
+
sig { params(input_text_tokens: Integer).void }
|
|
248
|
+
attr_writer :input_text_tokens
|
|
249
|
+
|
|
250
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
251
|
+
# image inputs, excluding cache-write tokens.
|
|
252
|
+
sig { returns(T.nilable(Integer)) }
|
|
253
|
+
attr_reader :input_uncached_tokens
|
|
254
|
+
|
|
255
|
+
sig { params(input_uncached_tokens: Integer).void }
|
|
256
|
+
attr_writer :input_uncached_tokens
|
|
257
|
+
|
|
206
258
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
207
259
|
# result.
|
|
208
260
|
sig { returns(T.nilable(String)) }
|
|
@@ -215,6 +267,20 @@ module OpenAI
|
|
|
215
267
|
sig { params(output_audio_tokens: Integer).void }
|
|
216
268
|
attr_writer :output_audio_tokens
|
|
217
269
|
|
|
270
|
+
# The aggregated number of image output tokens used.
|
|
271
|
+
sig { returns(T.nilable(Integer)) }
|
|
272
|
+
attr_reader :output_image_tokens
|
|
273
|
+
|
|
274
|
+
sig { params(output_image_tokens: Integer).void }
|
|
275
|
+
attr_writer :output_image_tokens
|
|
276
|
+
|
|
277
|
+
# The aggregated number of text output tokens used.
|
|
278
|
+
sig { returns(T.nilable(Integer)) }
|
|
279
|
+
attr_reader :output_text_tokens
|
|
280
|
+
|
|
281
|
+
sig { params(output_text_tokens: Integer).void }
|
|
282
|
+
attr_writer :output_text_tokens
|
|
283
|
+
|
|
218
284
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
219
285
|
# usage result.
|
|
220
286
|
sig { returns(T.nilable(String)) }
|
|
@@ -239,9 +305,18 @@ module OpenAI
|
|
|
239
305
|
api_key_id: T.nilable(String),
|
|
240
306
|
batch: T.nilable(T::Boolean),
|
|
241
307
|
input_audio_tokens: Integer,
|
|
308
|
+
input_cache_write_tokens: Integer,
|
|
309
|
+
input_cached_audio_tokens: Integer,
|
|
310
|
+
input_cached_image_tokens: Integer,
|
|
311
|
+
input_cached_text_tokens: Integer,
|
|
242
312
|
input_cached_tokens: Integer,
|
|
313
|
+
input_image_tokens: Integer,
|
|
314
|
+
input_text_tokens: Integer,
|
|
315
|
+
input_uncached_tokens: Integer,
|
|
243
316
|
model: T.nilable(String),
|
|
244
317
|
output_audio_tokens: Integer,
|
|
318
|
+
output_image_tokens: Integer,
|
|
319
|
+
output_text_tokens: Integer,
|
|
245
320
|
project_id: T.nilable(String),
|
|
246
321
|
service_tier: T.nilable(String),
|
|
247
322
|
user_id: T.nilable(String),
|
|
@@ -249,13 +324,15 @@ module OpenAI
|
|
|
249
324
|
).returns(T.attached_class)
|
|
250
325
|
end
|
|
251
326
|
def self.new(
|
|
252
|
-
# The aggregated number of
|
|
253
|
-
#
|
|
327
|
+
# The aggregated number of input tokens used, including cached and cache-write
|
|
328
|
+
# tokens. This includes text, audio, and image tokens. For customers subscribed to
|
|
329
|
+
# Scale Tier, this includes Scale Tier tokens.
|
|
254
330
|
input_tokens:,
|
|
255
331
|
# The count of requests made to the model.
|
|
256
332
|
num_model_requests:,
|
|
257
|
-
# The aggregated number of
|
|
258
|
-
#
|
|
333
|
+
# The aggregated number of output tokens used across text, audio, and image
|
|
334
|
+
# outputs. For customers subscribed to Scale Tier, this includes Scale Tier
|
|
335
|
+
# tokens.
|
|
259
336
|
output_tokens:,
|
|
260
337
|
# When `group_by=api_key_id`, this field provides the API key ID of the grouped
|
|
261
338
|
# usage result.
|
|
@@ -263,17 +340,36 @@ module OpenAI
|
|
|
263
340
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
264
341
|
# batch or not.
|
|
265
342
|
batch: nil,
|
|
266
|
-
# The aggregated number of audio input tokens used
|
|
343
|
+
# The aggregated number of uncached audio input tokens used.
|
|
267
344
|
input_audio_tokens: nil,
|
|
268
|
-
# The aggregated number of
|
|
269
|
-
|
|
270
|
-
# tokens.
|
|
345
|
+
# The aggregated number of input tokens written to the cache.
|
|
346
|
+
input_cache_write_tokens: nil,
|
|
347
|
+
# The aggregated number of cached audio input tokens used.
|
|
348
|
+
input_cached_audio_tokens: nil,
|
|
349
|
+
# The aggregated number of cached image input tokens used.
|
|
350
|
+
input_cached_image_tokens: nil,
|
|
351
|
+
# The aggregated number of cached text input tokens used.
|
|
352
|
+
input_cached_text_tokens: nil,
|
|
353
|
+
# The aggregated number of cached input tokens used across text, audio, and image
|
|
354
|
+
# inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.
|
|
271
355
|
input_cached_tokens: nil,
|
|
356
|
+
# The aggregated number of uncached image input tokens used.
|
|
357
|
+
input_image_tokens: nil,
|
|
358
|
+
# The aggregated number of uncached text input tokens used, excluding cache-write
|
|
359
|
+
# tokens.
|
|
360
|
+
input_text_tokens: nil,
|
|
361
|
+
# The aggregated number of uncached input tokens used across text, audio, and
|
|
362
|
+
# image inputs, excluding cache-write tokens.
|
|
363
|
+
input_uncached_tokens: nil,
|
|
272
364
|
# When `group_by=model`, this field provides the model name of the grouped usage
|
|
273
365
|
# result.
|
|
274
366
|
model: nil,
|
|
275
367
|
# The aggregated number of audio output tokens used.
|
|
276
368
|
output_audio_tokens: nil,
|
|
369
|
+
# The aggregated number of image output tokens used.
|
|
370
|
+
output_image_tokens: nil,
|
|
371
|
+
# The aggregated number of text output tokens used.
|
|
372
|
+
output_text_tokens: nil,
|
|
277
373
|
# When `group_by=project_id`, this field provides the project ID of the grouped
|
|
278
374
|
# usage result.
|
|
279
375
|
project_id: nil,
|
|
@@ -297,9 +393,18 @@ module OpenAI
|
|
|
297
393
|
api_key_id: T.nilable(String),
|
|
298
394
|
batch: T.nilable(T::Boolean),
|
|
299
395
|
input_audio_tokens: Integer,
|
|
396
|
+
input_cache_write_tokens: Integer,
|
|
397
|
+
input_cached_audio_tokens: Integer,
|
|
398
|
+
input_cached_image_tokens: Integer,
|
|
399
|
+
input_cached_text_tokens: Integer,
|
|
300
400
|
input_cached_tokens: Integer,
|
|
401
|
+
input_image_tokens: Integer,
|
|
402
|
+
input_text_tokens: Integer,
|
|
403
|
+
input_uncached_tokens: Integer,
|
|
301
404
|
model: T.nilable(String),
|
|
302
405
|
output_audio_tokens: Integer,
|
|
406
|
+
output_image_tokens: Integer,
|
|
407
|
+
output_text_tokens: Integer,
|
|
303
408
|
project_id: T.nilable(String),
|
|
304
409
|
service_tier: T.nilable(String),
|
|
305
410
|
user_id: T.nilable(String)
|
|
@@ -1525,7 +1525,13 @@ module OpenAI
|
|
|
1525
1525
|
sig do
|
|
1526
1526
|
returns(
|
|
1527
1527
|
T.nilable(
|
|
1528
|
-
|
|
1528
|
+
T::Array[
|
|
1529
|
+
T.any(
|
|
1530
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation,
|
|
1531
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation,
|
|
1532
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation
|
|
1533
|
+
)
|
|
1534
|
+
]
|
|
1529
1535
|
)
|
|
1530
1536
|
)
|
|
1531
1537
|
end
|
|
@@ -1534,7 +1540,13 @@ module OpenAI
|
|
|
1534
1540
|
sig do
|
|
1535
1541
|
params(
|
|
1536
1542
|
annotations:
|
|
1537
|
-
|
|
1543
|
+
T::Array[
|
|
1544
|
+
T.any(
|
|
1545
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation::OrHash,
|
|
1546
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation::OrHash,
|
|
1547
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation::OrHash
|
|
1548
|
+
)
|
|
1549
|
+
]
|
|
1538
1550
|
).void
|
|
1539
1551
|
end
|
|
1540
1552
|
attr_writer :annotations
|
|
@@ -1543,7 +1555,13 @@ module OpenAI
|
|
|
1543
1555
|
params(
|
|
1544
1556
|
text: String,
|
|
1545
1557
|
annotations:
|
|
1546
|
-
|
|
1558
|
+
T::Array[
|
|
1559
|
+
T.any(
|
|
1560
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation::OrHash,
|
|
1561
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation::OrHash,
|
|
1562
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation::OrHash
|
|
1563
|
+
)
|
|
1564
|
+
],
|
|
1547
1565
|
type: Symbol
|
|
1548
1566
|
).returns(T.attached_class)
|
|
1549
1567
|
end
|
|
@@ -1563,37 +1581,36 @@ module OpenAI
|
|
|
1563
1581
|
text: String,
|
|
1564
1582
|
type: Symbol,
|
|
1565
1583
|
annotations:
|
|
1566
|
-
|
|
1584
|
+
T::Array[
|
|
1585
|
+
T.any(
|
|
1586
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation,
|
|
1587
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation,
|
|
1588
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation
|
|
1589
|
+
)
|
|
1590
|
+
]
|
|
1567
1591
|
}
|
|
1568
1592
|
)
|
|
1569
1593
|
end
|
|
1570
1594
|
def to_hash
|
|
1571
1595
|
end
|
|
1572
1596
|
|
|
1573
|
-
|
|
1574
|
-
module Annotations
|
|
1597
|
+
module Annotation
|
|
1575
1598
|
extend OpenAI::Internal::Type::Union
|
|
1576
1599
|
|
|
1577
1600
|
Variants =
|
|
1578
1601
|
T.type_alias do
|
|
1579
1602
|
T.any(
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
T::Array[
|
|
1584
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotations::UnionMember1
|
|
1585
|
-
],
|
|
1586
|
-
T::Array[
|
|
1587
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotations::UnionMember2
|
|
1588
|
-
]
|
|
1603
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation,
|
|
1604
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation,
|
|
1605
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation
|
|
1589
1606
|
)
|
|
1590
1607
|
end
|
|
1591
1608
|
|
|
1592
|
-
class
|
|
1609
|
+
class FileCitation < OpenAI::Internal::Type::BaseModel
|
|
1593
1610
|
OrHash =
|
|
1594
1611
|
T.type_alias do
|
|
1595
1612
|
T.any(
|
|
1596
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::
|
|
1613
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation,
|
|
1597
1614
|
OpenAI::Internal::AnyHash
|
|
1598
1615
|
)
|
|
1599
1616
|
end
|
|
@@ -1648,11 +1665,11 @@ module OpenAI
|
|
|
1648
1665
|
end
|
|
1649
1666
|
end
|
|
1650
1667
|
|
|
1651
|
-
class
|
|
1668
|
+
class URLCitation < OpenAI::Internal::Type::BaseModel
|
|
1652
1669
|
OrHash =
|
|
1653
1670
|
T.type_alias do
|
|
1654
1671
|
T.any(
|
|
1655
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::
|
|
1672
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation,
|
|
1656
1673
|
OpenAI::Internal::AnyHash
|
|
1657
1674
|
)
|
|
1658
1675
|
end
|
|
@@ -1715,11 +1732,11 @@ module OpenAI
|
|
|
1715
1732
|
end
|
|
1716
1733
|
end
|
|
1717
1734
|
|
|
1718
|
-
class
|
|
1735
|
+
class ContainerFileCitation < OpenAI::Internal::Type::BaseModel
|
|
1719
1736
|
OrHash =
|
|
1720
1737
|
T.type_alias do
|
|
1721
1738
|
T.any(
|
|
1722
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::
|
|
1739
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation,
|
|
1723
1740
|
OpenAI::Internal::AnyHash
|
|
1724
1741
|
)
|
|
1725
1742
|
end
|
|
@@ -1793,36 +1810,12 @@ module OpenAI
|
|
|
1793
1810
|
sig do
|
|
1794
1811
|
override.returns(
|
|
1795
1812
|
T::Array[
|
|
1796
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::
|
|
1813
|
+
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::Variants
|
|
1797
1814
|
]
|
|
1798
1815
|
)
|
|
1799
1816
|
end
|
|
1800
1817
|
def self.variants
|
|
1801
1818
|
end
|
|
1802
|
-
|
|
1803
|
-
UnionMember0Array =
|
|
1804
|
-
T.let(
|
|
1805
|
-
OpenAI::Internal::Type::ArrayOf[
|
|
1806
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotations::UnionMember0
|
|
1807
|
-
],
|
|
1808
|
-
OpenAI::Internal::Type::Converter
|
|
1809
|
-
)
|
|
1810
|
-
|
|
1811
|
-
UnionMember1Array =
|
|
1812
|
-
T.let(
|
|
1813
|
-
OpenAI::Internal::Type::ArrayOf[
|
|
1814
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotations::UnionMember1
|
|
1815
|
-
],
|
|
1816
|
-
OpenAI::Internal::Type::Converter
|
|
1817
|
-
)
|
|
1818
|
-
|
|
1819
|
-
UnionMember2Array =
|
|
1820
|
-
T.let(
|
|
1821
|
-
OpenAI::Internal::Type::ArrayOf[
|
|
1822
|
-
OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotations::UnionMember2
|
|
1823
|
-
],
|
|
1824
|
-
OpenAI::Internal::Type::Converter
|
|
1825
|
-
)
|
|
1826
1819
|
end
|
|
1827
1820
|
end
|
|
1828
1821
|
|
|
@@ -60,8 +60,9 @@ module OpenAI
|
|
|
60
60
|
end
|
|
61
61
|
attr_writer :content
|
|
62
62
|
|
|
63
|
-
# The encrypted content of the reasoning item
|
|
64
|
-
#
|
|
63
|
+
# The encrypted content of the reasoning item. This is populated by default for
|
|
64
|
+
# reasoning items returned by `POST /v1/responses` and WebSocket `response.create`
|
|
65
|
+
# requests.
|
|
65
66
|
sig { returns(T.nilable(String)) }
|
|
66
67
|
attr_accessor :encrypted_content
|
|
67
68
|
|
|
@@ -112,8 +113,9 @@ module OpenAI
|
|
|
112
113
|
agent: nil,
|
|
113
114
|
# Reasoning text content.
|
|
114
115
|
content: nil,
|
|
115
|
-
# The encrypted content of the reasoning item
|
|
116
|
-
#
|
|
116
|
+
# The encrypted content of the reasoning item. This is populated by default for
|
|
117
|
+
# reasoning items returned by `POST /v1/responses` and WebSocket `response.create`
|
|
118
|
+
# requests.
|
|
117
119
|
encrypted_content: nil,
|
|
118
120
|
# The status of the item. One of `in_progress`, `completed`, or `incomplete`.
|
|
119
121
|
# Populated when items are returned via API.
|
|
@@ -46,8 +46,9 @@ module OpenAI
|
|
|
46
46
|
end
|
|
47
47
|
attr_writer :content
|
|
48
48
|
|
|
49
|
-
# The encrypted content of the reasoning item
|
|
50
|
-
#
|
|
49
|
+
# The encrypted content of the reasoning item. This is populated by default for
|
|
50
|
+
# reasoning items returned by `POST /v1/responses` and WebSocket `response.create`
|
|
51
|
+
# requests.
|
|
51
52
|
sig { returns(T.nilable(String)) }
|
|
52
53
|
attr_accessor :encrypted_content
|
|
53
54
|
|
|
@@ -96,8 +97,9 @@ module OpenAI
|
|
|
96
97
|
summary:,
|
|
97
98
|
# Reasoning text content.
|
|
98
99
|
content: nil,
|
|
99
|
-
# The encrypted content of the reasoning item
|
|
100
|
-
#
|
|
100
|
+
# The encrypted content of the reasoning item. This is populated by default for
|
|
101
|
+
# reasoning items returned by `POST /v1/responses` and WebSocket `response.create`
|
|
102
|
+
# requests.
|
|
101
103
|
encrypted_content: nil,
|
|
102
104
|
# The status of the item. One of `in_progress`, `completed`, or `incomplete`.
|
|
103
105
|
# Populated when items are returned via API.
|
|
@@ -24,8 +24,7 @@ module OpenAI
|
|
|
24
24
|
OpenAI::Webhooks::ResponseCancelledWebhookEvent,
|
|
25
25
|
OpenAI::Webhooks::ResponseCompletedWebhookEvent,
|
|
26
26
|
OpenAI::Webhooks::ResponseFailedWebhookEvent,
|
|
27
|
-
OpenAI::Webhooks::ResponseIncompleteWebhookEvent
|
|
28
|
-
OpenAI::Webhooks::SafetyIdentifierBlockedWebhookEvent
|
|
27
|
+
OpenAI::Webhooks::ResponseIncompleteWebhookEvent
|
|
29
28
|
)
|
|
30
29
|
end
|
|
31
30
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Providers
|
|
5
|
+
class << self
|
|
6
|
+
sig do
|
|
7
|
+
params(
|
|
8
|
+
region: T.nilable(String),
|
|
9
|
+
base_url: T.nilable(String),
|
|
10
|
+
api_key: T.nilable(String),
|
|
11
|
+
token_provider: T.nilable(T.proc.returns(String)),
|
|
12
|
+
access_key_id: T.nilable(String),
|
|
13
|
+
secret_access_key: T.nilable(String),
|
|
14
|
+
session_token: T.nilable(String),
|
|
15
|
+
profile: T.nilable(String),
|
|
16
|
+
credentials_provider: T.untyped
|
|
17
|
+
).returns(OpenAI::Provider)
|
|
18
|
+
end
|
|
19
|
+
def bedrock(
|
|
20
|
+
region: nil,
|
|
21
|
+
base_url: nil,
|
|
22
|
+
api_key: nil,
|
|
23
|
+
token_provider: nil,
|
|
24
|
+
access_key_id: nil,
|
|
25
|
+
secret_access_key: nil,
|
|
26
|
+
session_token: nil,
|
|
27
|
+
profile: nil,
|
|
28
|
+
credentials_provider: nil
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -29,6 +29,8 @@ module OpenAI
|
|
|
29
29
|
project_id: String,
|
|
30
30
|
after: String,
|
|
31
31
|
limit: Integer,
|
|
32
|
+
owner_project_access:
|
|
33
|
+
OpenAI::Admin::Organization::Projects::APIKeyListParams::OwnerProjectAccess::OrSymbol,
|
|
32
34
|
request_options: OpenAI::RequestOptions::OrHash
|
|
33
35
|
).returns(
|
|
34
36
|
OpenAI::Internal::ConversationCursorPage[
|
|
@@ -47,6 +49,12 @@ module OpenAI
|
|
|
47
49
|
# A limit on the number of objects to be returned. Limit can range between 1 and
|
|
48
50
|
# 100, and the default is 20.
|
|
49
51
|
limit: nil,
|
|
52
|
+
# Filter API keys by whether the owner currently has effective access to the
|
|
53
|
+
# project. Use `active` for owners with access, `inactive` for owners without
|
|
54
|
+
# access, or `any` for all enabled project API keys. If omitted, the endpoint
|
|
55
|
+
# applies its existing membership-based visibility rules, which may exclude some
|
|
56
|
+
# enabled keys.
|
|
57
|
+
owner_project_access: nil,
|
|
50
58
|
request_options: {}
|
|
51
59
|
)
|
|
52
60
|
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Admin
|
|
6
|
+
class Organization
|
|
7
|
+
class Projects
|
|
8
|
+
class ServiceAccounts
|
|
9
|
+
class APIKeys
|
|
10
|
+
# Creates an API key for a service account in the project.
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
service_account_id: String,
|
|
14
|
+
project_id: String,
|
|
15
|
+
name: String,
|
|
16
|
+
scopes: T::Array[String],
|
|
17
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
18
|
+
).returns(
|
|
19
|
+
OpenAI::Models::Admin::Organization::Projects::ServiceAccounts::APIKeyCreateResponse
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def create(
|
|
23
|
+
# Path param: The ID of the service account.
|
|
24
|
+
service_account_id,
|
|
25
|
+
# Path param: The ID of the project.
|
|
26
|
+
project_id:,
|
|
27
|
+
# Body param: API key name.
|
|
28
|
+
name: nil,
|
|
29
|
+
# Body param: API key scopes.
|
|
30
|
+
scopes: nil,
|
|
31
|
+
request_options: {}
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @api private
|
|
36
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
37
|
+
def self.new(client:)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -6,12 +6,20 @@ module OpenAI
|
|
|
6
6
|
class Organization
|
|
7
7
|
class Projects
|
|
8
8
|
class ServiceAccounts
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
sig do
|
|
10
|
+
returns(
|
|
11
|
+
OpenAI::Resources::Admin::Organization::Projects::ServiceAccounts::APIKeys
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
attr_reader :api_keys
|
|
15
|
+
|
|
16
|
+
# Creates a new service account in the project. By default, this also returns an
|
|
17
|
+
# unredacted API key for the service account.
|
|
11
18
|
sig do
|
|
12
19
|
params(
|
|
13
20
|
project_id: String,
|
|
14
21
|
name: String,
|
|
22
|
+
create_service_account_only: T.nilable(T::Boolean),
|
|
15
23
|
request_options: OpenAI::RequestOptions::OrHash
|
|
16
24
|
).returns(
|
|
17
25
|
OpenAI::Models::Admin::Organization::Projects::ServiceAccountCreateResponse
|
|
@@ -22,6 +30,8 @@ module OpenAI
|
|
|
22
30
|
project_id,
|
|
23
31
|
# The name of the service account being created.
|
|
24
32
|
name:,
|
|
33
|
+
# Create the service account without default roles or an API key.
|
|
34
|
+
create_service_account_only: nil,
|
|
25
35
|
request_options: {}
|
|
26
36
|
)
|
|
27
37
|
end
|
|
@@ -25,8 +25,7 @@ module OpenAI
|
|
|
25
25
|
OpenAI::Webhooks::ResponseCancelledWebhookEvent,
|
|
26
26
|
OpenAI::Webhooks::ResponseCompletedWebhookEvent,
|
|
27
27
|
OpenAI::Webhooks::ResponseFailedWebhookEvent,
|
|
28
|
-
OpenAI::Webhooks::ResponseIncompleteWebhookEvent
|
|
29
|
-
OpenAI::Webhooks::SafetyIdentifierBlockedWebhookEvent
|
|
28
|
+
OpenAI::Webhooks::ResponseIncompleteWebhookEvent
|
|
30
29
|
)
|
|
31
30
|
)
|
|
32
31
|
end
|
data/sig/openai/client.rbs
CHANGED
|
@@ -74,6 +74,12 @@ module OpenAI
|
|
|
74
74
|
|
|
75
75
|
private def admin_api_key_auth: -> ::Hash[String, String]
|
|
76
76
|
|
|
77
|
+
private def prepare_request: (
|
|
78
|
+
OpenAI::Internal::Transport::BaseClient::request_input request,
|
|
79
|
+
redirect_count: Integer,
|
|
80
|
+
retry_count: Integer
|
|
81
|
+
) -> OpenAI::Internal::Transport::BaseClient::request_input
|
|
82
|
+
|
|
77
83
|
def initialize: (
|
|
78
84
|
?api_key: String?,
|
|
79
85
|
?admin_api_key: String?,
|
|
@@ -81,6 +87,7 @@ module OpenAI
|
|
|
81
87
|
?organization: String?,
|
|
82
88
|
?project: String?,
|
|
83
89
|
?webhook_secret: String?,
|
|
90
|
+
?provider: OpenAI::Provider?,
|
|
84
91
|
?base_url: String?,
|
|
85
92
|
?max_retries: Integer,
|
|
86
93
|
?timeout: Float,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module OpenAI
|
|
2
|
+
module Internal
|
|
3
|
+
module Provider
|
|
4
|
+
class Runtime
|
|
5
|
+
attr_accessor name: String
|
|
6
|
+
attr_accessor base_url: String
|
|
7
|
+
attr_accessor prepare_request: (^(
|
|
8
|
+
OpenAI::Internal::Transport::BaseClient::request_input
|
|
9
|
+
) -> OpenAI::Internal::Transport::BaseClient::request_input)?
|
|
10
|
+
|
|
11
|
+
def initialize: (
|
|
12
|
+
name: String,
|
|
13
|
+
base_url: String,
|
|
14
|
+
prepare_request: (^(
|
|
15
|
+
OpenAI::Internal::Transport::BaseClient::request_input
|
|
16
|
+
) -> OpenAI::Internal::Transport::BaseClient::request_input)?
|
|
17
|
+
) -> void
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.create: (
|
|
21
|
+
untyped definition
|
|
22
|
+
) -> OpenAI::Provider
|
|
23
|
+
def self.name: (OpenAI::Provider provider) -> String
|
|
24
|
+
def self.configure: (
|
|
25
|
+
OpenAI::Provider provider
|
|
26
|
+
) -> OpenAI::Internal::Provider::Runtime
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|