openai 0.83.0 → 0.85.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 +59 -0
- data/README.md +1 -1
- data/SECURITY.md +10 -0
- data/docs/architecture/security-model.md +267 -0
- data/lib/openai/auth/workload_identity_auth.rb +17 -2
- data/lib/openai/client.rb +24 -6
- data/lib/openai/errors.rb +1 -1
- data/lib/openai/helpers/streaming/chat_completion_stream.rb +18 -10
- data/lib/openai/helpers/streaming/response_events.rb +2 -2
- data/lib/openai/helpers/streaming/response_stream.rb +80 -44
- data/lib/openai/helpers/structured_output/array_of.rb +2 -2
- data/lib/openai/helpers/structured_output/base_model.rb +19 -5
- data/lib/openai/helpers/structured_output/chat_completion_parser.rb +12 -3
- data/lib/openai/helpers/structured_output/json_schema_converter.rb +34 -11
- data/lib/openai/helpers/structured_output/response_parser.rb +1 -1
- data/lib/openai/internal/type/base_model.rb +2 -2
- data/lib/openai/internal/type/converter.rb +1 -1
- data/lib/openai/internal/util.rb +2 -2
- data/lib/openai/internal/vector_store_file_uploader.rb +1 -1
- data/lib/openai/models/admin/organization/usage_costs_params.rb +10 -1
- data/lib/openai/models/batch.rb +4 -4
- data/lib/openai/models/beta/beta_custom_tool.rb +13 -1
- data/lib/openai/models/beta/beta_function_tool.rb +8 -1
- data/lib/openai/models/beta/beta_namespace_tool.rb +10 -1
- data/lib/openai/models/beta/beta_response.rb +26 -18
- data/lib/openai/models/beta/beta_response_configuration_update_item.rb +103 -0
- data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +104 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call.rb +9 -1
- data/lib/openai/models/beta/beta_response_custom_tool_call_item.rb +3 -1
- data/lib/openai/models/beta/beta_response_error.rb +96 -1
- data/lib/openai/models/beta/beta_response_function_tool_call.rb +9 -1
- data/lib/openai/models/beta/beta_response_function_tool_call_item.rb +3 -1
- data/lib/openai/models/beta/beta_response_incomplete_event.rb +4 -0
- data/lib/openai/models/beta/beta_response_inject_event.rb +2 -2
- data/lib/openai/models/beta/beta_response_inject_failed_event.rb +2 -2
- data/lib/openai/models/beta/beta_response_input_item.rb +6 -1
- data/lib/openai/models/beta/beta_response_item.rb +5 -1
- data/lib/openai/models/beta/beta_response_steer_accepted_event.rb +81 -0
- data/lib/openai/models/beta/beta_response_steer_error_code.rb +61 -0
- data/lib/openai/models/beta/beta_response_steer_event.rb +75 -0
- data/lib/openai/models/beta/beta_response_steer_failed_event.rb +151 -0
- data/lib/openai/models/beta/beta_response_steer_input.rb +360 -0
- data/lib/openai/models/beta/beta_response_steer_input_content.rb +28 -0
- data/lib/openai/models/beta/beta_response_steer_pending_event.rb +113 -0
- data/lib/openai/models/beta/beta_response_steer_pending_reason.rb +26 -0
- data/lib/openai/models/beta/beta_response_steer_required_input.rb +215 -0
- data/lib/openai/models/beta/beta_response_stream_event.rb +4 -0
- data/lib/openai/models/beta/beta_response_usage.rb +1 -12
- data/lib/openai/models/beta/beta_responses_client_event.rb +45 -16
- data/lib/openai/models/beta/beta_responses_server_event.rb +164 -2
- data/lib/openai/models/beta/response_compact_params.rb +13 -10
- data/lib/openai/models/beta/response_create_params.rb +14 -15
- data/lib/openai/models/beta/responses/beta_response_item_list.rb +2 -2
- data/lib/openai/models/beta/responses/input_token_count_params.rb +3 -3
- data/lib/openai/models/chat/completion_create_params.rb +8 -8
- data/lib/openai/models/chat_model.rb +1 -0
- data/lib/openai/models/completion_usage.rb +1 -12
- data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
- data/lib/openai/models/conversations/conversation_item.rb +5 -1
- data/lib/openai/models/conversations/conversation_item_list.rb +2 -2
- data/lib/openai/models/conversations/item_create_params.rb +2 -2
- data/lib/openai/models/error_object.rb +90 -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/evals/create_eval_completions_run_data_source.rb +2 -2
- data/lib/openai/models/reasoning.rb +0 -2
- data/lib/openai/models/responses/custom_tool.rb +13 -1
- data/lib/openai/models/responses/function_tool.rb +8 -1
- data/lib/openai/models/responses/input_token_count_params.rb +3 -3
- data/lib/openai/models/responses/namespace_tool.rb +10 -1
- data/lib/openai/models/responses/response.rb +20 -13
- data/lib/openai/models/responses/response_compact_params.rb +13 -10
- data/lib/openai/models/responses/response_configuration_update_item.rb +56 -0
- data/lib/openai/models/responses/response_configuration_update_item_param.rb +57 -0
- data/lib/openai/models/responses/response_create_params.rb +8 -10
- data/lib/openai/models/responses/response_custom_tool_call.rb +9 -1
- data/lib/openai/models/responses/response_custom_tool_call_item.rb +3 -1
- data/lib/openai/models/responses/response_error.rb +96 -1
- data/lib/openai/models/responses/response_function_tool_call.rb +9 -1
- data/lib/openai/models/responses/response_function_tool_call_item.rb +3 -1
- data/lib/openai/models/responses/response_incomplete_event.rb +4 -0
- data/lib/openai/models/responses/response_input_item.rb +6 -1
- data/lib/openai/models/responses/response_item.rb +5 -1
- data/lib/openai/models/responses/response_item_list.rb +2 -2
- data/lib/openai/models/responses/response_steer_accepted_event.rb +79 -0
- data/lib/openai/models/responses/response_steer_error_code.rb +59 -0
- data/lib/openai/models/responses/response_steer_event.rb +73 -0
- data/lib/openai/models/responses/response_steer_failed_event.rb +149 -0
- data/lib/openai/models/responses/response_steer_input.rb +304 -0
- data/lib/openai/models/responses/response_steer_input_content.rb +26 -0
- data/lib/openai/models/responses/response_steer_pending_event.rb +111 -0
- data/lib/openai/models/responses/response_steer_pending_reason.rb +24 -0
- data/lib/openai/models/responses/response_steer_required_input.rb +213 -0
- data/lib/openai/models/responses/response_stream_event.rb +4 -0
- data/lib/openai/models/responses/response_usage.rb +1 -12
- data/lib/openai/models/responses/responses_client_event.rb +872 -771
- data/lib/openai/models/responses/responses_server_event.rb +162 -2
- data/lib/openai/models/safety/alert_retrieve_params.rb +24 -0
- data/lib/openai/models/safety/safety_alert.rb +96 -0
- data/lib/openai/models/video_create_error.rb +93 -1
- data/lib/openai/models/webhooks/safety_alert_created_webhook_event.rb +63 -0
- data/lib/openai/models/webhooks/safety_org_alert_created_webhook_event.rb +63 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +7 -1
- data/lib/openai/models.rb +2 -0
- data/lib/openai/net_http_client.rb +1 -1
- data/lib/openai/providers/bedrock.rb +20 -12
- data/lib/openai/resources/admin/organization/usage.rb +3 -1
- data/lib/openai/resources/beta/responses/input_items.rb +1 -1
- data/lib/openai/resources/beta/responses/input_tokens.rb +1 -1
- data/lib/openai/resources/beta/responses.rb +8 -8
- data/lib/openai/resources/chat/completions.rb +2 -2
- data/lib/openai/resources/conversations/items.rb +3 -3
- data/lib/openai/resources/conversations.rb +1 -1
- data/lib/openai/resources/responses/input_items.rb +1 -1
- data/lib/openai/resources/responses/input_tokens.rb +1 -1
- data/lib/openai/resources/responses.rb +10 -9
- data/lib/openai/resources/safety/alerts.rb +37 -0
- data/lib/openai/resources/safety.rb +18 -0
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +29 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/errors.rbi +1 -1
- data/rbi/openai/helpers/streaming/events.rbi +2 -2
- data/rbi/openai/helpers/streaming/response_stream.rbi +3 -3
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +15 -0
- data/rbi/openai/models/batch.rbi +6 -6
- data/rbi/openai/models/beta/beta_custom_tool.rbi +15 -0
- data/rbi/openai/models/beta/beta_function_tool.rbi +11 -0
- data/rbi/openai/models/beta/beta_namespace_tool.rbi +15 -0
- data/rbi/openai/models/beta/beta_response.rbi +21 -18
- data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +200 -0
- data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +207 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call.rbi +13 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call_item.rbi +6 -0
- data/rbi/openai/models/beta/beta_response_error.rbi +161 -3
- data/rbi/openai/models/beta/beta_response_function_tool_call.rbi +13 -0
- data/rbi/openai/models/beta/beta_response_function_tool_call_item.rbi +6 -0
- data/rbi/openai/models/beta/beta_response_incomplete_event.rbi +4 -0
- data/rbi/openai/models/beta/beta_response_inject_event.rbi +3 -0
- data/rbi/openai/models/beta/beta_response_inject_failed_event.rbi +3 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +1 -0
- data/rbi/openai/models/beta/beta_response_item.rbi +1 -0
- data/rbi/openai/models/beta/beta_response_steer_accepted_event.rbi +148 -0
- data/rbi/openai/models/beta/beta_response_steer_error_code.rbi +65 -0
- data/rbi/openai/models/beta/beta_response_steer_event.rbi +118 -0
- data/rbi/openai/models/beta/beta_response_steer_failed_event.rbi +267 -0
- data/rbi/openai/models/beta/beta_response_steer_input.rbi +602 -0
- data/rbi/openai/models/beta/beta_response_steer_input_content.rbi +31 -0
- data/rbi/openai/models/beta/beta_response_steer_pending_event.rbi +222 -0
- data/rbi/openai/models/beta/beta_response_steer_pending_reason.rbi +35 -0
- data/rbi/openai/models/beta/beta_response_steer_required_input.rbi +379 -0
- data/rbi/openai/models/beta/beta_response_usage.rbi +3 -13
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +14 -15
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +206 -3
- data/rbi/openai/models/beta/response_compact_params.rbi +10 -9
- data/rbi/openai/models/beta/response_create_params.rbi +10 -15
- data/rbi/openai/models/beta/responses/beta_response_item_list.rbi +1 -0
- data/rbi/openai/models/chat/completion_create_params.rbi +9 -9
- data/rbi/openai/models/chat_model.rbi +1 -0
- data/rbi/openai/models/completion_usage.rbi +0 -10
- data/rbi/openai/models/conversations/conversation_create_params.rbi +3 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +1 -0
- data/rbi/openai/models/conversations/conversation_item_list.rbi +1 -0
- data/rbi/openai/models/conversations/item_create_params.rbi +3 -0
- data/rbi/openai/models/error_object.rbi +156 -3
- 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/evals/create_eval_completions_run_data_source.rbi +2 -2
- data/rbi/openai/models/reasoning.rbi +0 -2
- data/rbi/openai/models/responses/custom_tool.rbi +15 -0
- data/rbi/openai/models/responses/function_tool.rbi +11 -0
- data/rbi/openai/models/responses/namespace_tool.rbi +15 -0
- data/rbi/openai/models/responses/response.rbi +17 -13
- data/rbi/openai/models/responses/response_compact_params.rbi +10 -9
- data/rbi/openai/models/responses/response_configuration_update_item.rbi +112 -0
- data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +117 -0
- data/rbi/openai/models/responses/response_create_params.rbi +6 -10
- data/rbi/openai/models/responses/response_custom_tool_call.rbi +13 -0
- data/rbi/openai/models/responses/response_custom_tool_call_item.rbi +6 -0
- data/rbi/openai/models/responses/response_error.rbi +161 -3
- data/rbi/openai/models/responses/response_function_tool_call.rbi +13 -0
- data/rbi/openai/models/responses/response_function_tool_call_item.rbi +6 -0
- data/rbi/openai/models/responses/response_incomplete_event.rbi +4 -0
- data/rbi/openai/models/responses/response_input_item.rbi +1 -0
- data/rbi/openai/models/responses/response_item.rbi +1 -0
- data/rbi/openai/models/responses/response_item_list.rbi +1 -0
- data/rbi/openai/models/responses/response_steer_accepted_event.rbi +146 -0
- data/rbi/openai/models/responses/response_steer_error_code.rbi +63 -0
- data/rbi/openai/models/responses/response_steer_event.rbi +119 -0
- data/rbi/openai/models/responses/response_steer_failed_event.rbi +268 -0
- data/rbi/openai/models/responses/response_steer_input.rbi +474 -0
- data/rbi/openai/models/responses/response_steer_input_content.rbi +29 -0
- data/rbi/openai/models/responses/response_steer_pending_event.rbi +220 -0
- data/rbi/openai/models/responses/response_steer_pending_reason.rbi +33 -0
- data/rbi/openai/models/responses/response_steer_required_input.rbi +377 -0
- data/rbi/openai/models/responses/response_usage.rbi +3 -13
- data/rbi/openai/models/responses/responses_client_event.rbi +1205 -1041
- data/rbi/openai/models/responses/responses_server_event.rbi +202 -3
- data/rbi/openai/models/safety/alert_retrieve_params.rbi +55 -0
- data/rbi/openai/models/safety/safety_alert.rbi +147 -0
- data/rbi/openai/models/video_create_error.rbi +149 -3
- data/rbi/openai/models/webhooks/safety_alert_created_webhook_event.rbi +130 -0
- data/rbi/openai/models/webhooks/safety_org_alert_created_webhook_event.rbi +130 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +3 -1
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +4 -0
- data/rbi/openai/resources/beta/responses.rbi +7 -11
- data/rbi/openai/resources/chat/completions.rbi +6 -6
- data/rbi/openai/resources/conversations/items.rbi +1 -0
- data/rbi/openai/resources/conversations.rbi +1 -0
- data/rbi/openai/resources/responses.rbi +9 -13
- data/rbi/openai/resources/safety/alerts.rbi +30 -0
- data/rbi/openai/resources/safety.rbi +18 -0
- data/rbi/openai/resources/webhooks.rbi +3 -1
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/errors.rbs +1 -1
- data/sig/openai/internal/transport/base_client.rbs +4 -19
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +7 -0
- data/sig/openai/models/beta/beta_custom_tool.rbs +7 -0
- data/sig/openai/models/beta/beta_function_tool.rbs +7 -0
- data/sig/openai/models/beta/beta_namespace_tool.rbs +7 -0
- data/sig/openai/models/beta/beta_response.rbs +7 -2
- data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +91 -0
- data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +87 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call.rbs +7 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call_item.rbs +3 -0
- data/sig/openai/models/beta/beta_response_error.rbs +82 -3
- data/sig/openai/models/beta/beta_response_function_tool_call.rbs +7 -0
- data/sig/openai/models/beta/beta_response_function_tool_call_item.rbs +3 -0
- data/sig/openai/models/beta/beta_response_input_item.rbs +1 -0
- data/sig/openai/models/beta/beta_response_item.rbs +1 -0
- data/sig/openai/models/beta/beta_response_steer_accepted_event.rbs +53 -0
- data/sig/openai/models/beta/beta_response_steer_error_code.rbs +31 -0
- data/sig/openai/models/beta/beta_response_steer_event.rbs +34 -0
- data/sig/openai/models/beta/beta_response_steer_failed_event.rbs +102 -0
- data/sig/openai/models/beta/beta_response_steer_input.rbs +214 -0
- data/sig/openai/models/beta/beta_response_steer_input_content.rbs +18 -0
- data/sig/openai/models/beta/beta_response_steer_pending_event.rbs +63 -0
- data/sig/openai/models/beta/beta_response_steer_pending_reason.rbs +16 -0
- data/sig/openai/models/beta/beta_response_steer_required_input.rbs +161 -0
- data/sig/openai/models/beta/beta_response_usage.rbs +3 -8
- data/sig/openai/models/beta/beta_responses_client_event.rbs +4 -1
- data/sig/openai/models/beta/beta_responses_server_event.rbs +80 -3
- data/sig/openai/models/beta/response_compact_params.rbs +3 -1
- data/sig/openai/models/beta/response_create_params.rbs +3 -1
- data/sig/openai/models/chat_model.rbs +3 -1
- data/sig/openai/models/completion_usage.rbs +0 -5
- data/sig/openai/models/conversations/conversation_item.rbs +1 -0
- data/sig/openai/models/error_object.rbs +82 -3
- data/sig/openai/models/responses/custom_tool.rbs +7 -0
- data/sig/openai/models/responses/function_tool.rbs +7 -0
- data/sig/openai/models/responses/namespace_tool.rbs +7 -0
- data/sig/openai/models/responses/response.rbs +4 -1
- data/sig/openai/models/responses/response_compact_params.rbs +3 -1
- data/sig/openai/models/responses/response_configuration_update_item.rbs +46 -0
- data/sig/openai/models/responses/response_configuration_update_item_param.rbs +46 -0
- data/sig/openai/models/responses/response_custom_tool_call.rbs +7 -0
- data/sig/openai/models/responses/response_custom_tool_call_item.rbs +3 -0
- data/sig/openai/models/responses/response_error.rbs +79 -3
- data/sig/openai/models/responses/response_function_tool_call.rbs +7 -0
- data/sig/openai/models/responses/response_function_tool_call_item.rbs +3 -0
- data/sig/openai/models/responses/response_input_item.rbs +1 -0
- data/sig/openai/models/responses/response_item.rbs +1 -0
- data/sig/openai/models/responses/response_steer_accepted_event.rbs +51 -0
- data/sig/openai/models/responses/response_steer_error_code.rbs +29 -0
- data/sig/openai/models/responses/response_steer_event.rbs +32 -0
- data/sig/openai/models/responses/response_steer_failed_event.rbs +100 -0
- data/sig/openai/models/responses/response_steer_input.rbs +182 -0
- data/sig/openai/models/responses/response_steer_input_content.rbs +16 -0
- data/sig/openai/models/responses/response_steer_pending_event.rbs +61 -0
- data/sig/openai/models/responses/response_steer_pending_reason.rbs +13 -0
- data/sig/openai/models/responses/response_steer_required_input.rbs +159 -0
- data/sig/openai/models/responses/response_usage.rbs +3 -8
- data/sig/openai/models/responses/responses_client_event.rbs +355 -344
- data/sig/openai/models/responses/responses_server_event.rbs +80 -3
- data/sig/openai/models/safety/alert_retrieve_params.rbs +22 -0
- data/sig/openai/models/safety/safety_alert.rbs +81 -0
- data/sig/openai/models/video_create_error.rbs +87 -3
- data/sig/openai/models/webhooks/safety_alert_created_webhook_event.rbs +52 -0
- data/sig/openai/models/webhooks/safety_org_alert_created_webhook_event.rbs +52 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +2 -0
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/admin/organization/usage.rbs +1 -0
- data/sig/openai/resources/safety/alerts.rbs +14 -0
- data/sig/openai/resources/safety.rbs +9 -0
- data/sig/openai/resources/webhooks.rbs +3 -1
- metadata +86 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Responses
|
|
7
|
+
|
|
8
|
+
# A machine-readable steering error code. Clients should handle unknown values
|
|
9
|
+
# because additional codes may be introduced. Known values include:
|
|
10
|
+
#
|
|
11
|
+
# - `response_not_found`: The target response is not available on this connection.
|
|
12
|
+
# - `invalid_input`: The event or input failed validation.
|
|
13
|
+
# - `steering_not_supported`: The model or response execution mode does not
|
|
14
|
+
# support steering.
|
|
15
|
+
# - `too_many_pending_steers`: Too much steering input is pending for the
|
|
16
|
+
# response.
|
|
17
|
+
# - `response_already_completed`: The response completed and is no longer
|
|
18
|
+
# accepting steering input.
|
|
19
|
+
# - `response_not_active`: The response is no longer accepting steering input.
|
|
20
|
+
# - `successor_creation_failed`: The successor response could not be created.
|
|
21
|
+
module ResponseSteerErrorCode
|
|
22
|
+
extend OpenAI::Internal::Type::Union
|
|
23
|
+
|
|
24
|
+
Variants = T.type_alias do
|
|
25
|
+
T.any(
|
|
26
|
+
OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol,
|
|
27
|
+
String
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig { override.returns(T::Array[OpenAI::Responses::ResponseSteerErrorCode::Variants]) }
|
|
32
|
+
def self.variants
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
TaggedSymbol = T.type_alias do
|
|
36
|
+
T.all(Symbol, OpenAI::Responses::ResponseSteerErrorCode)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
40
|
+
|
|
41
|
+
RESPONSE_NOT_FOUND = T.let(:response_not_found, OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol)
|
|
42
|
+
INVALID_INPUT = T.let(:invalid_input, OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol)
|
|
43
|
+
STEERING_NOT_SUPPORTED = T.let(:steering_not_supported, OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol)
|
|
44
|
+
TOO_MANY_PENDING_STEERS = T.let(
|
|
45
|
+
:too_many_pending_steers,
|
|
46
|
+
OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol
|
|
47
|
+
)
|
|
48
|
+
RESPONSE_ALREADY_COMPLETED = T.let(
|
|
49
|
+
:response_already_completed,
|
|
50
|
+
OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol
|
|
51
|
+
)
|
|
52
|
+
RESPONSE_NOT_ACTIVE = T.let(:response_not_active, OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol)
|
|
53
|
+
SUCCESSOR_CREATION_FAILED = T.let(
|
|
54
|
+
:successor_creation_failed,
|
|
55
|
+
OpenAI::Responses::ResponseSteerErrorCode::TaggedSymbol
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Responses
|
|
7
|
+
|
|
8
|
+
class ResponseSteerEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Responses::ResponseSteerEvent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Input to queue for a continuation of the response. Uses the same string or
|
|
18
|
+
# input-item shape as `response.create.input`, with a non-empty array when
|
|
19
|
+
# supplying input items.
|
|
20
|
+
#
|
|
21
|
+
# Steering accepts only messages with the `user` role. Each message may contain
|
|
22
|
+
# only `type`, `role`, and `content`, with `content` as a string or an array of
|
|
23
|
+
# `input_text`, `input_image`, and `input_file` parts. The optional `type` must be
|
|
24
|
+
# `message`. Other roles, tool outputs, and item types are not supported for
|
|
25
|
+
# steering.
|
|
26
|
+
sig {
|
|
27
|
+
returns(T.any(String, T::Array[OpenAI::Responses::ResponseSteerInput::ResponseSteerInputItemList::Variants]))
|
|
28
|
+
}
|
|
29
|
+
attr_accessor :input
|
|
30
|
+
|
|
31
|
+
# The ID of the response to steer on this WebSocket connection.
|
|
32
|
+
sig { returns(String) }
|
|
33
|
+
attr_accessor :previous_response_id
|
|
34
|
+
|
|
35
|
+
# The event discriminator. Always `response.steer`.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
# Queues user input to steer a response on this WebSocket connection. Input can
|
|
40
|
+
# contain text, images, and files. Steering is supported only for single-agent
|
|
41
|
+
# responses on models and execution modes that support steering. Responses bound
|
|
42
|
+
# to a conversation or using automatic compaction do not support steering.
|
|
43
|
+
#
|
|
44
|
+
# A `response.steer.accepted` event acknowledges that the server owns the queued
|
|
45
|
+
# input, not that it has been applied. The successor's `response.created` event is
|
|
46
|
+
# the commit point. Input that cannot be committed is returned in
|
|
47
|
+
# `response.steer.failed`.
|
|
48
|
+
#
|
|
49
|
+
# Steering may cause the active response to finish at a safe output boundary with
|
|
50
|
+
# `response.incomplete` and `incomplete_details.reason` set to `steered`, followed
|
|
51
|
+
# automatically by a successor `response.created`. Normal completion can also be
|
|
52
|
+
# followed by an automatic successor. Automatic successors inherit the previous
|
|
53
|
+
# response's settings and continue from it with the queued input.
|
|
54
|
+
#
|
|
55
|
+
# If the response stops for client-owned tool output or approval, accepted
|
|
56
|
+
# steering input remains queued and `response.steer.pending` is emitted after
|
|
57
|
+
# `response.completed`. Fill the `required_input` stubs from that event with saved
|
|
58
|
+
# tool results or approval decisions, and send one explicit `response.create` per
|
|
59
|
+
# parent with the same `previous_response_id` and WebSocket lane. Do not rerun
|
|
60
|
+
# tools or resend accepted steering input. The queued input is prepended in
|
|
61
|
+
# submission order to that request's input, and the explicit request retains its
|
|
62
|
+
# own settings.
|
|
63
|
+
#
|
|
64
|
+
# This event accepts only `type`, `previous_response_id`, and `input`. Do not send
|
|
65
|
+
# `stream_id`; the target response determines the WebSocket lane.
|
|
66
|
+
sig do
|
|
67
|
+
params(
|
|
68
|
+
|
|
69
|
+
input: T.any(String, T::Array[OpenAI::Responses::ResponseSteerInput::ResponseSteerInputItemList::Variants]),
|
|
70
|
+
|
|
71
|
+
previous_response_id: String,
|
|
72
|
+
|
|
73
|
+
type: Symbol
|
|
74
|
+
)
|
|
75
|
+
.returns(T.attached_class)
|
|
76
|
+
end
|
|
77
|
+
def self.new(
|
|
78
|
+
|
|
79
|
+
# Input to queue for a continuation of the response. Uses the same string or
|
|
80
|
+
# input-item shape as `response.create.input`, with a non-empty array when
|
|
81
|
+
# supplying input items.
|
|
82
|
+
#
|
|
83
|
+
# Steering accepts only messages with the `user` role. Each message may contain
|
|
84
|
+
# only `type`, `role`, and `content`, with `content` as a string or an array of
|
|
85
|
+
# `input_text`, `input_image`, and `input_file` parts. The optional `type` must be
|
|
86
|
+
# `message`. Other roles, tool outputs, and item types are not supported for
|
|
87
|
+
# steering.
|
|
88
|
+
input:,
|
|
89
|
+
|
|
90
|
+
# The ID of the response to steer on this WebSocket connection.
|
|
91
|
+
previous_response_id:,
|
|
92
|
+
|
|
93
|
+
# The event discriminator. Always `response.steer`.
|
|
94
|
+
|
|
95
|
+
type: :"response.steer"
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
sig do
|
|
100
|
+
override.returns(
|
|
101
|
+
{
|
|
102
|
+
input: T.any(
|
|
103
|
+
String,
|
|
104
|
+
T::Array[OpenAI::Responses::ResponseSteerInput::ResponseSteerInputItemList::Variants]
|
|
105
|
+
),
|
|
106
|
+
previous_response_id: String,
|
|
107
|
+
type: Symbol
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
end
|
|
111
|
+
def to_hash
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Responses
|
|
7
|
+
|
|
8
|
+
class ResponseSteerFailedEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Responses::ResponseSteerFailedEvent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Information about why the input could not be committed.
|
|
18
|
+
sig { returns(OpenAI::Responses::ResponseSteerFailedEvent::Error) }
|
|
19
|
+
attr_reader :error
|
|
20
|
+
|
|
21
|
+
sig { params(error: OpenAI::Responses::ResponseSteerFailedEvent::Error::OrHash).void }
|
|
22
|
+
attr_writer :error
|
|
23
|
+
|
|
24
|
+
# The sequence number for this event.
|
|
25
|
+
sig { returns(Integer) }
|
|
26
|
+
attr_accessor :sequence_number
|
|
27
|
+
|
|
28
|
+
# The steering submission that could not be committed.
|
|
29
|
+
sig { returns(OpenAI::Responses::ResponseSteerFailedEvent::Steer) }
|
|
30
|
+
attr_reader :steer
|
|
31
|
+
|
|
32
|
+
sig { params(steer: OpenAI::Responses::ResponseSteerFailedEvent::Steer::OrHash).void }
|
|
33
|
+
attr_writer :steer
|
|
34
|
+
|
|
35
|
+
# The event discriminator. Always `response.steer.failed`.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
# The WebSocket lane that emitted this event, when the target response is
|
|
40
|
+
# available and its `response.create` event supplied a `stream_id`.
|
|
41
|
+
sig { returns(T.nilable(String)) }
|
|
42
|
+
attr_reader :stream_id
|
|
43
|
+
|
|
44
|
+
sig { params(stream_id: String).void }
|
|
45
|
+
attr_writer :stream_id
|
|
46
|
+
|
|
47
|
+
# Emitted when steering input is rejected or cannot be committed to a successor
|
|
48
|
+
# response. Returns the original, uncommitted input so the client can carry it
|
|
49
|
+
# into `response.create` when appropriate. Invalid input must be corrected before
|
|
50
|
+
# retrying.
|
|
51
|
+
#
|
|
52
|
+
# Failures after acceptance include the same steering ID. Failures before an ID is
|
|
53
|
+
# allocated omit `steer.id`. A lost connection or missing acknowledgement leaves
|
|
54
|
+
# the outcome unknown; it is not proof that the input was rejected.
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
|
|
58
|
+
error: OpenAI::Responses::ResponseSteerFailedEvent::Error::OrHash,
|
|
59
|
+
|
|
60
|
+
sequence_number: Integer,
|
|
61
|
+
|
|
62
|
+
steer: OpenAI::Responses::ResponseSteerFailedEvent::Steer::OrHash,
|
|
63
|
+
|
|
64
|
+
stream_id: String,
|
|
65
|
+
|
|
66
|
+
type: Symbol
|
|
67
|
+
)
|
|
68
|
+
.returns(T.attached_class)
|
|
69
|
+
end
|
|
70
|
+
def self.new(
|
|
71
|
+
|
|
72
|
+
# Information about why the input could not be committed.
|
|
73
|
+
error:,
|
|
74
|
+
|
|
75
|
+
# The sequence number for this event.
|
|
76
|
+
sequence_number:,
|
|
77
|
+
|
|
78
|
+
# The steering submission that could not be committed.
|
|
79
|
+
steer:,
|
|
80
|
+
|
|
81
|
+
# The WebSocket lane that emitted this event, when the target response is
|
|
82
|
+
# available and its `response.create` event supplied a `stream_id`.
|
|
83
|
+
stream_id: nil,
|
|
84
|
+
|
|
85
|
+
# The event discriminator. Always `response.steer.failed`.
|
|
86
|
+
|
|
87
|
+
type: :"response.steer.failed"
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
override.returns(
|
|
93
|
+
{
|
|
94
|
+
error: OpenAI::Responses::ResponseSteerFailedEvent::Error,
|
|
95
|
+
sequence_number: Integer,
|
|
96
|
+
steer: OpenAI::Responses::ResponseSteerFailedEvent::Steer,
|
|
97
|
+
type: Symbol,
|
|
98
|
+
stream_id: String
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
def to_hash
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
106
|
+
OrHash = T.type_alias do
|
|
107
|
+
T.any(
|
|
108
|
+
OpenAI::Responses::ResponseSteerFailedEvent::Error,
|
|
109
|
+
OpenAI::Internal::AnyHash
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# A machine-readable steering error code. Clients should handle unknown values
|
|
114
|
+
# because additional codes may be introduced. Known values include:
|
|
115
|
+
#
|
|
116
|
+
# - `response_not_found`: The target response is not available on this connection.
|
|
117
|
+
# - `invalid_input`: The event or input failed validation.
|
|
118
|
+
# - `steering_not_supported`: The model or response execution mode does not
|
|
119
|
+
# support steering.
|
|
120
|
+
# - `too_many_pending_steers`: Too much steering input is pending for the
|
|
121
|
+
# response.
|
|
122
|
+
# - `response_already_completed`: The response completed and is no longer
|
|
123
|
+
# accepting steering input.
|
|
124
|
+
# - `response_not_active`: The response is no longer accepting steering input.
|
|
125
|
+
# - `successor_creation_failed`: The successor response could not be created.
|
|
126
|
+
sig { returns(OpenAI::Responses::ResponseSteerErrorCode::Variants) }
|
|
127
|
+
attr_accessor :code
|
|
128
|
+
|
|
129
|
+
# A human-readable description of the error.
|
|
130
|
+
sig { returns(String) }
|
|
131
|
+
attr_accessor :message
|
|
132
|
+
|
|
133
|
+
# The error type. Always `invalid_request_error`.
|
|
134
|
+
sig { returns(Symbol) }
|
|
135
|
+
attr_accessor :type
|
|
136
|
+
|
|
137
|
+
# Information about why the input could not be committed.
|
|
138
|
+
sig do
|
|
139
|
+
params(
|
|
140
|
+
|
|
141
|
+
code: T.any(OpenAI::Responses::ResponseSteerErrorCode::OrSymbol, String),
|
|
142
|
+
|
|
143
|
+
message: String,
|
|
144
|
+
|
|
145
|
+
type: Symbol
|
|
146
|
+
)
|
|
147
|
+
.returns(T.attached_class)
|
|
148
|
+
end
|
|
149
|
+
def self.new(
|
|
150
|
+
|
|
151
|
+
# A machine-readable steering error code. Clients should handle unknown values
|
|
152
|
+
# because additional codes may be introduced. Known values include:
|
|
153
|
+
#
|
|
154
|
+
# - `response_not_found`: The target response is not available on this connection.
|
|
155
|
+
# - `invalid_input`: The event or input failed validation.
|
|
156
|
+
# - `steering_not_supported`: The model or response execution mode does not
|
|
157
|
+
# support steering.
|
|
158
|
+
# - `too_many_pending_steers`: Too much steering input is pending for the
|
|
159
|
+
# response.
|
|
160
|
+
# - `response_already_completed`: The response completed and is no longer
|
|
161
|
+
# accepting steering input.
|
|
162
|
+
# - `response_not_active`: The response is no longer accepting steering input.
|
|
163
|
+
# - `successor_creation_failed`: The successor response could not be created.
|
|
164
|
+
code:,
|
|
165
|
+
|
|
166
|
+
# A human-readable description of the error.
|
|
167
|
+
message:,
|
|
168
|
+
|
|
169
|
+
# The error type. Always `invalid_request_error`.
|
|
170
|
+
|
|
171
|
+
type: :invalid_request_error
|
|
172
|
+
)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
sig do
|
|
176
|
+
override.returns(
|
|
177
|
+
{code: OpenAI::Responses::ResponseSteerErrorCode::Variants, message: String, type: Symbol}
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
def to_hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
class Steer < OpenAI::Internal::Type::BaseModel
|
|
186
|
+
OrHash = T.type_alias do
|
|
187
|
+
T.any(
|
|
188
|
+
OpenAI::Responses::ResponseSteerFailedEvent::Steer,
|
|
189
|
+
OpenAI::Internal::AnyHash
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Input to queue for a continuation of the response. Uses the same string or
|
|
194
|
+
# input-item shape as `response.create.input`, with a non-empty array when
|
|
195
|
+
# supplying input items.
|
|
196
|
+
#
|
|
197
|
+
# Steering accepts only messages with the `user` role. Each message may contain
|
|
198
|
+
# only `type`, `role`, and `content`, with `content` as a string or an array of
|
|
199
|
+
# `input_text`, `input_image`, and `input_file` parts. The optional `type` must be
|
|
200
|
+
# `message`. Other roles, tool outputs, and item types are not supported for
|
|
201
|
+
# steering.
|
|
202
|
+
sig { returns(OpenAI::Responses::ResponseSteerInput::Variants) }
|
|
203
|
+
attr_accessor :input
|
|
204
|
+
|
|
205
|
+
# The ID of the response that was targeted for steering.
|
|
206
|
+
sig { returns(String) }
|
|
207
|
+
attr_accessor :previous_response_id
|
|
208
|
+
|
|
209
|
+
# The ID assigned to the steering submission, if one was allocated.
|
|
210
|
+
sig { returns(T.nilable(String)) }
|
|
211
|
+
attr_reader :id
|
|
212
|
+
|
|
213
|
+
sig { params(id: String).void }
|
|
214
|
+
attr_writer :id
|
|
215
|
+
|
|
216
|
+
# The steering submission that could not be committed.
|
|
217
|
+
sig do
|
|
218
|
+
params(
|
|
219
|
+
|
|
220
|
+
input: T.any(
|
|
221
|
+
String,
|
|
222
|
+
T::Array[OpenAI::Responses::ResponseSteerInput::ResponseSteerInputItemList::Variants]
|
|
223
|
+
),
|
|
224
|
+
|
|
225
|
+
previous_response_id: String,
|
|
226
|
+
|
|
227
|
+
id: String
|
|
228
|
+
)
|
|
229
|
+
.returns(T.attached_class)
|
|
230
|
+
end
|
|
231
|
+
def self.new(
|
|
232
|
+
|
|
233
|
+
# Input to queue for a continuation of the response. Uses the same string or
|
|
234
|
+
# input-item shape as `response.create.input`, with a non-empty array when
|
|
235
|
+
# supplying input items.
|
|
236
|
+
#
|
|
237
|
+
# Steering accepts only messages with the `user` role. Each message may contain
|
|
238
|
+
# only `type`, `role`, and `content`, with `content` as a string or an array of
|
|
239
|
+
# `input_text`, `input_image`, and `input_file` parts. The optional `type` must be
|
|
240
|
+
# `message`. Other roles, tool outputs, and item types are not supported for
|
|
241
|
+
# steering.
|
|
242
|
+
input:,
|
|
243
|
+
|
|
244
|
+
# The ID of the response that was targeted for steering.
|
|
245
|
+
previous_response_id:,
|
|
246
|
+
|
|
247
|
+
# The ID assigned to the steering submission, if one was allocated.
|
|
248
|
+
|
|
249
|
+
id: nil
|
|
250
|
+
)
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
sig do
|
|
254
|
+
override.returns(
|
|
255
|
+
{input: OpenAI::Responses::ResponseSteerInput::Variants, previous_response_id: String, id: String}
|
|
256
|
+
)
|
|
257
|
+
end
|
|
258
|
+
def to_hash
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
end
|
|
268
|
+
end
|