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
|
@@ -5009,6 +5009,11 @@ module OpenAI
|
|
|
5009
5009
|
}
|
|
5010
5010
|
attr_writer :error_type
|
|
5011
5011
|
|
|
5012
|
+
# An opaque target for explicitly continuing this review, or null when
|
|
5013
|
+
# unavailable.
|
|
5014
|
+
sig { returns(T.nilable(String)) }
|
|
5015
|
+
attr_accessor :review_target
|
|
5016
|
+
|
|
5012
5017
|
# An optional public continuation instruction.
|
|
5013
5018
|
sig {
|
|
5014
5019
|
returns(
|
|
@@ -5035,6 +5040,8 @@ module OpenAI
|
|
|
5035
5040
|
OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::ErrorType::OrSymbol
|
|
5036
5041
|
),
|
|
5037
5042
|
|
|
5043
|
+
review_target: T.nilable(String),
|
|
5044
|
+
|
|
5038
5045
|
steer: OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::Steer::OrHash
|
|
5039
5046
|
)
|
|
5040
5047
|
.returns(T.attached_class)
|
|
@@ -5047,6 +5054,10 @@ module OpenAI
|
|
|
5047
5054
|
# An optional classification; clients must accept additional values.
|
|
5048
5055
|
error_type: nil,
|
|
5049
5056
|
|
|
5057
|
+
# An opaque target for explicitly continuing this review, or null when
|
|
5058
|
+
# unavailable.
|
|
5059
|
+
review_target: nil,
|
|
5060
|
+
|
|
5050
5061
|
# An optional public continuation instruction.
|
|
5051
5062
|
|
|
5052
5063
|
steer: nil
|
|
@@ -5060,6 +5071,7 @@ module OpenAI
|
|
|
5060
5071
|
error_type: T.nilable(
|
|
5061
5072
|
OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::ErrorType::Variants
|
|
5062
5073
|
),
|
|
5074
|
+
review_target: T.nilable(String),
|
|
5063
5075
|
steer: T.nilable(
|
|
5064
5076
|
OpenAI::Beta::BetaResponsesServerEvent::BetaResponseWsError::Error::Misalignment::Steer
|
|
5065
5077
|
)
|
|
@@ -976,9 +976,10 @@ module OpenAI
|
|
|
976
976
|
sig { params(background: OpenAI::Beta::BetaTool::ImageGeneration::Background::OrSymbol).void }
|
|
977
977
|
attr_writer :background
|
|
978
978
|
|
|
979
|
-
#
|
|
980
|
-
#
|
|
981
|
-
# `gpt-image-
|
|
979
|
+
# Control how much effort the model will exert to match the style and features,
|
|
980
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
981
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
982
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
982
983
|
sig { returns(T.nilable(OpenAI::Beta::BetaTool::ImageGeneration::InputFidelity::OrSymbol)) }
|
|
983
984
|
attr_accessor :input_fidelity
|
|
984
985
|
|
|
@@ -1103,9 +1104,10 @@ module OpenAI
|
|
|
1103
1104
|
# set the output format to `png` or `webp`.
|
|
1104
1105
|
background: nil,
|
|
1105
1106
|
|
|
1106
|
-
#
|
|
1107
|
-
#
|
|
1108
|
-
# `gpt-image-
|
|
1107
|
+
# Control how much effort the model will exert to match the style and features,
|
|
1108
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
1109
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
1110
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
1109
1111
|
input_fidelity: nil,
|
|
1110
1112
|
|
|
1111
1113
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -1218,9 +1220,10 @@ module OpenAI
|
|
|
1218
1220
|
end
|
|
1219
1221
|
end
|
|
1220
1222
|
|
|
1221
|
-
#
|
|
1222
|
-
#
|
|
1223
|
-
# `gpt-image-
|
|
1223
|
+
# Control how much effort the model will exert to match the style and features,
|
|
1224
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
1225
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
1226
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
1224
1227
|
module InputFidelity
|
|
1225
1228
|
extend OpenAI::Internal::Type::Enum
|
|
1226
1229
|
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
BetaToolSearchOutputNamespaceTool = Beta::BetaToolSearchOutputNamespaceTool
|
|
7
|
+
|
|
8
|
+
module Beta
|
|
9
|
+
|
|
10
|
+
class BetaToolSearchOutputNamespaceTool < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
|
|
12
|
+
OrHash = T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool,
|
|
15
|
+
OpenAI::Internal::AnyHash
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# A description of the namespace shown to the model.
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :description
|
|
22
|
+
|
|
23
|
+
# The namespace name used in tool calls (for example, `crm`).
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :name
|
|
26
|
+
|
|
27
|
+
# The function/custom tools loaded inside this namespace.
|
|
28
|
+
sig {
|
|
29
|
+
returns(
|
|
30
|
+
T::Array[
|
|
31
|
+
T.any(OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Beta::BetaCustomTool)
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
attr_accessor :tools
|
|
36
|
+
|
|
37
|
+
# The type of the tool. Always `namespace`.
|
|
38
|
+
sig { returns(Symbol) }
|
|
39
|
+
attr_accessor :type
|
|
40
|
+
|
|
41
|
+
# Groups function/custom tools under a shared namespace.
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
|
|
45
|
+
description: String,
|
|
46
|
+
|
|
47
|
+
name: String,
|
|
48
|
+
|
|
49
|
+
tools: T::Array[
|
|
50
|
+
T.any(
|
|
51
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::OrHash,
|
|
52
|
+
OpenAI::Beta::BetaCustomTool::OrHash
|
|
53
|
+
)
|
|
54
|
+
],
|
|
55
|
+
|
|
56
|
+
type: Symbol
|
|
57
|
+
)
|
|
58
|
+
.returns(T.attached_class)
|
|
59
|
+
end
|
|
60
|
+
def self.new(
|
|
61
|
+
|
|
62
|
+
# A description of the namespace shown to the model.
|
|
63
|
+
description:,
|
|
64
|
+
|
|
65
|
+
# The namespace name used in tool calls (for example, `crm`).
|
|
66
|
+
name:,
|
|
67
|
+
|
|
68
|
+
# The function/custom tools loaded inside this namespace.
|
|
69
|
+
tools:,
|
|
70
|
+
|
|
71
|
+
# The type of the tool. Always `namespace`.
|
|
72
|
+
|
|
73
|
+
type: :namespace
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig do
|
|
78
|
+
override.returns(
|
|
79
|
+
{
|
|
80
|
+
description: String,
|
|
81
|
+
name: String,
|
|
82
|
+
tools: T::Array[
|
|
83
|
+
T.any(OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Beta::BetaCustomTool)
|
|
84
|
+
],
|
|
85
|
+
type: Symbol
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
def to_hash
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# A function or custom tool loaded into a namespace by tool search.
|
|
93
|
+
module Tool
|
|
94
|
+
extend OpenAI::Internal::Type::Union
|
|
95
|
+
|
|
96
|
+
Variants = T.type_alias {
|
|
97
|
+
T.any(OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function, OpenAI::Beta::BetaCustomTool)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
class Function < OpenAI::Internal::Type::BaseModel
|
|
101
|
+
OrHash = T.type_alias do
|
|
102
|
+
T.any(
|
|
103
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function,
|
|
104
|
+
OpenAI::Internal::AnyHash
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# The name of the loaded function tool.
|
|
109
|
+
sig { returns(String) }
|
|
110
|
+
attr_accessor :name
|
|
111
|
+
|
|
112
|
+
sig { returns(Symbol) }
|
|
113
|
+
attr_accessor :type
|
|
114
|
+
|
|
115
|
+
# The tool invocation context(s).
|
|
116
|
+
sig {
|
|
117
|
+
returns(
|
|
118
|
+
T.nilable(
|
|
119
|
+
T::Array[OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
attr_accessor :allowed_callers
|
|
124
|
+
|
|
125
|
+
# Whether the tool response can be returned asynchronously versus immediately
|
|
126
|
+
# returned on next response creation.
|
|
127
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
128
|
+
attr_reader :async
|
|
129
|
+
|
|
130
|
+
sig { params(async: T::Boolean).void }
|
|
131
|
+
attr_writer :async
|
|
132
|
+
|
|
133
|
+
# Whether this function should be deferred and discovered via tool search.
|
|
134
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
135
|
+
attr_reader :defer_loading
|
|
136
|
+
|
|
137
|
+
sig { params(defer_loading: T::Boolean).void }
|
|
138
|
+
attr_writer :defer_loading
|
|
139
|
+
|
|
140
|
+
sig { returns(T.nilable(String)) }
|
|
141
|
+
attr_accessor :description
|
|
142
|
+
|
|
143
|
+
# A JSON Schema describing the JSON value encoded in string outputs for this
|
|
144
|
+
# function tool. This does not describe content-array outputs.
|
|
145
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
146
|
+
attr_accessor :output_schema
|
|
147
|
+
|
|
148
|
+
sig { returns(T.nilable(T.anything)) }
|
|
149
|
+
attr_accessor :parameters
|
|
150
|
+
|
|
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
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
155
|
+
attr_accessor :strict
|
|
156
|
+
|
|
157
|
+
sig do
|
|
158
|
+
params(
|
|
159
|
+
|
|
160
|
+
name: String,
|
|
161
|
+
|
|
162
|
+
allowed_callers: T.nilable(
|
|
163
|
+
T::Array[OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
|
|
164
|
+
),
|
|
165
|
+
|
|
166
|
+
async: T::Boolean,
|
|
167
|
+
|
|
168
|
+
defer_loading: T::Boolean,
|
|
169
|
+
|
|
170
|
+
description: T.nilable(String),
|
|
171
|
+
|
|
172
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
173
|
+
|
|
174
|
+
parameters: T.nilable(T.anything),
|
|
175
|
+
|
|
176
|
+
strict: T.nilable(T::Boolean),
|
|
177
|
+
|
|
178
|
+
type: Symbol
|
|
179
|
+
)
|
|
180
|
+
.returns(T.attached_class)
|
|
181
|
+
end
|
|
182
|
+
def self.new(
|
|
183
|
+
|
|
184
|
+
# The name of the loaded function tool.
|
|
185
|
+
name:,
|
|
186
|
+
|
|
187
|
+
# The tool invocation context(s).
|
|
188
|
+
allowed_callers: nil,
|
|
189
|
+
|
|
190
|
+
# Whether the tool response can be returned asynchronously versus immediately
|
|
191
|
+
# returned on next response creation.
|
|
192
|
+
async: nil,
|
|
193
|
+
|
|
194
|
+
# Whether this function should be deferred and discovered via tool search.
|
|
195
|
+
defer_loading: nil,
|
|
196
|
+
|
|
197
|
+
description: nil,
|
|
198
|
+
|
|
199
|
+
# A JSON Schema describing the JSON value encoded in string outputs for this
|
|
200
|
+
# function tool. This does not describe content-array outputs.
|
|
201
|
+
output_schema: nil,
|
|
202
|
+
|
|
203
|
+
parameters: nil,
|
|
204
|
+
|
|
205
|
+
# Whether to enforce strict parameter validation. If omitted, Responses attempts
|
|
206
|
+
# to use strict validation when the schema is compatible, and falls back to
|
|
207
|
+
# non-strict validation otherwise.
|
|
208
|
+
strict: nil,
|
|
209
|
+
|
|
210
|
+
type: :function
|
|
211
|
+
)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
sig do
|
|
215
|
+
override.returns(
|
|
216
|
+
{
|
|
217
|
+
name: String,
|
|
218
|
+
type: Symbol,
|
|
219
|
+
allowed_callers: T.nilable(
|
|
220
|
+
T::Array[OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::OrSymbol]
|
|
221
|
+
),
|
|
222
|
+
async: T::Boolean,
|
|
223
|
+
defer_loading: T::Boolean,
|
|
224
|
+
description: T.nilable(String),
|
|
225
|
+
output_schema: T.nilable(T::Hash[Symbol, T.anything]),
|
|
226
|
+
parameters: T.nilable(T.anything),
|
|
227
|
+
strict: T.nilable(T::Boolean)
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
end
|
|
231
|
+
def to_hash
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
module AllowedCaller
|
|
235
|
+
extend OpenAI::Internal::Type::Enum
|
|
236
|
+
|
|
237
|
+
TaggedSymbol = T.type_alias {
|
|
238
|
+
T.all(Symbol, OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller)
|
|
239
|
+
}
|
|
240
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
241
|
+
|
|
242
|
+
DIRECT = T.let(
|
|
243
|
+
:direct,
|
|
244
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
|
|
245
|
+
)
|
|
246
|
+
PROGRAMMATIC = T.let(
|
|
247
|
+
:programmatic,
|
|
248
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
sig {
|
|
252
|
+
override.returns(
|
|
253
|
+
T::Array[OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller::TaggedSymbol]
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
def self.values
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
sig { override.returns(T::Array[OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Variants]) }
|
|
262
|
+
def self.variants
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
end
|
|
272
|
+
end
|
|
@@ -114,8 +114,8 @@ module OpenAI
|
|
|
114
114
|
}
|
|
115
115
|
attr_accessor :files
|
|
116
116
|
|
|
117
|
-
# Network access policy for the environment.
|
|
118
|
-
#
|
|
117
|
+
# Network access policy for the environment. If omitted, the API version
|
|
118
|
+
# determines whether network access is enabled or disabled.
|
|
119
119
|
sig { returns(T.nilable(OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network)) }
|
|
120
120
|
attr_reader :network
|
|
121
121
|
|
|
@@ -216,8 +216,8 @@ module OpenAI
|
|
|
216
216
|
# Files available before the agent starts. Defaults to an empty list.
|
|
217
217
|
files: nil,
|
|
218
218
|
|
|
219
|
-
# Network access policy for the environment.
|
|
220
|
-
#
|
|
219
|
+
# Network access policy for the environment. If omitted, the API version
|
|
220
|
+
# determines whether network access is enabled or disabled.
|
|
221
221
|
network: nil,
|
|
222
222
|
|
|
223
223
|
# Packages to install in the environment. Defaults to empty package lists.
|
|
@@ -350,8 +350,8 @@ module OpenAI
|
|
|
350
350
|
sig { returns(T.nilable(T::Array[String])) }
|
|
351
351
|
attr_accessor :blocked_domains
|
|
352
352
|
|
|
353
|
-
# Network access policy for the environment.
|
|
354
|
-
#
|
|
353
|
+
# Network access policy for the environment. If omitted, the API version
|
|
354
|
+
# determines whether network access is enabled or disabled.
|
|
355
355
|
sig do
|
|
356
356
|
params(
|
|
357
357
|
|
|
@@ -67,6 +67,24 @@ module OpenAI
|
|
|
67
67
|
# The organization has reached a usage, plan, or billing limit.
|
|
68
68
|
USAGE_LIMIT_EXCEEDED = T.let(:usage_limit_exceeded, OpenAI::Beta::SessionTurnError::Code::TaggedSymbol)
|
|
69
69
|
|
|
70
|
+
# The project has reached its enforced spend limit.
|
|
71
|
+
PROJECT_SPEND_LIMIT_EXCEEDED = T.let(
|
|
72
|
+
:project_spend_limit_exceeded,
|
|
73
|
+
OpenAI::Beta::SessionTurnError::Code::TaggedSymbol
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# The organization has reached its enforced spend limit.
|
|
77
|
+
ORGANIZATION_SPEND_LIMIT_EXCEEDED = T.let(
|
|
78
|
+
:organization_spend_limit_exceeded,
|
|
79
|
+
OpenAI::Beta::SessionTurnError::Code::TaggedSymbol
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# The organization has reached its OpenAI-assigned usage limit.
|
|
83
|
+
ORGANIZATION_USAGE_LIMIT_EXCEEDED = T.let(
|
|
84
|
+
:organization_usage_limit_exceeded,
|
|
85
|
+
OpenAI::Beta::SessionTurnError::Code::TaggedSymbol
|
|
86
|
+
)
|
|
87
|
+
|
|
70
88
|
# The organization has no API credits remaining.
|
|
71
89
|
CREDIT_BALANCE_EXHAUSTED = T.let(
|
|
72
90
|
:credit_balance_exhausted,
|
|
@@ -228,26 +228,29 @@ module OpenAI
|
|
|
228
228
|
)
|
|
229
229
|
end
|
|
230
230
|
|
|
231
|
-
# A chat completion delta generated by streamed model responses.
|
|
231
|
+
# A chat completion delta generated by streamed model responses. Streamed audio
|
|
232
|
+
# can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
233
|
+
# final audio update contains only its expiry timestamp.
|
|
232
234
|
sig { returns(OpenAI::Chat::ChatCompletionChunk::Choice::Delta) }
|
|
233
235
|
attr_reader :delta
|
|
234
236
|
|
|
235
237
|
sig { params(delta: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::OrHash).void }
|
|
236
238
|
attr_writer :delta
|
|
237
239
|
|
|
240
|
+
# The index of the choice in the list of choices.
|
|
241
|
+
sig { returns(Integer) }
|
|
242
|
+
attr_accessor :index
|
|
243
|
+
|
|
238
244
|
# The reason the model stopped generating tokens. This will be `stop` if the model
|
|
239
245
|
# hit a natural stop point or a provided stop sequence, `length` if the maximum
|
|
240
246
|
# number of tokens specified in the request was reached, `content_filter` if
|
|
241
247
|
# content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
242
248
|
# model called a tool, or `function_call` (deprecated) if the model called a
|
|
243
|
-
# function.
|
|
249
|
+
# function. Omitted from the final audio update containing only
|
|
250
|
+
# `delta.audio.expires_at`.
|
|
244
251
|
sig { returns(T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol)) }
|
|
245
252
|
attr_accessor :finish_reason
|
|
246
253
|
|
|
247
|
-
# The index of the choice in the list of choices.
|
|
248
|
-
sig { returns(Integer) }
|
|
249
|
-
attr_accessor :index
|
|
250
|
-
|
|
251
254
|
# Log probability information for the choice.
|
|
252
255
|
sig { returns(T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs)) }
|
|
253
256
|
attr_reader :logprobs
|
|
@@ -260,29 +263,32 @@ module OpenAI
|
|
|
260
263
|
|
|
261
264
|
delta: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::OrHash,
|
|
262
265
|
|
|
263
|
-
finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::OrSymbol),
|
|
264
|
-
|
|
265
266
|
index: Integer,
|
|
266
267
|
|
|
268
|
+
finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::OrSymbol),
|
|
269
|
+
|
|
267
270
|
logprobs: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs::OrHash)
|
|
268
271
|
)
|
|
269
272
|
.returns(T.attached_class)
|
|
270
273
|
end
|
|
271
274
|
def self.new(
|
|
272
275
|
|
|
273
|
-
# A chat completion delta generated by streamed model responses.
|
|
276
|
+
# A chat completion delta generated by streamed model responses. Streamed audio
|
|
277
|
+
# can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
278
|
+
# final audio update contains only its expiry timestamp.
|
|
274
279
|
delta:,
|
|
275
280
|
|
|
281
|
+
# The index of the choice in the list of choices.
|
|
282
|
+
index:,
|
|
283
|
+
|
|
276
284
|
# The reason the model stopped generating tokens. This will be `stop` if the model
|
|
277
285
|
# hit a natural stop point or a provided stop sequence, `length` if the maximum
|
|
278
286
|
# number of tokens specified in the request was reached, `content_filter` if
|
|
279
287
|
# content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
280
288
|
# model called a tool, or `function_call` (deprecated) if the model called a
|
|
281
|
-
# function.
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
# The index of the choice in the list of choices.
|
|
285
|
-
index:,
|
|
289
|
+
# function. Omitted from the final audio update containing only
|
|
290
|
+
# `delta.audio.expires_at`.
|
|
291
|
+
finish_reason: nil,
|
|
286
292
|
|
|
287
293
|
# Log probability information for the choice.
|
|
288
294
|
|
|
@@ -294,8 +300,8 @@ module OpenAI
|
|
|
294
300
|
override.returns(
|
|
295
301
|
{
|
|
296
302
|
delta: OpenAI::Chat::ChatCompletionChunk::Choice::Delta,
|
|
297
|
-
finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol),
|
|
298
303
|
index: Integer,
|
|
304
|
+
finish_reason: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol),
|
|
299
305
|
logprobs: T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Logprobs)
|
|
300
306
|
}
|
|
301
307
|
)
|
|
@@ -311,6 +317,14 @@ module OpenAI
|
|
|
311
317
|
)
|
|
312
318
|
end
|
|
313
319
|
|
|
320
|
+
# A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
321
|
+
# transcript text; the final audio update contains only its expiry timestamp.
|
|
322
|
+
sig { returns(T.nilable(OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio)) }
|
|
323
|
+
attr_reader :audio
|
|
324
|
+
|
|
325
|
+
sig { params(audio: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio::OrHash).void }
|
|
326
|
+
attr_writer :audio
|
|
327
|
+
|
|
314
328
|
# The contents of the chunk message.
|
|
315
329
|
sig { returns(T.nilable(String)) }
|
|
316
330
|
attr_accessor :content
|
|
@@ -342,10 +356,14 @@ module OpenAI
|
|
|
342
356
|
}
|
|
343
357
|
attr_writer :tool_calls
|
|
344
358
|
|
|
345
|
-
# A chat completion delta generated by streamed model responses.
|
|
359
|
+
# A chat completion delta generated by streamed model responses. Streamed audio
|
|
360
|
+
# can arrive in partial updates with an ID, base64 data, or transcript text. The
|
|
361
|
+
# final audio update contains only its expiry timestamp.
|
|
346
362
|
sig do
|
|
347
363
|
params(
|
|
348
364
|
|
|
365
|
+
audio: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio::OrHash,
|
|
366
|
+
|
|
349
367
|
content: T.nilable(String),
|
|
350
368
|
|
|
351
369
|
function_call: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall::OrHash,
|
|
@@ -360,6 +378,10 @@ module OpenAI
|
|
|
360
378
|
end
|
|
361
379
|
def self.new(
|
|
362
380
|
|
|
381
|
+
# A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
382
|
+
# transcript text; the final audio update contains only its expiry timestamp.
|
|
383
|
+
audio: nil,
|
|
384
|
+
|
|
363
385
|
# The contents of the chunk message.
|
|
364
386
|
content: nil,
|
|
365
387
|
|
|
@@ -380,6 +402,7 @@ module OpenAI
|
|
|
380
402
|
sig do
|
|
381
403
|
override.returns(
|
|
382
404
|
{
|
|
405
|
+
audio: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio,
|
|
383
406
|
content: T.nilable(String),
|
|
384
407
|
function_call: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall,
|
|
385
408
|
refusal: T.nilable(String),
|
|
@@ -391,6 +414,88 @@ module OpenAI
|
|
|
391
414
|
def to_hash
|
|
392
415
|
end
|
|
393
416
|
|
|
417
|
+
class Audio < OpenAI::Internal::Type::BaseModel
|
|
418
|
+
OrHash = T.type_alias do
|
|
419
|
+
T.any(
|
|
420
|
+
OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Audio,
|
|
421
|
+
OpenAI::Internal::AnyHash
|
|
422
|
+
)
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
# Unique identifier for this audio response.
|
|
426
|
+
sig { returns(T.nilable(String)) }
|
|
427
|
+
attr_reader :id
|
|
428
|
+
|
|
429
|
+
sig { params(id: String).void }
|
|
430
|
+
attr_writer :id
|
|
431
|
+
|
|
432
|
+
# Base64 encoded audio bytes generated by the model, in the format specified in
|
|
433
|
+
# the request.
|
|
434
|
+
sig { returns(T.nilable(String)) }
|
|
435
|
+
attr_reader :data
|
|
436
|
+
|
|
437
|
+
sig { params(data: String).void }
|
|
438
|
+
attr_writer :data
|
|
439
|
+
|
|
440
|
+
# The Unix timestamp (in seconds) for when this audio response will no longer be
|
|
441
|
+
# accessible on the server for use in multi-turn conversations.
|
|
442
|
+
sig { returns(T.nilable(Integer)) }
|
|
443
|
+
attr_reader :expires_at
|
|
444
|
+
|
|
445
|
+
sig { params(expires_at: Integer).void }
|
|
446
|
+
attr_writer :expires_at
|
|
447
|
+
|
|
448
|
+
# Transcript text from this audio chunk.
|
|
449
|
+
sig { returns(T.nilable(String)) }
|
|
450
|
+
attr_reader :transcript
|
|
451
|
+
|
|
452
|
+
sig { params(transcript: String).void }
|
|
453
|
+
attr_writer :transcript
|
|
454
|
+
|
|
455
|
+
# A partial audio response. Audio chunks may carry an ID, base64 data, or
|
|
456
|
+
# transcript text; the final audio update contains only its expiry timestamp.
|
|
457
|
+
sig do
|
|
458
|
+
params(
|
|
459
|
+
|
|
460
|
+
id: String,
|
|
461
|
+
|
|
462
|
+
data: String,
|
|
463
|
+
|
|
464
|
+
expires_at: Integer,
|
|
465
|
+
|
|
466
|
+
transcript: String
|
|
467
|
+
)
|
|
468
|
+
.returns(T.attached_class)
|
|
469
|
+
end
|
|
470
|
+
def self.new(
|
|
471
|
+
|
|
472
|
+
# Unique identifier for this audio response.
|
|
473
|
+
id: nil,
|
|
474
|
+
|
|
475
|
+
# Base64 encoded audio bytes generated by the model, in the format specified in
|
|
476
|
+
# the request.
|
|
477
|
+
data: nil,
|
|
478
|
+
|
|
479
|
+
# The Unix timestamp (in seconds) for when this audio response will no longer be
|
|
480
|
+
# accessible on the server for use in multi-turn conversations.
|
|
481
|
+
expires_at: nil,
|
|
482
|
+
|
|
483
|
+
# Transcript text from this audio chunk.
|
|
484
|
+
|
|
485
|
+
transcript: nil
|
|
486
|
+
)
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
sig do
|
|
490
|
+
override.returns(
|
|
491
|
+
{id: String, data: String, expires_at: Integer, transcript: String}
|
|
492
|
+
)
|
|
493
|
+
end
|
|
494
|
+
def to_hash
|
|
495
|
+
end
|
|
496
|
+
|
|
497
|
+
end
|
|
498
|
+
|
|
394
499
|
class FunctionCall < OpenAI::Internal::Type::BaseModel
|
|
395
500
|
OrHash = T.type_alias do
|
|
396
501
|
T.any(
|
|
@@ -633,7 +738,8 @@ module OpenAI
|
|
|
633
738
|
# number of tokens specified in the request was reached, `content_filter` if
|
|
634
739
|
# content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
635
740
|
# model called a tool, or `function_call` (deprecated) if the model called a
|
|
636
|
-
# function.
|
|
741
|
+
# function. Omitted from the final audio update containing only
|
|
742
|
+
# `delta.audio.expires_at`.
|
|
637
743
|
module FinishReason
|
|
638
744
|
extend OpenAI::Internal::Type::Enum
|
|
639
745
|
|