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
|
@@ -2467,6 +2467,13 @@ module OpenAI
|
|
|
2467
2467
|
}
|
|
2468
2468
|
)
|
|
2469
2469
|
|
|
2470
|
+
# @!attribute review_target
|
|
2471
|
+
# An opaque target for explicitly continuing this review, or null when
|
|
2472
|
+
# unavailable.
|
|
2473
|
+
#
|
|
2474
|
+
# @return [String, nil]
|
|
2475
|
+
optional :review_target, String, nil?: true
|
|
2476
|
+
|
|
2470
2477
|
# @!attribute steer
|
|
2471
2478
|
# An optional public continuation instruction.
|
|
2472
2479
|
#
|
|
@@ -2476,13 +2483,17 @@ module OpenAI
|
|
|
2476
2483
|
-> { OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::Steer }
|
|
2477
2484
|
)
|
|
2478
2485
|
|
|
2479
|
-
# @!method initialize(detailed_explanation: nil, error_type: nil, steer: nil)
|
|
2486
|
+
# @!method initialize(detailed_explanation: nil, error_type: nil, review_target: nil, steer: nil)
|
|
2480
2487
|
# @param detailed_explanation [String]
|
|
2481
2488
|
# The public explanation for this block.
|
|
2482
2489
|
#
|
|
2483
2490
|
# @param error_type [String, Symbol, OpenAI::Models::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::ErrorType]
|
|
2484
2491
|
# An optional classification; clients must accept additional values.
|
|
2485
2492
|
#
|
|
2493
|
+
# @param review_target [String, nil]
|
|
2494
|
+
# An opaque target for explicitly continuing this review, or null when
|
|
2495
|
+
# unavailable.
|
|
2496
|
+
#
|
|
2486
2497
|
# @param steer [OpenAI::Models::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::Steer]
|
|
2487
2498
|
# An optional public continuation instruction.
|
|
2488
2499
|
|
|
@@ -632,9 +632,10 @@ module OpenAI
|
|
|
632
632
|
optional :background, enum: -> { OpenAI::Beta::BetaTool::ImageGeneration::Background }
|
|
633
633
|
|
|
634
634
|
# @!attribute input_fidelity
|
|
635
|
-
#
|
|
636
|
-
#
|
|
637
|
-
# `gpt-image-
|
|
635
|
+
# Control how much effort the model will exert to match the style and features,
|
|
636
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
637
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
638
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
638
639
|
#
|
|
639
640
|
# @return [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::InputFidelity, nil]
|
|
640
641
|
optional(
|
|
@@ -730,9 +731,10 @@ module OpenAI
|
|
|
730
731
|
# set the output format to `png` or `webp`.
|
|
731
732
|
#
|
|
732
733
|
# @param input_fidelity [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::InputFidelity, nil]
|
|
733
|
-
#
|
|
734
|
-
#
|
|
735
|
-
# `gpt-image-
|
|
734
|
+
# Control how much effort the model will exert to match the style and features,
|
|
735
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
736
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
737
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
736
738
|
#
|
|
737
739
|
# @param input_image_mask [OpenAI::Models::Beta::BetaTool::ImageGeneration::InputImageMask]
|
|
738
740
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -816,9 +818,10 @@ module OpenAI
|
|
|
816
818
|
# @return [Array<Symbol>]
|
|
817
819
|
end
|
|
818
820
|
|
|
819
|
-
#
|
|
820
|
-
#
|
|
821
|
-
# `gpt-image-
|
|
821
|
+
# Control how much effort the model will exert to match the style and features,
|
|
822
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
823
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
824
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
822
825
|
#
|
|
823
826
|
# @see OpenAI::Models::Beta::BetaTool::ImageGeneration#input_fidelity
|
|
824
827
|
module InputFidelity
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaToolSearchOutputNamespaceTool < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute description
|
|
8
|
+
# A description of the namespace shown to the model.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :description, String
|
|
12
|
+
|
|
13
|
+
# @!attribute name
|
|
14
|
+
# The namespace name used in tool calls (for example, `crm`).
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :name, String
|
|
18
|
+
|
|
19
|
+
# @!attribute tools
|
|
20
|
+
# The function/custom tools loaded inside this namespace.
|
|
21
|
+
#
|
|
22
|
+
# @return [Array<OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Models::Beta::BetaCustomTool>]
|
|
23
|
+
required(
|
|
24
|
+
:tools,
|
|
25
|
+
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool] }
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
# @!attribute type
|
|
29
|
+
# The type of the tool. Always `namespace`.
|
|
30
|
+
#
|
|
31
|
+
# @return [Symbol, :namespace]
|
|
32
|
+
required :type, const: :namespace
|
|
33
|
+
|
|
34
|
+
# @!method initialize(description:, name:, tools:, type: :namespace)
|
|
35
|
+
# Groups function/custom tools under a shared namespace.
|
|
36
|
+
#
|
|
37
|
+
# @param description [String]
|
|
38
|
+
# A description of the namespace shown to the model.
|
|
39
|
+
#
|
|
40
|
+
# @param name [String]
|
|
41
|
+
# The namespace name used in tool calls (for example, `crm`).
|
|
42
|
+
#
|
|
43
|
+
# @param tools [Array<OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Models::Beta::BetaCustomTool>]
|
|
44
|
+
# The function/custom tools loaded inside this namespace.
|
|
45
|
+
#
|
|
46
|
+
# @param type [Symbol, :namespace]
|
|
47
|
+
# The type of the tool. Always `namespace`.
|
|
48
|
+
|
|
49
|
+
# A function or custom tool loaded into a namespace by tool search.
|
|
50
|
+
module Tool
|
|
51
|
+
extend OpenAI::Internal::Type::Union
|
|
52
|
+
|
|
53
|
+
discriminator :type
|
|
54
|
+
|
|
55
|
+
variant :function, -> { OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function }
|
|
56
|
+
|
|
57
|
+
# A custom tool that processes input using a specified format. Learn more about [custom tools](https://developers.openai.com/api/docs/guides/function-calling#custom-tools)
|
|
58
|
+
variant :custom, -> { OpenAI::Beta::BetaCustomTool }
|
|
59
|
+
|
|
60
|
+
class Function < OpenAI::Internal::Type::BaseModel
|
|
61
|
+
# @!attribute name
|
|
62
|
+
# The name of the loaded function tool.
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :name, String
|
|
66
|
+
|
|
67
|
+
# @!attribute type
|
|
68
|
+
#
|
|
69
|
+
# @return [Symbol, :function]
|
|
70
|
+
required :type, const: :function
|
|
71
|
+
|
|
72
|
+
# @!attribute allowed_callers
|
|
73
|
+
# The tool invocation context(s).
|
|
74
|
+
#
|
|
75
|
+
# @return [Array<Symbol, OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller>, nil]
|
|
76
|
+
optional(
|
|
77
|
+
:allowed_callers,
|
|
78
|
+
-> {
|
|
79
|
+
OpenAI::Internal::Type::ArrayOf[
|
|
80
|
+
enum: OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
nil?: true
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# @!attribute async
|
|
87
|
+
# Whether the tool response can be returned asynchronously versus immediately
|
|
88
|
+
# returned on next response creation.
|
|
89
|
+
#
|
|
90
|
+
# @return [Boolean, nil]
|
|
91
|
+
optional :async, OpenAI::Internal::Type::Boolean
|
|
92
|
+
|
|
93
|
+
# @!attribute defer_loading
|
|
94
|
+
# Whether this function should be deferred and discovered via tool search.
|
|
95
|
+
#
|
|
96
|
+
# @return [Boolean, nil]
|
|
97
|
+
optional :defer_loading, OpenAI::Internal::Type::Boolean
|
|
98
|
+
|
|
99
|
+
# @!attribute description
|
|
100
|
+
#
|
|
101
|
+
# @return [String, nil]
|
|
102
|
+
optional :description, String, nil?: true
|
|
103
|
+
|
|
104
|
+
# @!attribute output_schema
|
|
105
|
+
# A JSON Schema describing the JSON value encoded in string outputs for this
|
|
106
|
+
# function tool. This does not describe content-array outputs.
|
|
107
|
+
#
|
|
108
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
109
|
+
optional(
|
|
110
|
+
:output_schema,
|
|
111
|
+
OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown],
|
|
112
|
+
nil?: true
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# @!attribute parameters
|
|
116
|
+
#
|
|
117
|
+
# @return [Object, nil]
|
|
118
|
+
optional :parameters, OpenAI::Internal::Type::Unknown, nil?: true
|
|
119
|
+
|
|
120
|
+
# @!attribute strict
|
|
121
|
+
# Whether to enforce strict parameter validation. If omitted, Responses attempts
|
|
122
|
+
# to use strict validation when the schema is compatible, and falls back to
|
|
123
|
+
# non-strict validation otherwise.
|
|
124
|
+
#
|
|
125
|
+
# @return [Boolean, nil]
|
|
126
|
+
optional :strict, OpenAI::Internal::Type::Boolean, nil?: true
|
|
127
|
+
|
|
128
|
+
# @!method initialize(name:, allowed_callers: nil, async: nil, defer_loading: nil, description: nil, output_schema: nil, parameters: nil, strict: nil, type: :function)
|
|
129
|
+
# @param name [String]
|
|
130
|
+
# The name of the loaded function tool.
|
|
131
|
+
#
|
|
132
|
+
# @param allowed_callers [Array<Symbol, OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller>, nil]
|
|
133
|
+
# The tool invocation context(s).
|
|
134
|
+
#
|
|
135
|
+
# @param async [Boolean]
|
|
136
|
+
# Whether the tool response can be returned asynchronously versus immediately
|
|
137
|
+
# returned on next response creation.
|
|
138
|
+
#
|
|
139
|
+
# @param defer_loading [Boolean]
|
|
140
|
+
# Whether this function should be deferred and discovered via tool search.
|
|
141
|
+
#
|
|
142
|
+
# @param description [String, nil]
|
|
143
|
+
#
|
|
144
|
+
# @param output_schema [Hash{Symbol=>Object}, nil]
|
|
145
|
+
# A JSON Schema describing the JSON value encoded in string outputs for this
|
|
146
|
+
# function tool. This does not describe content-array outputs.
|
|
147
|
+
#
|
|
148
|
+
# @param parameters [Object, nil]
|
|
149
|
+
#
|
|
150
|
+
# @param strict [Boolean, nil]
|
|
151
|
+
# Whether to enforce strict parameter validation. If omitted, Responses attempts
|
|
152
|
+
# to use strict validation when the schema is compatible, and falls back to
|
|
153
|
+
# non-strict validation otherwise.
|
|
154
|
+
#
|
|
155
|
+
# @param type [Symbol, :function]
|
|
156
|
+
|
|
157
|
+
module AllowedCaller
|
|
158
|
+
extend OpenAI::Internal::Type::Enum
|
|
159
|
+
|
|
160
|
+
DIRECT = :direct
|
|
161
|
+
PROGRAMMATIC = :programmatic
|
|
162
|
+
|
|
163
|
+
# @!method self.values
|
|
164
|
+
# @return [Array<Symbol>]
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# @!method self.variants
|
|
169
|
+
# @return [Array(OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Models::Beta::BetaCustomTool)]
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
BetaToolSearchOutputNamespaceTool = Beta::BetaToolSearchOutputNamespaceTool
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -83,8 +83,8 @@ module OpenAI
|
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
# @!attribute network
|
|
86
|
-
# Network access policy for the environment.
|
|
87
|
-
#
|
|
86
|
+
# Network access policy for the environment. If omitted, the API version
|
|
87
|
+
# determines whether network access is enabled or disabled.
|
|
88
88
|
#
|
|
89
89
|
# @return [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Network, nil]
|
|
90
90
|
optional :network, -> { OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network }, nil?: true
|
|
@@ -154,8 +154,8 @@ module OpenAI
|
|
|
154
154
|
# Files available before the agent starts. Defaults to an empty list.
|
|
155
155
|
#
|
|
156
156
|
# @param network [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Network, nil]
|
|
157
|
-
# Network access policy for the environment.
|
|
158
|
-
#
|
|
157
|
+
# Network access policy for the environment. If omitted, the API version
|
|
158
|
+
# determines whether network access is enabled or disabled.
|
|
159
159
|
#
|
|
160
160
|
# @param packages [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Packages, nil]
|
|
161
161
|
# Packages to install in the environment. Defaults to empty package lists.
|
|
@@ -226,8 +226,8 @@ module OpenAI
|
|
|
226
226
|
optional :blocked_domains, OpenAI::Internal::Type::ArrayOf[String], nil?: true
|
|
227
227
|
|
|
228
228
|
# @!method initialize(access:, allowed_domains: nil, blocked_domains: nil)
|
|
229
|
-
# Network access policy for the environment.
|
|
230
|
-
#
|
|
229
|
+
# Network access policy for the environment. If omitted, the API version
|
|
230
|
+
# determines whether network access is enabled or disabled.
|
|
231
231
|
#
|
|
232
232
|
# @param access [Symbol, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Network::Access]
|
|
233
233
|
# The environment's network access mode.
|
|
@@ -40,6 +40,15 @@ module OpenAI
|
|
|
40
40
|
# The organization has reached a usage, plan, or billing limit.
|
|
41
41
|
USAGE_LIMIT_EXCEEDED = :usage_limit_exceeded
|
|
42
42
|
|
|
43
|
+
# The project has reached its enforced spend limit.
|
|
44
|
+
PROJECT_SPEND_LIMIT_EXCEEDED = :project_spend_limit_exceeded
|
|
45
|
+
|
|
46
|
+
# The organization has reached its enforced spend limit.
|
|
47
|
+
ORGANIZATION_SPEND_LIMIT_EXCEEDED = :organization_spend_limit_exceeded
|
|
48
|
+
|
|
49
|
+
# The organization has reached its OpenAI-assigned usage limit.
|
|
50
|
+
ORGANIZATION_USAGE_LIMIT_EXCEEDED = :organization_usage_limit_exceeded
|
|
51
|
+
|
|
43
52
|
# The organization has no API credits remaining.
|
|
44
53
|
CREDIT_BALANCE_EXHAUSTED = :credit_balance_exhausted
|
|
45
54
|
|
|
@@ -172,21 +172,30 @@ module OpenAI
|
|
|
172
172
|
# The object type, which is always `chat.completion.chunk`.
|
|
173
173
|
class Choice < OpenAI::Internal::Type::BaseModel
|
|
174
174
|
# @!attribute delta
|
|
175
|
-
# A chat completion delta generated by streamed model responses.
|
|
175
|
+
# A chat completion delta generated by streamed model responses. Streamed audio
|
|
176
|
+
# can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
177
|
+
# final audio update contains only its expiry timestamp.
|
|
176
178
|
#
|
|
177
179
|
# @return [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta]
|
|
178
180
|
required :delta, -> { OpenAI::Chat::ChatCompletionChunk::Choice::Delta }
|
|
179
181
|
|
|
182
|
+
# @!attribute index
|
|
183
|
+
# The index of the choice in the list of choices.
|
|
184
|
+
#
|
|
185
|
+
# @return [Integer]
|
|
186
|
+
required :index, Integer
|
|
187
|
+
|
|
180
188
|
# @!attribute finish_reason
|
|
181
189
|
# The reason the model stopped generating tokens. This will be `stop` if the model
|
|
182
190
|
# hit a natural stop point or a provided stop sequence, `length` if the maximum
|
|
183
191
|
# number of tokens specified in the request was reached, `content_filter` if
|
|
184
192
|
# content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
185
193
|
# model called a tool, or `function_call` (deprecated) if the model called a
|
|
186
|
-
# function.
|
|
194
|
+
# function. Omitted from the final audio update containing only
|
|
195
|
+
# `delta.audio.expires_at`.
|
|
187
196
|
#
|
|
188
197
|
# @return [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason, nil]
|
|
189
|
-
|
|
198
|
+
optional(
|
|
190
199
|
:finish_reason,
|
|
191
200
|
enum: -> {
|
|
192
201
|
OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason
|
|
@@ -194,21 +203,20 @@ module OpenAI
|
|
|
194
203
|
nil?: true
|
|
195
204
|
)
|
|
196
205
|
|
|
197
|
-
# @!attribute index
|
|
198
|
-
# The index of the choice in the list of choices.
|
|
199
|
-
#
|
|
200
|
-
# @return [Integer]
|
|
201
|
-
required :index, Integer
|
|
202
|
-
|
|
203
206
|
# @!attribute logprobs
|
|
204
207
|
# Log probability information for the choice.
|
|
205
208
|
#
|
|
206
209
|
# @return [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, nil]
|
|
207
210
|
optional :logprobs, -> { OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs }, nil?: true
|
|
208
211
|
|
|
209
|
-
# @!method initialize(delta:,
|
|
212
|
+
# @!method initialize(delta:, index:, finish_reason: nil, logprobs: nil)
|
|
210
213
|
# @param delta [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta]
|
|
211
|
-
# A chat completion delta generated by streamed model responses.
|
|
214
|
+
# A chat completion delta generated by streamed model responses. Streamed audio
|
|
215
|
+
# can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
216
|
+
# final audio update contains only its expiry timestamp.
|
|
217
|
+
#
|
|
218
|
+
# @param index [Integer]
|
|
219
|
+
# The index of the choice in the list of choices.
|
|
212
220
|
#
|
|
213
221
|
# @param finish_reason [Symbol, OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason, nil]
|
|
214
222
|
# The reason the model stopped generating tokens. This will be `stop` if the model
|
|
@@ -216,16 +224,21 @@ module OpenAI
|
|
|
216
224
|
# number of tokens specified in the request was reached, `content_filter` if
|
|
217
225
|
# content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
218
226
|
# model called a tool, or `function_call` (deprecated) if the model called a
|
|
219
|
-
# function.
|
|
220
|
-
#
|
|
221
|
-
# @param index [Integer]
|
|
222
|
-
# The index of the choice in the list of choices.
|
|
227
|
+
# function. Omitted from the final audio update containing only
|
|
228
|
+
# `delta.audio.expires_at`.
|
|
223
229
|
#
|
|
224
230
|
# @param logprobs [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, nil]
|
|
225
231
|
# Log probability information for the choice.
|
|
226
232
|
|
|
227
233
|
# @see OpenAI::Models::Chat::ChatCompletionChunk::Choice#delta
|
|
228
234
|
class Delta < OpenAI::Internal::Type::BaseModel
|
|
235
|
+
# @!attribute audio
|
|
236
|
+
# A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
237
|
+
# transcript text; the final audio update contains only its expiry timestamp.
|
|
238
|
+
#
|
|
239
|
+
# @return [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Audio, nil]
|
|
240
|
+
optional :audio, -> { OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio }
|
|
241
|
+
|
|
229
242
|
# @!attribute content
|
|
230
243
|
# The contents of the chunk message.
|
|
231
244
|
#
|
|
@@ -261,8 +274,14 @@ module OpenAI
|
|
|
261
274
|
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall] }
|
|
262
275
|
)
|
|
263
276
|
|
|
264
|
-
# @!method initialize(content: nil, function_call: nil, refusal: nil, role: nil, tool_calls: nil)
|
|
265
|
-
# A chat completion delta generated by streamed model responses.
|
|
277
|
+
# @!method initialize(audio: nil, content: nil, function_call: nil, refusal: nil, role: nil, tool_calls: nil)
|
|
278
|
+
# A chat completion delta generated by streamed model responses. Streamed audio
|
|
279
|
+
# can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
280
|
+
# final audio update contains only its expiry timestamp.
|
|
281
|
+
#
|
|
282
|
+
# @param audio [OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Audio]
|
|
283
|
+
# A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
284
|
+
# transcript text; the final audio update contains only its expiry timestamp.
|
|
266
285
|
#
|
|
267
286
|
# @param content [String, nil]
|
|
268
287
|
# The contents of the chunk message.
|
|
@@ -279,6 +298,53 @@ module OpenAI
|
|
|
279
298
|
#
|
|
280
299
|
# @param tool_calls [Array<OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall>]
|
|
281
300
|
|
|
301
|
+
# @see OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta#audio
|
|
302
|
+
class Audio < OpenAI::Internal::Type::BaseModel
|
|
303
|
+
# @!attribute id
|
|
304
|
+
# Unique identifier for this audio response.
|
|
305
|
+
#
|
|
306
|
+
# @return [String, nil]
|
|
307
|
+
optional :id, String
|
|
308
|
+
|
|
309
|
+
# @!attribute data
|
|
310
|
+
# Base64 encoded audio bytes generated by the model, in the format specified in
|
|
311
|
+
# the request.
|
|
312
|
+
#
|
|
313
|
+
# @return [String, nil]
|
|
314
|
+
optional :data, String
|
|
315
|
+
|
|
316
|
+
# @!attribute expires_at
|
|
317
|
+
# The Unix timestamp (in seconds) for when this audio response will no longer be
|
|
318
|
+
# accessible on the server for use in multi-turn conversations.
|
|
319
|
+
#
|
|
320
|
+
# @return [Integer, nil]
|
|
321
|
+
optional :expires_at, Integer
|
|
322
|
+
|
|
323
|
+
# @!attribute transcript
|
|
324
|
+
# Transcript text from this audio chunk.
|
|
325
|
+
#
|
|
326
|
+
# @return [String, nil]
|
|
327
|
+
optional :transcript, String
|
|
328
|
+
|
|
329
|
+
# @!method initialize(id: nil, data: nil, expires_at: nil, transcript: nil)
|
|
330
|
+
# A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
331
|
+
# transcript text; the final audio update contains only its expiry timestamp.
|
|
332
|
+
#
|
|
333
|
+
# @param id [String]
|
|
334
|
+
# Unique identifier for this audio response.
|
|
335
|
+
#
|
|
336
|
+
# @param data [String]
|
|
337
|
+
# Base64 encoded audio bytes generated by the model, in the format specified in
|
|
338
|
+
# the request.
|
|
339
|
+
#
|
|
340
|
+
# @param expires_at [Integer]
|
|
341
|
+
# The Unix timestamp (in seconds) for when this audio response will no longer be
|
|
342
|
+
# accessible on the server for use in multi-turn conversations.
|
|
343
|
+
#
|
|
344
|
+
# @param transcript [String]
|
|
345
|
+
# Transcript text from this audio chunk.
|
|
346
|
+
end
|
|
347
|
+
|
|
282
348
|
# @deprecated
|
|
283
349
|
#
|
|
284
350
|
# @see OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta#function_call
|
|
@@ -409,7 +475,8 @@ module OpenAI
|
|
|
409
475
|
# number of tokens specified in the request was reached, `content_filter` if
|
|
410
476
|
# content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
411
477
|
# model called a tool, or `function_call` (deprecated) if the model called a
|
|
412
|
-
# function.
|
|
478
|
+
# function. Omitted from the final audio update containing only
|
|
479
|
+
# `delta.audio.expires_at`.
|
|
413
480
|
#
|
|
414
481
|
# @see OpenAI::Models::Chat::ChatCompletionChunk::Choice#finish_reason
|
|
415
482
|
module FinishReason
|