openai 0.99.0 → 0.101.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 +13 -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 +125 -3
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_images_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +125 -3
- 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 +125 -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/sessions/turns/item_list_params.rb +79 -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_response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +12 -9
- data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
- data/lib/openai/models/beta/environment_param.rb +6 -6
- data/lib/openai/models/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/decision.rb +313 -0
- data/lib/openai/models/decision_create_params.rb +233 -0
- data/lib/openai/models/decision_input_image.rb +53 -0
- data/lib/openai/models/decision_input_message.rb +60 -0
- data/lib/openai/models/decision_input_part.rb +20 -0
- data/lib/openai/models/decision_input_text.rb +21 -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_edit_params.rb +12 -9
- data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
- data/lib/openai/models/realtime/session_update_event.rb +16 -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/response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +12 -9
- data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
- data/lib/openai/models/video_create_error.rb +12 -1
- data/lib/openai/models.rb +12 -0
- data/lib/openai/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- 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/decisions.rb +59 -0
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +8 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +11 -0
- data/rbi/openai/client.rbi +3 -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 +194 -1
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +194 -1
- 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 +194 -1
- 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/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_response_tool_search_output_item_param.rbi +1893 -18
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +12 -9
- data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
- 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_chunk.rbi +123 -17
- data/rbi/openai/models/decision.rbi +586 -0
- data/rbi/openai/models/decision_create_params.rbi +435 -0
- data/rbi/openai/models/decision_input_image.rbi +81 -0
- data/rbi/openai/models/decision_input_message.rbi +96 -0
- data/rbi/openai/models/decision_input_part.rbi +24 -0
- data/rbi/openai/models/decision_input_text.rbi +49 -0
- 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_edit_params.rbi +12 -9
- 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/response_tool_search_output_item_param.rbi +1901 -18
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +12 -9
- data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models/video_create_error.rbi +12 -0
- data/rbi/openai/models.rbi +12 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
- 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/decisions.rbi +57 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +8 -6
- data/sig/openai/client.rbs +2 -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 +87 -2
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_images_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +87 -2
- 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 +87 -2
- 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/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_response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +8 -6
- data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
- 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_chunk.rbs +96 -12
- data/sig/openai/models/decision.rbs +296 -0
- data/sig/openai/models/decision_create_params.rbs +227 -0
- data/sig/openai/models/decision_input_image.rbs +51 -0
- data/sig/openai/models/decision_input_message.rbs +57 -0
- data/sig/openai/models/decision_input_part.rbs +12 -0
- data/sig/openai/models/decision_input_text.rbs +15 -0
- 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_edit_params.rbs +8 -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/response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +8 -6
- data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
- data/sig/openai/models/video_create_error.rbs +10 -0
- data/sig/openai/models.rbs +12 -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/decisions.rbs +15 -0
- metadata +38 -1
|
@@ -104,9 +104,10 @@ module OpenAI
|
|
|
104
104
|
# set the output format to `png` or `webp`.
|
|
105
105
|
#
|
|
106
106
|
# @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
# `gpt-image-
|
|
107
|
+
# Control how much effort the model will exert to match the style and features,
|
|
108
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
109
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
110
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
110
111
|
#
|
|
111
112
|
# @param mask [Pathname, StringIO, IO, String, OpenAI::FilePart]
|
|
112
113
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
@@ -238,9 +239,10 @@ module OpenAI
|
|
|
238
239
|
# set the output format to `png` or `webp`.
|
|
239
240
|
#
|
|
240
241
|
# @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
|
|
241
|
-
#
|
|
242
|
-
#
|
|
243
|
-
# `gpt-image-
|
|
242
|
+
# Control how much effort the model will exert to match the style and features,
|
|
243
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
244
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
245
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
244
246
|
#
|
|
245
247
|
# @param mask [Pathname, StringIO, IO, String, OpenAI::FilePart]
|
|
246
248
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -529,6 +529,7 @@ require_relative "openai/models/beta/agents/sessions/trace_list_params"
|
|
|
529
529
|
require_relative "openai/models/beta/agents/sessions/turn"
|
|
530
530
|
require_relative "openai/models/beta/agents/sessions/turn_list_params"
|
|
531
531
|
require_relative "openai/models/beta/agents/sessions/turn_retrieve_params"
|
|
532
|
+
require_relative "openai/models/beta/agents/sessions/turns/item_list_params"
|
|
532
533
|
require_relative "openai/models/beta/agents/session_update_params"
|
|
533
534
|
require_relative "openai/models/beta/agents/vault"
|
|
534
535
|
require_relative "openai/models/beta/agents/vault_create_params"
|
|
@@ -718,6 +719,7 @@ require_relative "openai/models/beta/beta_tool_choice_mcp"
|
|
|
718
719
|
require_relative "openai/models/beta/beta_tool_choice_options"
|
|
719
720
|
require_relative "openai/models/beta/beta_tool_choice_shell"
|
|
720
721
|
require_relative "openai/models/beta/beta_tool_choice_types"
|
|
722
|
+
require_relative "openai/models/beta/beta_tool_search_output_namespace_tool"
|
|
721
723
|
require_relative "openai/models/beta/beta_tool_search_tool"
|
|
722
724
|
require_relative "openai/models/beta/beta_web_search_preview_tool"
|
|
723
725
|
require_relative "openai/models/beta/beta_web_search_tool"
|
|
@@ -953,6 +955,12 @@ require_relative "openai/models/conversations/summary_text_content"
|
|
|
953
955
|
require_relative "openai/models/conversations/text_content"
|
|
954
956
|
require_relative "openai/models/create_embedding_response"
|
|
955
957
|
require_relative "openai/models/custom_tool_input_format"
|
|
958
|
+
require_relative "openai/models/decision"
|
|
959
|
+
require_relative "openai/models/decision_create_params"
|
|
960
|
+
require_relative "openai/models/decision_input_image"
|
|
961
|
+
require_relative "openai/models/decision_input_message"
|
|
962
|
+
require_relative "openai/models/decision_input_part"
|
|
963
|
+
require_relative "openai/models/decision_input_text"
|
|
956
964
|
require_relative "openai/models/deleted_skill"
|
|
957
965
|
require_relative "openai/models/embedding"
|
|
958
966
|
require_relative "openai/models/embedding_create_params"
|
|
@@ -1363,6 +1371,7 @@ require_relative "openai/models/responses/tool_choice_mcp"
|
|
|
1363
1371
|
require_relative "openai/models/responses/tool_choice_options"
|
|
1364
1372
|
require_relative "openai/models/responses/tool_choice_shell"
|
|
1365
1373
|
require_relative "openai/models/responses/tool_choice_types"
|
|
1374
|
+
require_relative "openai/models/responses/tool_search_output_namespace_tool"
|
|
1366
1375
|
require_relative "openai/models/responses/tool_search_tool"
|
|
1367
1376
|
require_relative "openai/models/responses/web_search_preview_tool"
|
|
1368
1377
|
require_relative "openai/models/responses/web_search_tool"
|
|
@@ -1534,6 +1543,7 @@ require_relative "openai/resources/beta/agents/sessions/subagents/turns"
|
|
|
1534
1543
|
require_relative "openai/resources/beta/agents/sessions/subagents/turns/items"
|
|
1535
1544
|
require_relative "openai/resources/beta/agents/sessions/traces"
|
|
1536
1545
|
require_relative "openai/resources/beta/agents/sessions/turns"
|
|
1546
|
+
require_relative "openai/resources/beta/agents/sessions/turns/items"
|
|
1537
1547
|
require_relative "openai/resources/beta/agents/vaults"
|
|
1538
1548
|
require_relative "openai/resources/beta/agents/vaults/credentials"
|
|
1539
1549
|
require_relative "openai/resources/beta/assistants"
|
|
@@ -1557,6 +1567,7 @@ require_relative "openai/resources/containers/files/content"
|
|
|
1557
1567
|
require_relative "openai/resources/content_provenance_checks"
|
|
1558
1568
|
require_relative "openai/resources/conversations"
|
|
1559
1569
|
require_relative "openai/resources/conversations/items"
|
|
1570
|
+
require_relative "openai/resources/decisions"
|
|
1560
1571
|
require_relative "openai/resources/embeddings"
|
|
1561
1572
|
require_relative "openai/resources/evals"
|
|
1562
1573
|
require_relative "openai/resources/evals/runs"
|
data/rbi/openai/client.rbi
CHANGED
|
@@ -29,6 +29,9 @@ module OpenAI
|
|
|
29
29
|
sig { returns(T.nilable(String)) }
|
|
30
30
|
attr_reader :webhook_secret
|
|
31
31
|
|
|
32
|
+
sig { returns(OpenAI::Resources::Decisions) }
|
|
33
|
+
attr_reader :decisions
|
|
34
|
+
|
|
32
35
|
# Given a prompt, the model will return one or more predicted completions, and can
|
|
33
36
|
# also return the probabilities of alternative tokens at each position.
|
|
34
37
|
sig { returns(OpenAI::Resources::Completions) }
|
|
@@ -56,6 +56,7 @@ module OpenAI
|
|
|
56
56
|
session_id: String,
|
|
57
57
|
input: T.any(String, T::Array[OpenAI::Models::Beta::AgentSessionInputMessageParam::OrHash]),
|
|
58
58
|
tool_handlers: T::Hash[String, OpenAI::Helpers::Agents::ToolHandler],
|
|
59
|
+
on_tool_error: T.nilable(T.proc.params(failure: OpenAI::Helpers::Beta::Agents::ToolError).void),
|
|
59
60
|
idempotency_key: T.nilable(String),
|
|
60
61
|
output_type: T.nilable(T.class_of(OpenAI::Helpers::StructuredOutput::BaseModel)),
|
|
61
62
|
request_options: T.nilable(OpenAI::RequestOptions::OrHash),
|
|
@@ -67,6 +68,7 @@ module OpenAI
|
|
|
67
68
|
session_id,
|
|
68
69
|
input:,
|
|
69
70
|
tool_handlers: {},
|
|
71
|
+
on_tool_error: nil,
|
|
70
72
|
idempotency_key: nil,
|
|
71
73
|
output_type: nil,
|
|
72
74
|
request_options: {},
|
|
@@ -13,11 +13,12 @@ module OpenAI
|
|
|
13
13
|
name: String,
|
|
14
14
|
arguments: T.class_of(OpenAI::BaseModel),
|
|
15
15
|
description: String,
|
|
16
|
+
defer_loading: T.nilable(T::Boolean),
|
|
16
17
|
handler: T.proc.params(arguments: T.untyped).returns(OpenAI::Helpers::Agents::ToolOutput)
|
|
17
18
|
)
|
|
18
19
|
.void
|
|
19
20
|
end
|
|
20
|
-
def initialize(name:, arguments:, description: "", &handler)
|
|
21
|
+
def initialize(name:, arguments:, description: "", defer_loading: nil, &handler)
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
sig { returns(OpenAI::Internal::AnyHash) }
|
|
@@ -29,9 +30,13 @@ module OpenAI
|
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
sig {
|
|
32
|
-
params(
|
|
33
|
+
params(
|
|
34
|
+
arguments: T.any(String, OpenAI::Internal::AnyHash),
|
|
35
|
+
report_stage: T.nilable(T.proc.params(stage: Symbol).void)
|
|
36
|
+
)
|
|
37
|
+
.returns(OpenAI::Helpers::Agents::ToolOutput)
|
|
33
38
|
}
|
|
34
|
-
def call(arguments)
|
|
39
|
+
def call(arguments, &report_stage)
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Helpers
|
|
5
|
+
module Beta
|
|
6
|
+
module Agents
|
|
7
|
+
# Beta, local-only tool failure diagnostic.
|
|
8
|
+
class ToolError
|
|
9
|
+
sig { returns(StandardError) }
|
|
10
|
+
attr_reader :error
|
|
11
|
+
sig { returns(String) }
|
|
12
|
+
attr_reader :tool_name, :session_id, :turn_id, :call_id
|
|
13
|
+
sig { returns(Symbol) }
|
|
14
|
+
attr_reader :stage
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -139,6 +139,18 @@ module OpenAI
|
|
|
139
139
|
sig { params(parser: T.nilable(OutputParser)).returns(T.self_type) }
|
|
140
140
|
def configure_output_parser(parser)
|
|
141
141
|
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
sig do
|
|
145
|
+
params(
|
|
146
|
+
sessions: OpenAI::Resources::Beta::Agents::Sessions,
|
|
147
|
+
tool_handlers: T::Hash[String, OpenAI::Helpers::Agents::ToolHandler],
|
|
148
|
+
request_options: T.untyped
|
|
149
|
+
)
|
|
150
|
+
.returns(T.self_type)
|
|
151
|
+
end
|
|
152
|
+
def configure_tool_handlers(sessions:, tool_handlers:, request_options:)
|
|
153
|
+
end
|
|
142
154
|
end
|
|
143
155
|
end
|
|
144
156
|
end
|
|
@@ -194,6 +194,19 @@ module OpenAI
|
|
|
194
194
|
sig { returns(T.nilable(String)) }
|
|
195
195
|
attr_accessor :api_key_id
|
|
196
196
|
|
|
197
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
198
|
+
# activity and `unlabeled` includes all records without published source
|
|
199
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
200
|
+
# direct API usage. Without source grouping, this field is null.
|
|
201
|
+
sig {
|
|
202
|
+
returns(
|
|
203
|
+
T.nilable(
|
|
204
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
205
|
+
)
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
attr_accessor :api_source
|
|
209
|
+
|
|
197
210
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
198
211
|
# batch or not.
|
|
199
212
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -327,6 +340,10 @@ module OpenAI
|
|
|
327
340
|
|
|
328
341
|
api_key_id: T.nilable(String),
|
|
329
342
|
|
|
343
|
+
api_source: T.nilable(
|
|
344
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::OrSymbol
|
|
345
|
+
),
|
|
346
|
+
|
|
330
347
|
batch: T.nilable(T::Boolean),
|
|
331
348
|
|
|
332
349
|
input_audio_tokens: Integer,
|
|
@@ -386,6 +403,12 @@ module OpenAI
|
|
|
386
403
|
# usage result.
|
|
387
404
|
api_key_id: nil,
|
|
388
405
|
|
|
406
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
407
|
+
# activity and `unlabeled` includes all records without published source
|
|
408
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
409
|
+
# direct API usage. Without source grouping, this field is null.
|
|
410
|
+
api_source: nil,
|
|
411
|
+
|
|
389
412
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
390
413
|
# batch or not.
|
|
391
414
|
batch: nil,
|
|
@@ -462,6 +485,9 @@ module OpenAI
|
|
|
462
485
|
object: Symbol,
|
|
463
486
|
output_tokens: Integer,
|
|
464
487
|
api_key_id: T.nilable(String),
|
|
488
|
+
api_source: T.nilable(
|
|
489
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
490
|
+
),
|
|
465
491
|
batch: T.nilable(T::Boolean),
|
|
466
492
|
input_audio_tokens: Integer,
|
|
467
493
|
input_cache_write_12h_tokens: Integer,
|
|
@@ -486,6 +512,40 @@ module OpenAI
|
|
|
486
512
|
def to_hash
|
|
487
513
|
end
|
|
488
514
|
|
|
515
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
516
|
+
# activity and `unlabeled` includes all records without published source
|
|
517
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
518
|
+
# direct API usage. Without source grouping, this field is null.
|
|
519
|
+
module APISource
|
|
520
|
+
extend OpenAI::Internal::Type::Enum
|
|
521
|
+
|
|
522
|
+
TaggedSymbol = T.type_alias {
|
|
523
|
+
T.all(
|
|
524
|
+
Symbol,
|
|
525
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
529
|
+
|
|
530
|
+
AGENTS_API = T.let(
|
|
531
|
+
:agents_api,
|
|
532
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
533
|
+
)
|
|
534
|
+
UNLABELED = T.let(
|
|
535
|
+
:unlabeled,
|
|
536
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
sig {
|
|
540
|
+
override.returns(
|
|
541
|
+
T::Array[
|
|
542
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
543
|
+
]
|
|
544
|
+
)
|
|
545
|
+
}
|
|
546
|
+
def self.values
|
|
547
|
+
end
|
|
548
|
+
end
|
|
489
549
|
end
|
|
490
550
|
|
|
491
551
|
class OrganizationUsageEmbeddingsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1267,6 +1327,19 @@ module OpenAI
|
|
|
1267
1327
|
sig { returns(T.nilable(String)) }
|
|
1268
1328
|
attr_accessor :api_key_id
|
|
1269
1329
|
|
|
1330
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1331
|
+
# activity and `unlabeled` includes all records without published source
|
|
1332
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1333
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1334
|
+
sig {
|
|
1335
|
+
returns(
|
|
1336
|
+
T.nilable(
|
|
1337
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1338
|
+
)
|
|
1339
|
+
)
|
|
1340
|
+
}
|
|
1341
|
+
attr_accessor :api_source
|
|
1342
|
+
|
|
1270
1343
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1271
1344
|
# the grouped usage result.
|
|
1272
1345
|
sig { returns(T.nilable(String)) }
|
|
@@ -1297,6 +1370,10 @@ module OpenAI
|
|
|
1297
1370
|
|
|
1298
1371
|
api_key_id: T.nilable(String),
|
|
1299
1372
|
|
|
1373
|
+
api_source: T.nilable(
|
|
1374
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::OrSymbol
|
|
1375
|
+
),
|
|
1376
|
+
|
|
1300
1377
|
context_level: T.nilable(String),
|
|
1301
1378
|
|
|
1302
1379
|
model: T.nilable(String),
|
|
@@ -1321,6 +1398,12 @@ module OpenAI
|
|
|
1321
1398
|
# usage result.
|
|
1322
1399
|
api_key_id: nil,
|
|
1323
1400
|
|
|
1401
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1402
|
+
# activity and `unlabeled` includes all records without published source
|
|
1403
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1404
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1405
|
+
api_source: nil,
|
|
1406
|
+
|
|
1324
1407
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1325
1408
|
# the grouped usage result.
|
|
1326
1409
|
context_level: nil,
|
|
@@ -1348,6 +1431,9 @@ module OpenAI
|
|
|
1348
1431
|
num_requests: Integer,
|
|
1349
1432
|
object: Symbol,
|
|
1350
1433
|
api_key_id: T.nilable(String),
|
|
1434
|
+
api_source: T.nilable(
|
|
1435
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1436
|
+
),
|
|
1351
1437
|
context_level: T.nilable(String),
|
|
1352
1438
|
model: T.nilable(String),
|
|
1353
1439
|
project_id: T.nilable(String),
|
|
@@ -1358,6 +1444,40 @@ module OpenAI
|
|
|
1358
1444
|
def to_hash
|
|
1359
1445
|
end
|
|
1360
1446
|
|
|
1447
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1448
|
+
# activity and `unlabeled` includes all records without published source
|
|
1449
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1450
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1451
|
+
module APISource
|
|
1452
|
+
extend OpenAI::Internal::Type::Enum
|
|
1453
|
+
|
|
1454
|
+
TaggedSymbol = T.type_alias {
|
|
1455
|
+
T.all(
|
|
1456
|
+
Symbol,
|
|
1457
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource
|
|
1458
|
+
)
|
|
1459
|
+
}
|
|
1460
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1461
|
+
|
|
1462
|
+
AGENTS_API = T.let(
|
|
1463
|
+
:agents_api,
|
|
1464
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1465
|
+
)
|
|
1466
|
+
UNLABELED = T.let(
|
|
1467
|
+
:unlabeled,
|
|
1468
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1469
|
+
)
|
|
1470
|
+
|
|
1471
|
+
sig {
|
|
1472
|
+
override.returns(
|
|
1473
|
+
T::Array[
|
|
1474
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1475
|
+
]
|
|
1476
|
+
)
|
|
1477
|
+
}
|
|
1478
|
+
def self.values
|
|
1479
|
+
end
|
|
1480
|
+
end
|
|
1361
1481
|
end
|
|
1362
1482
|
|
|
1363
1483
|
class OrganizationCostsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1394,6 +1514,19 @@ module OpenAI
|
|
|
1394
1514
|
sig { returns(T.nilable(String)) }
|
|
1395
1515
|
attr_accessor :api_key_id
|
|
1396
1516
|
|
|
1517
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1518
|
+
# activity and `unlabeled` includes all records without published source
|
|
1519
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1520
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1521
|
+
sig {
|
|
1522
|
+
returns(
|
|
1523
|
+
T.nilable(
|
|
1524
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1525
|
+
)
|
|
1526
|
+
)
|
|
1527
|
+
}
|
|
1528
|
+
attr_accessor :api_source
|
|
1529
|
+
|
|
1397
1530
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1398
1531
|
# costs result.
|
|
1399
1532
|
sig { returns(T.nilable(String)) }
|
|
@@ -1414,6 +1547,11 @@ module OpenAI
|
|
|
1414
1547
|
sig { returns(T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))) }
|
|
1415
1548
|
attr_accessor :quantity_unit
|
|
1416
1549
|
|
|
1550
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1551
|
+
# result.
|
|
1552
|
+
sig { returns(T.nilable(String)) }
|
|
1553
|
+
attr_accessor :user_id
|
|
1554
|
+
|
|
1417
1555
|
# The aggregated costs details of the specific time bucket.
|
|
1418
1556
|
sig do
|
|
1419
1557
|
params(
|
|
@@ -1422,6 +1560,10 @@ module OpenAI
|
|
|
1422
1560
|
|
|
1423
1561
|
api_key_id: T.nilable(String),
|
|
1424
1562
|
|
|
1563
|
+
api_source: T.nilable(
|
|
1564
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::OrSymbol
|
|
1565
|
+
),
|
|
1566
|
+
|
|
1425
1567
|
line_item: T.nilable(String),
|
|
1426
1568
|
|
|
1427
1569
|
project_id: T.nilable(String),
|
|
@@ -1430,6 +1572,8 @@ module OpenAI
|
|
|
1430
1572
|
|
|
1431
1573
|
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1432
1574
|
|
|
1575
|
+
user_id: T.nilable(String),
|
|
1576
|
+
|
|
1433
1577
|
object: Symbol
|
|
1434
1578
|
)
|
|
1435
1579
|
.returns(T.attached_class)
|
|
@@ -1443,6 +1587,12 @@ module OpenAI
|
|
|
1443
1587
|
# costs result.
|
|
1444
1588
|
api_key_id: nil,
|
|
1445
1589
|
|
|
1590
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1591
|
+
# activity and `unlabeled` includes all records without published source
|
|
1592
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1593
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1594
|
+
api_source: nil,
|
|
1595
|
+
|
|
1446
1596
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1447
1597
|
# costs result.
|
|
1448
1598
|
line_item: nil,
|
|
@@ -1459,6 +1609,10 @@ module OpenAI
|
|
|
1459
1609
|
# result, this field is `null`.
|
|
1460
1610
|
quantity_unit: nil,
|
|
1461
1611
|
|
|
1612
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1613
|
+
# result.
|
|
1614
|
+
user_id: nil,
|
|
1615
|
+
|
|
1462
1616
|
object: :"organization.costs.result"
|
|
1463
1617
|
)
|
|
1464
1618
|
end
|
|
@@ -1469,10 +1623,14 @@ module OpenAI
|
|
|
1469
1623
|
object: Symbol,
|
|
1470
1624
|
amount: OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::Amount,
|
|
1471
1625
|
api_key_id: T.nilable(String),
|
|
1626
|
+
api_source: T.nilable(
|
|
1627
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1628
|
+
),
|
|
1472
1629
|
line_item: T.nilable(String),
|
|
1473
1630
|
project_id: T.nilable(String),
|
|
1474
1631
|
quantity: T.nilable(Float),
|
|
1475
|
-
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))
|
|
1632
|
+
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1633
|
+
user_id: T.nilable(String)
|
|
1476
1634
|
}
|
|
1477
1635
|
)
|
|
1478
1636
|
end
|
|
@@ -1531,6 +1689,41 @@ module OpenAI
|
|
|
1531
1689
|
end
|
|
1532
1690
|
|
|
1533
1691
|
end
|
|
1692
|
+
|
|
1693
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1694
|
+
# activity and `unlabeled` includes all records without published source
|
|
1695
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1696
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1697
|
+
module APISource
|
|
1698
|
+
extend OpenAI::Internal::Type::Enum
|
|
1699
|
+
|
|
1700
|
+
TaggedSymbol = T.type_alias {
|
|
1701
|
+
T.all(
|
|
1702
|
+
Symbol,
|
|
1703
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource
|
|
1704
|
+
)
|
|
1705
|
+
}
|
|
1706
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1707
|
+
|
|
1708
|
+
AGENTS_API = T.let(
|
|
1709
|
+
:agents_api,
|
|
1710
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1711
|
+
)
|
|
1712
|
+
UNLABELED = T.let(
|
|
1713
|
+
:unlabeled,
|
|
1714
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1715
|
+
)
|
|
1716
|
+
|
|
1717
|
+
sig {
|
|
1718
|
+
override.returns(
|
|
1719
|
+
T::Array[
|
|
1720
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1721
|
+
]
|
|
1722
|
+
)
|
|
1723
|
+
}
|
|
1724
|
+
def self.values
|
|
1725
|
+
end
|
|
1726
|
+
end
|
|
1534
1727
|
end
|
|
1535
1728
|
|
|
1536
1729
|
sig {
|