openai 0.98.0 → 0.100.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 +26 -0
- data/README.md +1 -1
- data/bedrock.md +17 -1
- data/lib/openai/client.rb +9 -0
- data/lib/openai/helpers/agents/session_stream.rb +11 -36
- data/lib/openai/helpers/agents/tools.rb +34 -4
- data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
- data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
- data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_images_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +140 -5
- data/lib/openai/models/all_models.rb +42 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/audio/voice.rb +75 -0
- data/lib/openai/models/audio/voice_create_params.rb +217 -0
- data/lib/openai/models/beta/agent_create_params.rb +0 -3
- data/lib/openai/models/beta/agent_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
- data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
- data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_error.rb +12 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +15 -18
- data/lib/openai/models/beta/environment_param.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +220 -0
- data/lib/openai/models/beta/response_create_params.rb +220 -0
- data/lib/openai/models/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/error_object.rb +12 -1
- data/lib/openai/models/eval_create_params.rb +1 -1
- data/lib/openai/models/eval_create_response.rb +1 -1
- data/lib/openai/models/eval_list_response.rb +1 -1
- data/lib/openai/models/eval_retrieve_response.rb +1 -1
- data/lib/openai/models/eval_update_response.rb +1 -1
- data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
- data/lib/openai/models/graders/score_model_grader.rb +2 -2
- data/lib/openai/models/image.rb +14 -14
- data/lib/openai/models/image_create_variation_params.rb +7 -7
- data/lib/openai/models/image_edit_params.rb +88 -96
- data/lib/openai/models/image_generate_params.rb +51 -62
- data/lib/openai/models/image_model.rb +5 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
- data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/realtime/session_update_event.rb +16 -0
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/responses/response_error.rb +12 -1
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +15 -18
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/video_create_error.rb +12 -1
- data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
- data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
- data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
- data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
- data/lib/openai/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- data/lib/openai/resources/audio/speech.rb +2 -0
- data/lib/openai/resources/audio/voices.rb +53 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -2
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +79 -109
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +10 -0
- data/rbi/openai/helpers/agents.rbi +2 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
- data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
- data/rbi/openai/helpers/beta/agents.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +213 -3
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
- data/rbi/openai/models/audio/voice.rbi +111 -0
- data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
- data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +15 -18
- data/rbi/openai/models/beta/environment_param.rbi +6 -6
- data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
- data/rbi/openai/models/error_object.rbi +12 -0
- data/rbi/openai/models/eval_create_params.rbi +1 -1
- data/rbi/openai/models/eval_create_response.rbi +1 -1
- data/rbi/openai/models/eval_list_response.rbi +1 -1
- data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
- data/rbi/openai/models/eval_update_response.rbi +1 -1
- data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
- data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
- data/rbi/openai/models/image.rbi +14 -14
- data/rbi/openai/models/image_create_variation_params.rbi +6 -6
- data/rbi/openai/models/image_edit_params.rbi +73 -91
- data/rbi/openai/models/image_generate_params.rbi +30 -61
- data/rbi/openai/models/image_model.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
- data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
- data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/responses/response_error.rbi +12 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +15 -18
- data/rbi/openai/models/video_create_error.rbi +12 -0
- data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
- data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
- data/rbi/openai/resources/audio/speech.rbi +2 -0
- data/rbi/openai/resources/audio/voices.rbi +49 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
- data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
- data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +77 -109
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/helpers/agents.rbs +3 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
- data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
- data/sig/openai/helpers/beta/agents.rbs +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_images_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +107 -5
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/audio/voice.rbs +70 -0
- data/sig/openai/models/audio/voice_create_params.rbs +203 -0
- data/sig/openai/models/beta/agent_create_params.rbs +1 -5
- data/sig/openai/models/beta/agent_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
- data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
- data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +10 -0
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +11 -15
- data/sig/openai/models/beta/environment_param.rbs +4 -4
- data/sig/openai/models/beta/session_turn_error.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
- data/sig/openai/models/error_object.rbs +10 -0
- data/sig/openai/models/eval_create_params.rbs +1 -1
- data/sig/openai/models/eval_create_response.rbs +1 -1
- data/sig/openai/models/eval_list_response.rbs +1 -1
- data/sig/openai/models/eval_retrieve_response.rbs +1 -1
- data/sig/openai/models/eval_update_response.rbs +1 -1
- data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
- data/sig/openai/models/graders/score_model_grader.rbs +3 -3
- data/sig/openai/models/image.rbs +21 -21
- data/sig/openai/models/image_create_variation_params.rbs +4 -4
- data/sig/openai/models/image_edit_params.rbs +54 -66
- data/sig/openai/models/image_generate_params.rbs +23 -45
- data/sig/openai/models/image_model.rbs +6 -6
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
- data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +10 -0
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +11 -15
- data/sig/openai/models/video_create_error.rbs +10 -0
- data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
- data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
- data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
- data/sig/openai/resources/audio/voices.rbs +14 -0
- data/sig/openai/resources/audio.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
- data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +35 -1
|
@@ -198,6 +198,19 @@ module OpenAI
|
|
|
198
198
|
sig { returns(T.nilable(String)) }
|
|
199
199
|
attr_accessor :api_key_id
|
|
200
200
|
|
|
201
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
202
|
+
# activity and `unlabeled` includes all records without published source
|
|
203
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
204
|
+
# direct API usage. Without source grouping, this field is null.
|
|
205
|
+
sig {
|
|
206
|
+
returns(
|
|
207
|
+
T.nilable(
|
|
208
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
209
|
+
)
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
attr_accessor :api_source
|
|
213
|
+
|
|
201
214
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
202
215
|
# batch or not.
|
|
203
216
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -210,7 +223,16 @@ module OpenAI
|
|
|
210
223
|
sig { params(input_audio_tokens: Integer).void }
|
|
211
224
|
attr_writer :input_audio_tokens
|
|
212
225
|
|
|
213
|
-
# The aggregated number of input tokens written to the cache
|
|
226
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
227
|
+
# retention period.
|
|
228
|
+
sig { returns(T.nilable(Integer)) }
|
|
229
|
+
attr_reader :input_cache_write_12h_tokens
|
|
230
|
+
|
|
231
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
232
|
+
attr_writer :input_cache_write_12h_tokens
|
|
233
|
+
|
|
234
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
235
|
+
# retention period.
|
|
214
236
|
sig { returns(T.nilable(Integer)) }
|
|
215
237
|
attr_reader :input_cache_write_tokens
|
|
216
238
|
|
|
@@ -322,10 +344,16 @@ module OpenAI
|
|
|
322
344
|
|
|
323
345
|
api_key_id: T.nilable(String),
|
|
324
346
|
|
|
347
|
+
api_source: T.nilable(
|
|
348
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::OrSymbol
|
|
349
|
+
),
|
|
350
|
+
|
|
325
351
|
batch: T.nilable(T::Boolean),
|
|
326
352
|
|
|
327
353
|
input_audio_tokens: Integer,
|
|
328
354
|
|
|
355
|
+
input_cache_write_12h_tokens: Integer,
|
|
356
|
+
|
|
329
357
|
input_cache_write_tokens: Integer,
|
|
330
358
|
|
|
331
359
|
input_cached_audio_tokens: Integer,
|
|
@@ -379,6 +407,12 @@ module OpenAI
|
|
|
379
407
|
# usage result.
|
|
380
408
|
api_key_id: nil,
|
|
381
409
|
|
|
410
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
411
|
+
# activity and `unlabeled` includes all records without published source
|
|
412
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
413
|
+
# direct API usage. Without source grouping, this field is null.
|
|
414
|
+
api_source: nil,
|
|
415
|
+
|
|
382
416
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
383
417
|
# batch or not.
|
|
384
418
|
batch: nil,
|
|
@@ -386,7 +420,12 @@ module OpenAI
|
|
|
386
420
|
# The aggregated number of uncached audio input tokens used.
|
|
387
421
|
input_audio_tokens: nil,
|
|
388
422
|
|
|
389
|
-
# The aggregated number of input tokens written to the cache
|
|
423
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
424
|
+
# retention period.
|
|
425
|
+
input_cache_write_12h_tokens: nil,
|
|
426
|
+
|
|
427
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
428
|
+
# retention period.
|
|
390
429
|
input_cache_write_tokens: nil,
|
|
391
430
|
|
|
392
431
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -450,8 +489,12 @@ module OpenAI
|
|
|
450
489
|
object: Symbol,
|
|
451
490
|
output_tokens: Integer,
|
|
452
491
|
api_key_id: T.nilable(String),
|
|
492
|
+
api_source: T.nilable(
|
|
493
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
494
|
+
),
|
|
453
495
|
batch: T.nilable(T::Boolean),
|
|
454
496
|
input_audio_tokens: Integer,
|
|
497
|
+
input_cache_write_12h_tokens: Integer,
|
|
455
498
|
input_cache_write_tokens: Integer,
|
|
456
499
|
input_cached_audio_tokens: Integer,
|
|
457
500
|
input_cached_image_tokens: Integer,
|
|
@@ -473,6 +516,40 @@ module OpenAI
|
|
|
473
516
|
def to_hash
|
|
474
517
|
end
|
|
475
518
|
|
|
519
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
520
|
+
# activity and `unlabeled` includes all records without published source
|
|
521
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
522
|
+
# direct API usage. Without source grouping, this field is null.
|
|
523
|
+
module APISource
|
|
524
|
+
extend OpenAI::Internal::Type::Enum
|
|
525
|
+
|
|
526
|
+
TaggedSymbol = T.type_alias {
|
|
527
|
+
T.all(
|
|
528
|
+
Symbol,
|
|
529
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource
|
|
530
|
+
)
|
|
531
|
+
}
|
|
532
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
533
|
+
|
|
534
|
+
AGENTS_API = T.let(
|
|
535
|
+
:agents_api,
|
|
536
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
UNLABELED = T.let(
|
|
539
|
+
:unlabeled,
|
|
540
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
sig {
|
|
544
|
+
override.returns(
|
|
545
|
+
T::Array[
|
|
546
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
547
|
+
]
|
|
548
|
+
)
|
|
549
|
+
}
|
|
550
|
+
def self.values
|
|
551
|
+
end
|
|
552
|
+
end
|
|
476
553
|
end
|
|
477
554
|
|
|
478
555
|
class OrganizationUsageEmbeddingsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1254,6 +1331,19 @@ module OpenAI
|
|
|
1254
1331
|
sig { returns(T.nilable(String)) }
|
|
1255
1332
|
attr_accessor :api_key_id
|
|
1256
1333
|
|
|
1334
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1335
|
+
# activity and `unlabeled` includes all records without published source
|
|
1336
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1337
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1338
|
+
sig {
|
|
1339
|
+
returns(
|
|
1340
|
+
T.nilable(
|
|
1341
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1342
|
+
)
|
|
1343
|
+
)
|
|
1344
|
+
}
|
|
1345
|
+
attr_accessor :api_source
|
|
1346
|
+
|
|
1257
1347
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1258
1348
|
# the grouped usage result.
|
|
1259
1349
|
sig { returns(T.nilable(String)) }
|
|
@@ -1284,6 +1374,10 @@ module OpenAI
|
|
|
1284
1374
|
|
|
1285
1375
|
api_key_id: T.nilable(String),
|
|
1286
1376
|
|
|
1377
|
+
api_source: T.nilable(
|
|
1378
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::OrSymbol
|
|
1379
|
+
),
|
|
1380
|
+
|
|
1287
1381
|
context_level: T.nilable(String),
|
|
1288
1382
|
|
|
1289
1383
|
model: T.nilable(String),
|
|
@@ -1308,6 +1402,12 @@ module OpenAI
|
|
|
1308
1402
|
# usage result.
|
|
1309
1403
|
api_key_id: nil,
|
|
1310
1404
|
|
|
1405
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1406
|
+
# activity and `unlabeled` includes all records without published source
|
|
1407
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1408
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1409
|
+
api_source: nil,
|
|
1410
|
+
|
|
1311
1411
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1312
1412
|
# the grouped usage result.
|
|
1313
1413
|
context_level: nil,
|
|
@@ -1335,6 +1435,9 @@ module OpenAI
|
|
|
1335
1435
|
num_requests: Integer,
|
|
1336
1436
|
object: Symbol,
|
|
1337
1437
|
api_key_id: T.nilable(String),
|
|
1438
|
+
api_source: T.nilable(
|
|
1439
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1440
|
+
),
|
|
1338
1441
|
context_level: T.nilable(String),
|
|
1339
1442
|
model: T.nilable(String),
|
|
1340
1443
|
project_id: T.nilable(String),
|
|
@@ -1345,6 +1448,40 @@ module OpenAI
|
|
|
1345
1448
|
def to_hash
|
|
1346
1449
|
end
|
|
1347
1450
|
|
|
1451
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1452
|
+
# activity and `unlabeled` includes all records without published source
|
|
1453
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1454
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1455
|
+
module APISource
|
|
1456
|
+
extend OpenAI::Internal::Type::Enum
|
|
1457
|
+
|
|
1458
|
+
TaggedSymbol = T.type_alias {
|
|
1459
|
+
T.all(
|
|
1460
|
+
Symbol,
|
|
1461
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource
|
|
1462
|
+
)
|
|
1463
|
+
}
|
|
1464
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1465
|
+
|
|
1466
|
+
AGENTS_API = T.let(
|
|
1467
|
+
:agents_api,
|
|
1468
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1469
|
+
)
|
|
1470
|
+
UNLABELED = T.let(
|
|
1471
|
+
:unlabeled,
|
|
1472
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1473
|
+
)
|
|
1474
|
+
|
|
1475
|
+
sig {
|
|
1476
|
+
override.returns(
|
|
1477
|
+
T::Array[
|
|
1478
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1479
|
+
]
|
|
1480
|
+
)
|
|
1481
|
+
}
|
|
1482
|
+
def self.values
|
|
1483
|
+
end
|
|
1484
|
+
end
|
|
1348
1485
|
end
|
|
1349
1486
|
|
|
1350
1487
|
class OrganizationCostsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1381,6 +1518,19 @@ module OpenAI
|
|
|
1381
1518
|
sig { returns(T.nilable(String)) }
|
|
1382
1519
|
attr_accessor :api_key_id
|
|
1383
1520
|
|
|
1521
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1522
|
+
# activity and `unlabeled` includes all records without published source
|
|
1523
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1524
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1525
|
+
sig {
|
|
1526
|
+
returns(
|
|
1527
|
+
T.nilable(
|
|
1528
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1529
|
+
)
|
|
1530
|
+
)
|
|
1531
|
+
}
|
|
1532
|
+
attr_accessor :api_source
|
|
1533
|
+
|
|
1384
1534
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1385
1535
|
# costs result.
|
|
1386
1536
|
sig { returns(T.nilable(String)) }
|
|
@@ -1401,6 +1551,11 @@ module OpenAI
|
|
|
1401
1551
|
sig { returns(T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))) }
|
|
1402
1552
|
attr_accessor :quantity_unit
|
|
1403
1553
|
|
|
1554
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1555
|
+
# result.
|
|
1556
|
+
sig { returns(T.nilable(String)) }
|
|
1557
|
+
attr_accessor :user_id
|
|
1558
|
+
|
|
1404
1559
|
# The aggregated costs details of the specific time bucket.
|
|
1405
1560
|
sig do
|
|
1406
1561
|
params(
|
|
@@ -1409,6 +1564,10 @@ module OpenAI
|
|
|
1409
1564
|
|
|
1410
1565
|
api_key_id: T.nilable(String),
|
|
1411
1566
|
|
|
1567
|
+
api_source: T.nilable(
|
|
1568
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource::OrSymbol
|
|
1569
|
+
),
|
|
1570
|
+
|
|
1412
1571
|
line_item: T.nilable(String),
|
|
1413
1572
|
|
|
1414
1573
|
project_id: T.nilable(String),
|
|
@@ -1417,6 +1576,8 @@ module OpenAI
|
|
|
1417
1576
|
|
|
1418
1577
|
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1419
1578
|
|
|
1579
|
+
user_id: T.nilable(String),
|
|
1580
|
+
|
|
1420
1581
|
object: Symbol
|
|
1421
1582
|
)
|
|
1422
1583
|
.returns(T.attached_class)
|
|
@@ -1430,6 +1591,12 @@ module OpenAI
|
|
|
1430
1591
|
# costs result.
|
|
1431
1592
|
api_key_id: nil,
|
|
1432
1593
|
|
|
1594
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1595
|
+
# activity and `unlabeled` includes all records without published source
|
|
1596
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1597
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1598
|
+
api_source: nil,
|
|
1599
|
+
|
|
1433
1600
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1434
1601
|
# costs result.
|
|
1435
1602
|
line_item: nil,
|
|
@@ -1446,6 +1613,10 @@ module OpenAI
|
|
|
1446
1613
|
# result, this field is `null`.
|
|
1447
1614
|
quantity_unit: nil,
|
|
1448
1615
|
|
|
1616
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1617
|
+
# result.
|
|
1618
|
+
user_id: nil,
|
|
1619
|
+
|
|
1449
1620
|
object: :"organization.costs.result"
|
|
1450
1621
|
)
|
|
1451
1622
|
end
|
|
@@ -1456,10 +1627,14 @@ module OpenAI
|
|
|
1456
1627
|
object: Symbol,
|
|
1457
1628
|
amount: OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::Amount,
|
|
1458
1629
|
api_key_id: T.nilable(String),
|
|
1630
|
+
api_source: T.nilable(
|
|
1631
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1632
|
+
),
|
|
1459
1633
|
line_item: T.nilable(String),
|
|
1460
1634
|
project_id: T.nilable(String),
|
|
1461
1635
|
quantity: T.nilable(Float),
|
|
1462
|
-
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))
|
|
1636
|
+
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1637
|
+
user_id: T.nilable(String)
|
|
1463
1638
|
}
|
|
1464
1639
|
)
|
|
1465
1640
|
end
|
|
@@ -1518,6 +1693,41 @@ module OpenAI
|
|
|
1518
1693
|
end
|
|
1519
1694
|
|
|
1520
1695
|
end
|
|
1696
|
+
|
|
1697
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1698
|
+
# activity and `unlabeled` includes all records without published source
|
|
1699
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1700
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1701
|
+
module APISource
|
|
1702
|
+
extend OpenAI::Internal::Type::Enum
|
|
1703
|
+
|
|
1704
|
+
TaggedSymbol = T.type_alias {
|
|
1705
|
+
T.all(
|
|
1706
|
+
Symbol,
|
|
1707
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource
|
|
1708
|
+
)
|
|
1709
|
+
}
|
|
1710
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1711
|
+
|
|
1712
|
+
AGENTS_API = T.let(
|
|
1713
|
+
:agents_api,
|
|
1714
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1715
|
+
)
|
|
1716
|
+
UNLABELED = T.let(
|
|
1717
|
+
:unlabeled,
|
|
1718
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1719
|
+
)
|
|
1720
|
+
|
|
1721
|
+
sig {
|
|
1722
|
+
override.returns(
|
|
1723
|
+
T::Array[
|
|
1724
|
+
OpenAI::Models::Admin::Organization::UsageCodeInterpreterSessionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1725
|
+
]
|
|
1726
|
+
)
|
|
1727
|
+
}
|
|
1728
|
+
def self.values
|
|
1729
|
+
end
|
|
1730
|
+
end
|
|
1521
1731
|
end
|
|
1522
1732
|
|
|
1523
1733
|
sig {
|
|
@@ -54,8 +54,10 @@ module OpenAI
|
|
|
54
54
|
attr_writer :end_time
|
|
55
55
|
|
|
56
56
|
# Group the usage data by the specified fields. Support fields include
|
|
57
|
-
# `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier
|
|
58
|
-
# combination of them.
|
|
57
|
+
# `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
|
|
58
|
+
# `api_source` or any combination of them. When grouped by `api_source`, results
|
|
59
|
+
# use `agents_api` for attributed Agents API activity and `unlabeled` for all
|
|
60
|
+
# other activity. Without source grouping, `api_source` is null.
|
|
59
61
|
sig { returns(T.nilable(T::Array[OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::OrSymbol])) }
|
|
60
62
|
attr_reader :group_by
|
|
61
63
|
|
|
@@ -153,8 +155,10 @@ module OpenAI
|
|
|
153
155
|
end_time: nil,
|
|
154
156
|
|
|
155
157
|
# Group the usage data by the specified fields. Support fields include
|
|
156
|
-
# `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier
|
|
157
|
-
# combination of them.
|
|
158
|
+
# `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
|
|
159
|
+
# `api_source` or any combination of them. When grouped by `api_source`, results
|
|
160
|
+
# use `agents_api` for attributed Agents API activity and `unlabeled` for all
|
|
161
|
+
# other activity. Without source grouping, `api_source` is null.
|
|
158
162
|
group_by: nil,
|
|
159
163
|
|
|
160
164
|
# Specifies the number of buckets to return.
|
|
@@ -247,6 +251,7 @@ module OpenAI
|
|
|
247
251
|
:service_tier,
|
|
248
252
|
OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol
|
|
249
253
|
)
|
|
254
|
+
API_SOURCE = T.let(:api_source, OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol)
|
|
250
255
|
|
|
251
256
|
sig {
|
|
252
257
|
override.returns(T::Array[OpenAI::Admin::Organization::UsageCompletionsParams::GroupBy::TaggedSymbol])
|