openai 0.84.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 +30 -0
- data/README.md +1 -1
- data/SECURITY.md +10 -0
- data/docs/architecture/security-model.md +267 -0
- data/lib/openai/client.rb +4 -0
- data/lib/openai/helpers/streaming/chat_completion_stream.rb +17 -8
- data/lib/openai/helpers/streaming/response_stream.rb +13 -8
- 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 +6 -3
- data/lib/openai/helpers/structured_output/json_schema_converter.rb +34 -11
- data/lib/openai/internal/vector_store_file_uploader.rb +1 -1
- data/lib/openai/models/admin/organization/usage_costs_params.rb +1 -1
- data/lib/openai/models/batch.rb +2 -2
- 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 +20 -9
- 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_responses_client_event.rb +40 -7
- data/lib/openai/models/beta/beta_responses_server_event.rb +164 -2
- data/lib/openai/models/beta/response_compact_params.rb +9 -6
- data/lib/openai/models/beta/response_create_params.rb +9 -6
- 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 +4 -4
- data/lib/openai/models/chat_model.rb +1 -0
- 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/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 +16 -8
- data/lib/openai/models/responses/response_compact_params.rb +9 -6
- 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 +5 -5
- 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/responses_client_event.rb +872 -769
- 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/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 +6 -6
- 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 +6 -6
- 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 +28 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +2 -2
- data/rbi/openai/models/batch.rbi +2 -2
- 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 +14 -6
- 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_responses_client_event.rbi +8 -3
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +206 -3
- data/rbi/openai/models/beta/response_compact_params.rbi +4 -3
- data/rbi/openai/models/beta/response_create_params.rbi +4 -3
- data/rbi/openai/models/beta/responses/beta_response_item_list.rbi +1 -0
- data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
- data/rbi/openai/models/chat_model.rbi +1 -0
- 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/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 +12 -5
- data/rbi/openai/models/responses/response_compact_params.rbi +4 -3
- 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 +2 -2
- 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/responses_client_event.rbi +1204 -1036
- 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 +1 -1
- data/rbi/openai/resources/beta/responses.rbi +3 -3
- data/rbi/openai/resources/chat/completions.rbi +2 -2
- data/rbi/openai/resources/conversations/items.rbi +1 -0
- data/rbi/openai/resources/conversations.rbi +1 -0
- data/rbi/openai/resources/responses.rbi +3 -3
- 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/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 +6 -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_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/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 +3 -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/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/safety/alerts.rbs +14 -0
- data/sig/openai/resources/safety.rbs +9 -0
- data/sig/openai/resources/webhooks.rbs +3 -1
- metadata +86 -1
|
@@ -5,544 +5,46 @@ module OpenAI
|
|
|
5
5
|
|
|
6
6
|
module Responses
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# Client events accepted by the Responses WebSocket server.
|
|
9
|
+
module ResponsesClientEvent
|
|
10
|
+
extend OpenAI::Internal::Type::Union
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
Variants = T.type_alias do
|
|
11
13
|
T.any(
|
|
12
|
-
OpenAI::Responses::ResponsesClientEvent,
|
|
13
|
-
OpenAI::
|
|
14
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate,
|
|
15
|
+
OpenAI::Responses::ResponseSteerEvent
|
|
14
16
|
)
|
|
15
17
|
end
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# [Learn more](https://platform.openai.com/docs/guides/background).
|
|
23
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
24
|
-
attr_accessor :background
|
|
25
|
-
|
|
26
|
-
# Context management configuration for this request.
|
|
27
|
-
sig { returns(T.nilable(T::Array[OpenAI::Responses::ResponsesClientEvent::ContextManagement])) }
|
|
28
|
-
attr_accessor :context_management
|
|
29
|
-
|
|
30
|
-
# The conversation that this response belongs to. Items from this conversation are
|
|
31
|
-
# prepended to `input_items` for this response request. Input items and output
|
|
32
|
-
# items from this response are automatically added to this conversation after this
|
|
33
|
-
# response completes.
|
|
34
|
-
sig { returns(T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam))) }
|
|
35
|
-
attr_accessor :conversation
|
|
36
|
-
|
|
37
|
-
# Specify additional output data to include in the model response. Currently
|
|
38
|
-
# supported values are:
|
|
39
|
-
#
|
|
40
|
-
# - `web_search_call.action.sources`: Include the sources of the web search tool
|
|
41
|
-
# call.
|
|
42
|
-
# - `code_interpreter_call.outputs`: Includes the outputs of python code execution
|
|
43
|
-
# in code interpreter tool call items.
|
|
44
|
-
# - `computer_call_output.output.image_url`: Include image urls from the computer
|
|
45
|
-
# call output.
|
|
46
|
-
# - `file_search_call.results`: Include the search results of the file search tool
|
|
47
|
-
# call.
|
|
48
|
-
# - `message.input_image.image_url`: Include image urls from the input message.
|
|
49
|
-
# - `message.output_text.logprobs`: Include logprobs with assistant messages.
|
|
50
|
-
# - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
|
|
51
|
-
# tokens in reasoning item outputs. This enables reasoning items to be used in
|
|
52
|
-
# multi-turn conversations when using the Responses API statelessly (like when
|
|
53
|
-
# the `store` parameter is set to `false`, or when an organization is enrolled
|
|
54
|
-
# in the zero data retention program).
|
|
55
|
-
sig { returns(T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol])) }
|
|
56
|
-
attr_accessor :include
|
|
57
|
-
|
|
58
|
-
# Text, image, or file inputs to the model, used to generate a response.
|
|
59
|
-
#
|
|
60
|
-
# Learn more:
|
|
61
|
-
#
|
|
62
|
-
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
63
|
-
# - [Image inputs](https://platform.openai.com/docs/guides/images)
|
|
64
|
-
# - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
|
|
65
|
-
# - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
|
|
66
|
-
# - [Function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
67
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::Input::Variants)) }
|
|
68
|
-
attr_reader :input
|
|
69
|
-
|
|
70
|
-
sig { params(input: OpenAI::Responses::ResponsesClientEvent::Input::Variants).void }
|
|
71
|
-
attr_writer :input
|
|
72
|
-
|
|
73
|
-
# A system (or developer) message inserted into the model's context.
|
|
74
|
-
#
|
|
75
|
-
# When using along with `previous_response_id`, the instructions from a previous
|
|
76
|
-
# response will not be carried over to the next response. This makes it simple to
|
|
77
|
-
# swap out system (or developer) messages in new responses.
|
|
78
|
-
sig { returns(T.nilable(String)) }
|
|
79
|
-
attr_accessor :instructions
|
|
80
|
-
|
|
81
|
-
# An upper bound for the number of tokens that can be generated for a response,
|
|
82
|
-
# including visible output tokens and
|
|
83
|
-
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
|
84
|
-
sig { returns(T.nilable(Integer)) }
|
|
85
|
-
attr_accessor :max_output_tokens
|
|
86
|
-
|
|
87
|
-
# The maximum number of total calls to built-in tools that can be processed in a
|
|
88
|
-
# response. This maximum number applies across all built-in tool calls, not per
|
|
89
|
-
# individual tool. Any further attempts to call a tool by the model will be
|
|
90
|
-
# ignored.
|
|
91
|
-
sig { returns(T.nilable(Integer)) }
|
|
92
|
-
attr_accessor :max_tool_calls
|
|
93
|
-
|
|
94
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
95
|
-
# for storing additional information about the object in a structured format, and
|
|
96
|
-
# querying for objects via API or the dashboard.
|
|
97
|
-
#
|
|
98
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
99
|
-
# a maximum length of 512 characters.
|
|
100
|
-
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
101
|
-
attr_accessor :metadata
|
|
102
|
-
|
|
103
|
-
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
104
|
-
# range of models with different capabilities, performance characteristics, and
|
|
105
|
-
# price points. Refer to the
|
|
106
|
-
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
107
|
-
# available models.
|
|
108
|
-
sig {
|
|
109
|
-
returns(
|
|
110
|
-
T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol))
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
attr_reader :model
|
|
114
|
-
|
|
115
|
-
sig {
|
|
116
|
-
params(
|
|
117
|
-
model: T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol)
|
|
118
|
-
)
|
|
119
|
-
.void
|
|
120
|
-
}
|
|
121
|
-
attr_writer :model
|
|
122
|
-
|
|
123
|
-
# Configuration for running moderation on the input and output of this response.
|
|
124
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation)) }
|
|
125
|
-
attr_reader :moderation
|
|
126
|
-
|
|
127
|
-
sig { params(moderation: T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::OrHash)).void }
|
|
128
|
-
attr_writer :moderation
|
|
129
|
-
|
|
130
|
-
# Whether to allow the model to run tool calls in parallel.
|
|
131
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
132
|
-
attr_accessor :parallel_tool_calls
|
|
133
|
-
|
|
134
|
-
# The unique ID of the previous response to the model. Use this to create
|
|
135
|
-
# multi-turn conversations. Learn more about
|
|
136
|
-
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
137
|
-
# Cannot be used in conjunction with `conversation`.
|
|
138
|
-
sig { returns(T.nilable(String)) }
|
|
139
|
-
attr_accessor :previous_response_id
|
|
140
|
-
|
|
141
|
-
# Reference to a prompt template and its variables.
|
|
142
|
-
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
143
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsePrompt)) }
|
|
144
|
-
attr_reader :prompt
|
|
145
|
-
|
|
146
|
-
sig { params(prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash)).void }
|
|
147
|
-
attr_writer :prompt
|
|
148
|
-
|
|
149
|
-
# Used by OpenAI to cache responses for similar requests to optimize your cache
|
|
150
|
-
# hit rates. Replaces the `user` field.
|
|
151
|
-
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
152
|
-
sig { returns(T.nilable(String)) }
|
|
153
|
-
attr_accessor :prompt_cache_key
|
|
154
|
-
|
|
155
|
-
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
156
|
-
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
157
|
-
# explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
158
|
-
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
159
|
-
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
160
|
-
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
161
|
-
# `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
162
|
-
# [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
163
|
-
# for current details.
|
|
164
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::PromptCacheOptions)) }
|
|
165
|
-
attr_reader :prompt_cache_options
|
|
166
|
-
|
|
167
|
-
sig { params(prompt_cache_options: OpenAI::Responses::ResponsesClientEvent::PromptCacheOptions::OrHash).void }
|
|
168
|
-
attr_writer :prompt_cache_options
|
|
169
|
-
|
|
170
|
-
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
171
|
-
#
|
|
172
|
-
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
173
|
-
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
174
|
-
# of 24 hours.
|
|
175
|
-
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
176
|
-
# This field expresses a maximum retention policy, while
|
|
177
|
-
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
178
|
-
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
179
|
-
# models, only `24h` is supported.
|
|
180
|
-
#
|
|
181
|
-
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
182
|
-
# your organization's data retention policy:
|
|
183
|
-
#
|
|
184
|
-
# - Organizations without ZDR enabled default to `24h`.
|
|
185
|
-
# - Organizations with ZDR enabled default to `in_memory` when
|
|
186
|
-
# `prompt_cache_retention` is not specified.
|
|
187
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::OrSymbol)) }
|
|
188
|
-
attr_accessor :prompt_cache_retention
|
|
189
|
-
|
|
190
|
-
# Configuration options for
|
|
191
|
-
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
192
|
-
sig { returns(T.nilable(OpenAI::Reasoning)) }
|
|
193
|
-
attr_reader :reasoning
|
|
194
|
-
|
|
195
|
-
sig { params(reasoning: T.nilable(OpenAI::Reasoning::OrHash)).void }
|
|
196
|
-
attr_writer :reasoning
|
|
197
|
-
|
|
198
|
-
# A stable identifier used to help detect users of your application that may be
|
|
199
|
-
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
200
|
-
# identifies each user, with a maximum length of 64 characters. We recommend
|
|
201
|
-
# hashing their username or email address, in order to avoid sending us any
|
|
202
|
-
# identifying information.
|
|
203
|
-
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
204
|
-
sig { returns(T.nilable(String)) }
|
|
205
|
-
attr_accessor :safety_identifier
|
|
206
|
-
|
|
207
|
-
# Specifies the processing type used for serving the request.
|
|
208
|
-
#
|
|
209
|
-
# - If set to 'auto', then the request will be processed with the service tier
|
|
210
|
-
# configured in the Project settings. Unless otherwise configured, the Project
|
|
211
|
-
# will use 'default'.
|
|
212
|
-
# - If set to 'default', then the request will be processed with the standard
|
|
213
|
-
# pricing and performance for the selected model.
|
|
214
|
-
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
|
|
215
|
-
# then the request will be processed with the Flex Processing service tier.
|
|
216
|
-
# - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
|
|
217
|
-
# include the `service_tier=fast` or `service_tier=priority` parameter for
|
|
218
|
-
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
219
|
-
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
220
|
-
# request.
|
|
221
|
-
# - If set to 'ultrafast', then the request will be processed with the
|
|
222
|
-
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
223
|
-
# available for `gpt-5.6-sol`; a response served through it will show
|
|
224
|
-
# `service_tier=ultrafast`.
|
|
225
|
-
# - When not set, the default behavior is 'auto'.
|
|
226
|
-
#
|
|
227
|
-
# When the `service_tier` parameter is set, the response body will include the
|
|
228
|
-
# `service_tier` value based on the processing mode actually used to serve the
|
|
229
|
-
# request. This response value may be different from the value set in the
|
|
230
|
-
# parameter.
|
|
231
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ServiceTier::OrSymbol)) }
|
|
232
|
-
attr_accessor :service_tier
|
|
233
|
-
|
|
234
|
-
# Whether to store the generated model response for later retrieval via API.
|
|
235
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
236
|
-
attr_accessor :store
|
|
237
|
-
|
|
238
|
-
# If set to true, the model response data will be streamed to the client as it is
|
|
239
|
-
# generated using
|
|
240
|
-
# [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
|
|
241
|
-
# See the
|
|
242
|
-
# [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
|
|
243
|
-
# for more information.
|
|
244
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
245
|
-
attr_accessor :stream
|
|
246
|
-
|
|
247
|
-
# The WebSocket lane for this response. Requests with the same `stream_id` are
|
|
248
|
-
# processed FIFO, and events for the response echo the same `stream_id`.
|
|
249
|
-
#
|
|
250
|
-
# `stream_id` controls routing; `previous_response_id` controls conversation
|
|
251
|
-
# lineage, so a new lane can fork from a response created on another lane.
|
|
252
|
-
sig { returns(T.nilable(String)) }
|
|
253
|
-
attr_reader :stream_id
|
|
254
|
-
|
|
255
|
-
sig { params(stream_id: String).void }
|
|
256
|
-
attr_writer :stream_id
|
|
257
|
-
|
|
258
|
-
# Options for streaming responses. Only set this when you set `stream: true`.
|
|
259
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::StreamOptions)) }
|
|
260
|
-
attr_reader :stream_options
|
|
261
|
-
|
|
262
|
-
sig { params(stream_options: T.nilable(OpenAI::Responses::ResponsesClientEvent::StreamOptions::OrHash)).void }
|
|
263
|
-
attr_writer :stream_options
|
|
264
|
-
|
|
265
|
-
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
266
|
-
# make the output more random, while lower values like 0.2 will make it more
|
|
267
|
-
# focused and deterministic. We generally recommend altering this or `top_p` but
|
|
268
|
-
# not both.
|
|
269
|
-
sig { returns(T.nilable(Float)) }
|
|
270
|
-
attr_accessor :temperature
|
|
271
|
-
|
|
272
|
-
# Configuration options for a text response from the model. Can be plain text or
|
|
273
|
-
# structured JSON data. Learn more:
|
|
274
|
-
#
|
|
275
|
-
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
276
|
-
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
277
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponseTextConfig)) }
|
|
278
|
-
attr_reader :text
|
|
279
|
-
|
|
280
|
-
sig { params(text: OpenAI::Responses::ResponseTextConfig::OrHash).void }
|
|
281
|
-
attr_writer :text
|
|
282
|
-
|
|
283
|
-
# How the model should select which tool (or tools) to use when generating a
|
|
284
|
-
# response. See the `tools` parameter to see how to specify which tools the model
|
|
285
|
-
# can call.
|
|
286
|
-
sig {
|
|
287
|
-
returns(
|
|
288
|
-
T.nilable(
|
|
289
|
-
T.any(
|
|
290
|
-
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
291
|
-
OpenAI::Responses::ToolChoiceAllowed,
|
|
292
|
-
OpenAI::Responses::ToolChoiceTypes,
|
|
293
|
-
OpenAI::Responses::ToolChoiceFunction,
|
|
294
|
-
OpenAI::Responses::ToolChoiceMcp,
|
|
295
|
-
OpenAI::Responses::ToolChoiceCustom,
|
|
296
|
-
OpenAI::Responses::ResponsesClientEvent::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
297
|
-
OpenAI::Responses::ToolChoiceApplyPatch,
|
|
298
|
-
OpenAI::Responses::ToolChoiceShell
|
|
299
|
-
)
|
|
300
|
-
)
|
|
301
|
-
)
|
|
302
|
-
}
|
|
303
|
-
attr_reader :tool_choice
|
|
304
|
-
|
|
305
|
-
sig {
|
|
306
|
-
params(
|
|
307
|
-
tool_choice: T.any(
|
|
308
|
-
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
309
|
-
OpenAI::Responses::ToolChoiceAllowed::OrHash,
|
|
310
|
-
OpenAI::Responses::ToolChoiceTypes::OrHash,
|
|
311
|
-
OpenAI::Responses::ToolChoiceFunction::OrHash,
|
|
312
|
-
OpenAI::Responses::ToolChoiceMcp::OrHash,
|
|
313
|
-
OpenAI::Responses::ToolChoiceCustom::OrHash,
|
|
314
|
-
OpenAI::Responses::ResponsesClientEvent::ToolChoice::SpecificProgrammaticToolCallingParam::OrHash,
|
|
315
|
-
OpenAI::Responses::ToolChoiceApplyPatch::OrHash,
|
|
316
|
-
OpenAI::Responses::ToolChoiceShell::OrHash
|
|
317
|
-
)
|
|
318
|
-
)
|
|
319
|
-
.void
|
|
320
|
-
}
|
|
321
|
-
attr_writer :tool_choice
|
|
322
|
-
|
|
323
|
-
# An array of tools the model may call while generating a response. You can
|
|
324
|
-
# specify which tool to use by setting the `tool_choice` parameter.
|
|
325
|
-
#
|
|
326
|
-
# We support the following categories of tools:
|
|
327
|
-
#
|
|
328
|
-
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
|
329
|
-
# capabilities, like
|
|
330
|
-
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
|
331
|
-
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
|
332
|
-
# Learn more about
|
|
333
|
-
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
|
334
|
-
# - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
|
|
335
|
-
# predefined connectors such as Google Drive and SharePoint. Learn more about
|
|
336
|
-
# [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
|
|
337
|
-
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
|
338
|
-
# the model to call your own code with strongly typed arguments and outputs.
|
|
339
|
-
# Learn more about
|
|
340
|
-
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
|
341
|
-
# You can also use custom tools to call your own code.
|
|
342
|
-
sig {
|
|
343
|
-
returns(
|
|
344
|
-
T.nilable(
|
|
345
|
-
T::Array[
|
|
346
|
-
T.any(
|
|
347
|
-
OpenAI::Responses::FunctionTool,
|
|
348
|
-
OpenAI::Responses::FileSearchTool,
|
|
349
|
-
OpenAI::Responses::ComputerTool,
|
|
350
|
-
OpenAI::Responses::ComputerUsePreviewTool,
|
|
351
|
-
OpenAI::Responses::Tool::Mcp,
|
|
352
|
-
OpenAI::Responses::Tool::CodeInterpreter,
|
|
353
|
-
OpenAI::Responses::Tool::ProgrammaticToolCalling,
|
|
354
|
-
OpenAI::Responses::Tool::ImageGeneration,
|
|
355
|
-
OpenAI::Responses::Tool::LocalShell,
|
|
356
|
-
OpenAI::Responses::FunctionShellTool,
|
|
357
|
-
OpenAI::Responses::CustomTool,
|
|
358
|
-
OpenAI::Responses::NamespaceTool,
|
|
359
|
-
OpenAI::Responses::ToolSearchTool,
|
|
360
|
-
OpenAI::Responses::ApplyPatchTool,
|
|
361
|
-
OpenAI::Responses::WebSearchTool,
|
|
362
|
-
OpenAI::Responses::WebSearchPreviewTool
|
|
363
|
-
)
|
|
364
|
-
]
|
|
19
|
+
class ResponseCreate < OpenAI::Internal::Type::BaseModel
|
|
20
|
+
OrHash = T.type_alias do
|
|
21
|
+
T.any(
|
|
22
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate,
|
|
23
|
+
OpenAI::Internal::AnyHash
|
|
365
24
|
)
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
attr_reader :tools
|
|
369
|
-
|
|
370
|
-
sig {
|
|
371
|
-
params(
|
|
372
|
-
tools: T::Array[
|
|
373
|
-
T.any(
|
|
374
|
-
OpenAI::Responses::FunctionTool::OrHash,
|
|
375
|
-
OpenAI::Responses::FileSearchTool::OrHash,
|
|
376
|
-
OpenAI::Responses::ComputerTool::OrHash,
|
|
377
|
-
OpenAI::Responses::ComputerUsePreviewTool::OrHash,
|
|
378
|
-
OpenAI::Responses::Tool::Mcp::OrHash,
|
|
379
|
-
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
|
380
|
-
OpenAI::Responses::Tool::ProgrammaticToolCalling::OrHash,
|
|
381
|
-
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
|
382
|
-
OpenAI::Responses::Tool::LocalShell::OrHash,
|
|
383
|
-
OpenAI::Responses::FunctionShellTool::OrHash,
|
|
384
|
-
OpenAI::Responses::CustomTool::OrHash,
|
|
385
|
-
OpenAI::Responses::NamespaceTool::OrHash,
|
|
386
|
-
OpenAI::Responses::ToolSearchTool::OrHash,
|
|
387
|
-
OpenAI::Responses::ApplyPatchTool::OrHash,
|
|
388
|
-
OpenAI::Responses::WebSearchTool::OrHash,
|
|
389
|
-
OpenAI::Responses::WebSearchPreviewTool::OrHash
|
|
390
|
-
)
|
|
391
|
-
]
|
|
392
|
-
)
|
|
393
|
-
.void
|
|
394
|
-
}
|
|
395
|
-
attr_writer :tools
|
|
396
|
-
|
|
397
|
-
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
398
|
-
# to return at each token position, each with an associated log probability. In
|
|
399
|
-
# some cases, the number of returned tokens may be fewer than requested.
|
|
400
|
-
sig { returns(T.nilable(Integer)) }
|
|
401
|
-
attr_accessor :top_logprobs
|
|
402
|
-
|
|
403
|
-
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
404
|
-
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
405
|
-
# means only the tokens comprising the top 10% probability mass are considered.
|
|
406
|
-
#
|
|
407
|
-
# We generally recommend altering this or `temperature` but not both.
|
|
408
|
-
sig { returns(T.nilable(Float)) }
|
|
409
|
-
attr_accessor :top_p
|
|
410
|
-
|
|
411
|
-
# The truncation strategy to use for the model response.
|
|
412
|
-
#
|
|
413
|
-
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
414
|
-
# the model will truncate the response to fit the context window by dropping
|
|
415
|
-
# items from the beginning of the conversation.
|
|
416
|
-
# - `disabled` (default): If the input size will exceed the context window size
|
|
417
|
-
# for a model, the request will fail with a 400 error.
|
|
418
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::Truncation::OrSymbol)) }
|
|
419
|
-
attr_accessor :truncation
|
|
420
|
-
|
|
421
|
-
# This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
|
|
422
|
-
# `prompt_cache_key` instead to maintain caching optimizations. A stable
|
|
423
|
-
# identifier for your end-users. Used to boost cache hit rates by better bucketing
|
|
424
|
-
# similar requests and to help OpenAI detect and prevent abuse.
|
|
425
|
-
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
426
|
-
sig { returns(T.nilable(String)) }
|
|
427
|
-
attr_reader :user
|
|
428
|
-
|
|
429
|
-
sig { params(user: String).void }
|
|
430
|
-
attr_writer :user
|
|
431
|
-
|
|
432
|
-
sig do
|
|
433
|
-
params(
|
|
434
|
-
|
|
435
|
-
background: T.nilable(T::Boolean),
|
|
436
|
-
|
|
437
|
-
context_management: T.nilable(T::Array[OpenAI::Responses::ResponsesClientEvent::ContextManagement::OrHash]),
|
|
438
|
-
|
|
439
|
-
conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam::OrHash)),
|
|
440
|
-
|
|
441
|
-
include: T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]),
|
|
442
|
-
|
|
443
|
-
input: OpenAI::Responses::ResponsesClientEvent::Input::Variants,
|
|
444
|
-
|
|
445
|
-
instructions: T.nilable(String),
|
|
446
|
-
|
|
447
|
-
max_output_tokens: T.nilable(Integer),
|
|
448
|
-
|
|
449
|
-
max_tool_calls: T.nilable(Integer),
|
|
450
|
-
|
|
451
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
452
|
-
|
|
453
|
-
model: T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol),
|
|
454
|
-
|
|
455
|
-
moderation: T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::OrHash),
|
|
456
|
-
|
|
457
|
-
parallel_tool_calls: T.nilable(T::Boolean),
|
|
458
|
-
|
|
459
|
-
previous_response_id: T.nilable(String),
|
|
460
|
-
|
|
461
|
-
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
462
|
-
|
|
463
|
-
prompt_cache_key: T.nilable(String),
|
|
464
|
-
|
|
465
|
-
prompt_cache_options: OpenAI::Responses::ResponsesClientEvent::PromptCacheOptions::OrHash,
|
|
466
|
-
|
|
467
|
-
prompt_cache_retention: T.nilable(OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::OrSymbol),
|
|
468
|
-
|
|
469
|
-
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
470
|
-
|
|
471
|
-
safety_identifier: T.nilable(String),
|
|
472
|
-
|
|
473
|
-
service_tier: T.nilable(OpenAI::Responses::ResponsesClientEvent::ServiceTier::OrSymbol),
|
|
474
|
-
|
|
475
|
-
store: T.nilable(T::Boolean),
|
|
476
|
-
|
|
477
|
-
stream: T.nilable(T::Boolean),
|
|
478
|
-
|
|
479
|
-
stream_id: String,
|
|
480
|
-
|
|
481
|
-
stream_options: T.nilable(OpenAI::Responses::ResponsesClientEvent::StreamOptions::OrHash),
|
|
482
|
-
|
|
483
|
-
temperature: T.nilable(Float),
|
|
484
|
-
|
|
485
|
-
text: OpenAI::Responses::ResponseTextConfig::OrHash,
|
|
486
|
-
|
|
487
|
-
tool_choice: T.any(
|
|
488
|
-
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
489
|
-
OpenAI::Responses::ToolChoiceAllowed::OrHash,
|
|
490
|
-
OpenAI::Responses::ToolChoiceTypes::OrHash,
|
|
491
|
-
OpenAI::Responses::ToolChoiceFunction::OrHash,
|
|
492
|
-
OpenAI::Responses::ToolChoiceMcp::OrHash,
|
|
493
|
-
OpenAI::Responses::ToolChoiceCustom::OrHash,
|
|
494
|
-
OpenAI::Responses::ResponsesClientEvent::ToolChoice::SpecificProgrammaticToolCallingParam::OrHash,
|
|
495
|
-
OpenAI::Responses::ToolChoiceApplyPatch::OrHash,
|
|
496
|
-
OpenAI::Responses::ToolChoiceShell::OrHash
|
|
497
|
-
),
|
|
498
|
-
|
|
499
|
-
tools: T::Array[
|
|
500
|
-
T.any(
|
|
501
|
-
OpenAI::Responses::FunctionTool::OrHash,
|
|
502
|
-
OpenAI::Responses::FileSearchTool::OrHash,
|
|
503
|
-
OpenAI::Responses::ComputerTool::OrHash,
|
|
504
|
-
OpenAI::Responses::ComputerUsePreviewTool::OrHash,
|
|
505
|
-
OpenAI::Responses::Tool::Mcp::OrHash,
|
|
506
|
-
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
|
507
|
-
OpenAI::Responses::Tool::ProgrammaticToolCalling::OrHash,
|
|
508
|
-
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
|
509
|
-
OpenAI::Responses::Tool::LocalShell::OrHash,
|
|
510
|
-
OpenAI::Responses::FunctionShellTool::OrHash,
|
|
511
|
-
OpenAI::Responses::CustomTool::OrHash,
|
|
512
|
-
OpenAI::Responses::NamespaceTool::OrHash,
|
|
513
|
-
OpenAI::Responses::ToolSearchTool::OrHash,
|
|
514
|
-
OpenAI::Responses::ApplyPatchTool::OrHash,
|
|
515
|
-
OpenAI::Responses::WebSearchTool::OrHash,
|
|
516
|
-
OpenAI::Responses::WebSearchPreviewTool::OrHash
|
|
517
|
-
)
|
|
518
|
-
],
|
|
519
|
-
|
|
520
|
-
top_logprobs: T.nilable(Integer),
|
|
521
|
-
|
|
522
|
-
top_p: T.nilable(Float),
|
|
523
|
-
|
|
524
|
-
truncation: T.nilable(OpenAI::Responses::ResponsesClientEvent::Truncation::OrSymbol),
|
|
525
|
-
|
|
526
|
-
user: String,
|
|
25
|
+
end
|
|
527
26
|
|
|
528
|
-
|
|
529
|
-
)
|
|
530
|
-
|
|
531
|
-
end
|
|
532
|
-
def self.new(
|
|
27
|
+
# The type of the client event. Always `response.create`.
|
|
28
|
+
sig { returns(Symbol) }
|
|
29
|
+
attr_accessor :type
|
|
533
30
|
|
|
534
31
|
# Whether to run the model response in the background.
|
|
535
32
|
# [Learn more](https://platform.openai.com/docs/guides/background).
|
|
536
|
-
|
|
33
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
34
|
+
attr_accessor :background
|
|
537
35
|
|
|
538
36
|
# Context management configuration for this request.
|
|
539
|
-
|
|
37
|
+
sig {
|
|
38
|
+
returns(T.nilable(T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement]))
|
|
39
|
+
}
|
|
40
|
+
attr_accessor :context_management
|
|
540
41
|
|
|
541
42
|
# The conversation that this response belongs to. Items from this conversation are
|
|
542
43
|
# prepended to `input_items` for this response request. Input items and output
|
|
543
44
|
# items from this response are automatically added to this conversation after this
|
|
544
45
|
# response completes.
|
|
545
|
-
|
|
46
|
+
sig { returns(T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam))) }
|
|
47
|
+
attr_accessor :conversation
|
|
546
48
|
|
|
547
49
|
# Specify additional output data to include in the model response. Currently
|
|
548
50
|
# supported values are:
|
|
@@ -562,7 +64,8 @@ module OpenAI
|
|
|
562
64
|
# multi-turn conversations when using the Responses API statelessly (like when
|
|
563
65
|
# the `store` parameter is set to `false`, or when an organization is enrolled
|
|
564
66
|
# in the zero data retention program).
|
|
565
|
-
|
|
67
|
+
sig { returns(T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol])) }
|
|
68
|
+
attr_accessor :include
|
|
566
69
|
|
|
567
70
|
# Text, image, or file inputs to the model, used to generate a response.
|
|
568
71
|
#
|
|
@@ -573,25 +76,32 @@ module OpenAI
|
|
|
573
76
|
# - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
|
|
574
77
|
# - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
|
|
575
78
|
# - [Function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
576
|
-
|
|
79
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants)) }
|
|
80
|
+
attr_reader :input
|
|
81
|
+
|
|
82
|
+
sig { params(input: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants).void }
|
|
83
|
+
attr_writer :input
|
|
577
84
|
|
|
578
85
|
# A system (or developer) message inserted into the model's context.
|
|
579
86
|
#
|
|
580
87
|
# When using along with `previous_response_id`, the instructions from a previous
|
|
581
88
|
# response will not be carried over to the next response. This makes it simple to
|
|
582
89
|
# swap out system (or developer) messages in new responses.
|
|
583
|
-
|
|
90
|
+
sig { returns(T.nilable(String)) }
|
|
91
|
+
attr_accessor :instructions
|
|
584
92
|
|
|
585
93
|
# An upper bound for the number of tokens that can be generated for a response,
|
|
586
94
|
# including visible output tokens and
|
|
587
95
|
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
|
588
|
-
|
|
96
|
+
sig { returns(T.nilable(Integer)) }
|
|
97
|
+
attr_accessor :max_output_tokens
|
|
589
98
|
|
|
590
99
|
# The maximum number of total calls to built-in tools that can be processed in a
|
|
591
100
|
# response. This maximum number applies across all built-in tool calls, not per
|
|
592
101
|
# individual tool. Any further attempts to call a tool by the model will be
|
|
593
102
|
# ignored.
|
|
594
|
-
|
|
103
|
+
sig { returns(T.nilable(Integer)) }
|
|
104
|
+
attr_accessor :max_tool_calls
|
|
595
105
|
|
|
596
106
|
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
597
107
|
# for storing additional information about the object in a structured format, and
|
|
@@ -599,35 +109,65 @@ module OpenAI
|
|
|
599
109
|
#
|
|
600
110
|
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
601
111
|
# a maximum length of 512 characters.
|
|
602
|
-
|
|
112
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
113
|
+
attr_accessor :metadata
|
|
603
114
|
|
|
604
|
-
# Model ID used to generate the response, like `gpt-
|
|
115
|
+
# Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide
|
|
605
116
|
# range of models with different capabilities, performance characteristics, and
|
|
606
117
|
# price points. Refer to the
|
|
607
118
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
608
119
|
# available models.
|
|
609
|
-
|
|
120
|
+
sig {
|
|
121
|
+
returns(
|
|
122
|
+
T.nilable(
|
|
123
|
+
T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol)
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
attr_reader :model
|
|
128
|
+
|
|
129
|
+
sig {
|
|
130
|
+
params(
|
|
131
|
+
model: T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol)
|
|
132
|
+
)
|
|
133
|
+
.void
|
|
134
|
+
}
|
|
135
|
+
attr_writer :model
|
|
610
136
|
|
|
611
137
|
# Configuration for running moderation on the input and output of this response.
|
|
612
|
-
|
|
138
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation)) }
|
|
139
|
+
attr_reader :moderation
|
|
140
|
+
|
|
141
|
+
sig {
|
|
142
|
+
params(moderation: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::OrHash))
|
|
143
|
+
.void
|
|
144
|
+
}
|
|
145
|
+
attr_writer :moderation
|
|
613
146
|
|
|
614
147
|
# Whether to allow the model to run tool calls in parallel.
|
|
615
|
-
|
|
148
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
149
|
+
attr_accessor :parallel_tool_calls
|
|
616
150
|
|
|
617
151
|
# The unique ID of the previous response to the model. Use this to create
|
|
618
152
|
# multi-turn conversations. Learn more about
|
|
619
153
|
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
620
154
|
# Cannot be used in conjunction with `conversation`.
|
|
621
|
-
|
|
155
|
+
sig { returns(T.nilable(String)) }
|
|
156
|
+
attr_accessor :previous_response_id
|
|
622
157
|
|
|
623
158
|
# Reference to a prompt template and its variables.
|
|
624
159
|
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
625
|
-
|
|
160
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsePrompt)) }
|
|
161
|
+
attr_reader :prompt
|
|
162
|
+
|
|
163
|
+
sig { params(prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash)).void }
|
|
164
|
+
attr_writer :prompt
|
|
626
165
|
|
|
627
166
|
# Used by OpenAI to cache responses for similar requests to optimize your cache
|
|
628
167
|
# hit rates. Replaces the `user` field.
|
|
629
168
|
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
630
|
-
|
|
169
|
+
sig { returns(T.nilable(String)) }
|
|
170
|
+
attr_accessor :prompt_cache_key
|
|
631
171
|
|
|
632
172
|
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
633
173
|
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
@@ -638,7 +178,16 @@ module OpenAI
|
|
|
638
178
|
# `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
639
179
|
# [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
640
180
|
# for current details.
|
|
641
|
-
|
|
181
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions)) }
|
|
182
|
+
attr_reader :prompt_cache_options
|
|
183
|
+
|
|
184
|
+
sig {
|
|
185
|
+
params(
|
|
186
|
+
prompt_cache_options: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::OrHash
|
|
187
|
+
)
|
|
188
|
+
.void
|
|
189
|
+
}
|
|
190
|
+
attr_writer :prompt_cache_options
|
|
642
191
|
|
|
643
192
|
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
644
193
|
#
|
|
@@ -657,11 +206,18 @@ module OpenAI
|
|
|
657
206
|
# - Organizations without ZDR enabled default to `24h`.
|
|
658
207
|
# - Organizations with ZDR enabled default to `in_memory` when
|
|
659
208
|
# `prompt_cache_retention` is not specified.
|
|
660
|
-
|
|
209
|
+
sig {
|
|
210
|
+
returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention::OrSymbol))
|
|
211
|
+
}
|
|
212
|
+
attr_accessor :prompt_cache_retention
|
|
661
213
|
|
|
662
214
|
# Configuration options for
|
|
663
215
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
664
|
-
|
|
216
|
+
sig { returns(T.nilable(OpenAI::Reasoning)) }
|
|
217
|
+
attr_reader :reasoning
|
|
218
|
+
|
|
219
|
+
sig { params(reasoning: T.nilable(OpenAI::Reasoning::OrHash)).void }
|
|
220
|
+
attr_writer :reasoning
|
|
665
221
|
|
|
666
222
|
# A stable identifier used to help detect users of your application that may be
|
|
667
223
|
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
@@ -669,7 +225,8 @@ module OpenAI
|
|
|
669
225
|
# hashing their username or email address, in order to avoid sending us any
|
|
670
226
|
# identifying information.
|
|
671
227
|
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
672
|
-
|
|
228
|
+
sig { returns(T.nilable(String)) }
|
|
229
|
+
attr_accessor :safety_identifier
|
|
673
230
|
|
|
674
231
|
# Specifies the processing type used for serving the request.
|
|
675
232
|
#
|
|
@@ -695,10 +252,12 @@ module OpenAI
|
|
|
695
252
|
# `service_tier` value based on the processing mode actually used to serve the
|
|
696
253
|
# request. This response value may be different from the value set in the
|
|
697
254
|
# parameter.
|
|
698
|
-
|
|
255
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::OrSymbol)) }
|
|
256
|
+
attr_accessor :service_tier
|
|
699
257
|
|
|
700
258
|
# Whether to store the generated model response for later retrieval via API.
|
|
701
|
-
|
|
259
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
260
|
+
attr_accessor :store
|
|
702
261
|
|
|
703
262
|
# If set to true, the model response data will be streamed to the client as it is
|
|
704
263
|
# generated using
|
|
@@ -706,35 +265,89 @@ module OpenAI
|
|
|
706
265
|
# See the
|
|
707
266
|
# [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
|
|
708
267
|
# for more information.
|
|
709
|
-
|
|
268
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
269
|
+
attr_accessor :stream
|
|
710
270
|
|
|
711
271
|
# The WebSocket lane for this response. Requests with the same `stream_id` are
|
|
712
272
|
# processed FIFO, and events for the response echo the same `stream_id`.
|
|
713
273
|
#
|
|
714
274
|
# `stream_id` controls routing; `previous_response_id` controls conversation
|
|
715
275
|
# lineage, so a new lane can fork from a response created on another lane.
|
|
716
|
-
|
|
276
|
+
sig { returns(T.nilable(String)) }
|
|
277
|
+
attr_reader :stream_id
|
|
278
|
+
|
|
279
|
+
sig { params(stream_id: String).void }
|
|
280
|
+
attr_writer :stream_id
|
|
717
281
|
|
|
718
282
|
# Options for streaming responses. Only set this when you set `stream: true`.
|
|
719
|
-
|
|
283
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::StreamOptions)) }
|
|
284
|
+
attr_reader :stream_options
|
|
285
|
+
|
|
286
|
+
sig {
|
|
287
|
+
params(
|
|
288
|
+
stream_options: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::StreamOptions::OrHash)
|
|
289
|
+
)
|
|
290
|
+
.void
|
|
291
|
+
}
|
|
292
|
+
attr_writer :stream_options
|
|
720
293
|
|
|
721
294
|
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
722
295
|
# make the output more random, while lower values like 0.2 will make it more
|
|
723
296
|
# focused and deterministic. We generally recommend altering this or `top_p` but
|
|
724
297
|
# not both.
|
|
725
|
-
|
|
298
|
+
sig { returns(T.nilable(Float)) }
|
|
299
|
+
attr_accessor :temperature
|
|
726
300
|
|
|
727
301
|
# Configuration options for a text response from the model. Can be plain text or
|
|
728
302
|
# structured JSON data. Learn more:
|
|
729
303
|
#
|
|
730
304
|
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
731
305
|
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
732
|
-
|
|
306
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponseTextConfig)) }
|
|
307
|
+
attr_reader :text
|
|
308
|
+
|
|
309
|
+
sig { params(text: OpenAI::Responses::ResponseTextConfig::OrHash).void }
|
|
310
|
+
attr_writer :text
|
|
733
311
|
|
|
734
312
|
# How the model should select which tool (or tools) to use when generating a
|
|
735
313
|
# response. See the `tools` parameter to see how to specify which tools the model
|
|
736
314
|
# can call.
|
|
737
|
-
|
|
315
|
+
sig {
|
|
316
|
+
returns(
|
|
317
|
+
T.nilable(
|
|
318
|
+
T.any(
|
|
319
|
+
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
320
|
+
OpenAI::Responses::ToolChoiceAllowed,
|
|
321
|
+
OpenAI::Responses::ToolChoiceTypes,
|
|
322
|
+
OpenAI::Responses::ToolChoiceFunction,
|
|
323
|
+
OpenAI::Responses::ToolChoiceMcp,
|
|
324
|
+
OpenAI::Responses::ToolChoiceCustom,
|
|
325
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
326
|
+
OpenAI::Responses::ToolChoiceApplyPatch,
|
|
327
|
+
OpenAI::Responses::ToolChoiceShell
|
|
328
|
+
)
|
|
329
|
+
)
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
attr_reader :tool_choice
|
|
333
|
+
|
|
334
|
+
sig {
|
|
335
|
+
params(
|
|
336
|
+
tool_choice: T.any(
|
|
337
|
+
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
338
|
+
OpenAI::Responses::ToolChoiceAllowed::OrHash,
|
|
339
|
+
OpenAI::Responses::ToolChoiceTypes::OrHash,
|
|
340
|
+
OpenAI::Responses::ToolChoiceFunction::OrHash,
|
|
341
|
+
OpenAI::Responses::ToolChoiceMcp::OrHash,
|
|
342
|
+
OpenAI::Responses::ToolChoiceCustom::OrHash,
|
|
343
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::SpecificProgrammaticToolCallingParam::OrHash,
|
|
344
|
+
OpenAI::Responses::ToolChoiceApplyPatch::OrHash,
|
|
345
|
+
OpenAI::Responses::ToolChoiceShell::OrHash
|
|
346
|
+
)
|
|
347
|
+
)
|
|
348
|
+
.void
|
|
349
|
+
}
|
|
350
|
+
attr_writer :tool_choice
|
|
738
351
|
|
|
739
352
|
# An array of tools the model may call while generating a response. You can
|
|
740
353
|
# specify which tool to use by setting the `tool_choice` parameter.
|
|
@@ -755,19 +368,74 @@ module OpenAI
|
|
|
755
368
|
# Learn more about
|
|
756
369
|
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
|
757
370
|
# You can also use custom tools to call your own code.
|
|
758
|
-
|
|
371
|
+
sig {
|
|
372
|
+
returns(
|
|
373
|
+
T.nilable(
|
|
374
|
+
T::Array[
|
|
375
|
+
T.any(
|
|
376
|
+
OpenAI::Responses::FunctionTool,
|
|
377
|
+
OpenAI::Responses::FileSearchTool,
|
|
378
|
+
OpenAI::Responses::ComputerTool,
|
|
379
|
+
OpenAI::Responses::ComputerUsePreviewTool,
|
|
380
|
+
OpenAI::Responses::Tool::Mcp,
|
|
381
|
+
OpenAI::Responses::Tool::CodeInterpreter,
|
|
382
|
+
OpenAI::Responses::Tool::ProgrammaticToolCalling,
|
|
383
|
+
OpenAI::Responses::Tool::ImageGeneration,
|
|
384
|
+
OpenAI::Responses::Tool::LocalShell,
|
|
385
|
+
OpenAI::Responses::FunctionShellTool,
|
|
386
|
+
OpenAI::Responses::CustomTool,
|
|
387
|
+
OpenAI::Responses::NamespaceTool,
|
|
388
|
+
OpenAI::Responses::ToolSearchTool,
|
|
389
|
+
OpenAI::Responses::ApplyPatchTool,
|
|
390
|
+
OpenAI::Responses::WebSearchTool,
|
|
391
|
+
OpenAI::Responses::WebSearchPreviewTool
|
|
392
|
+
)
|
|
393
|
+
]
|
|
394
|
+
)
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
attr_reader :tools
|
|
398
|
+
|
|
399
|
+
sig {
|
|
400
|
+
params(
|
|
401
|
+
tools: T::Array[
|
|
402
|
+
T.any(
|
|
403
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
|
404
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
|
405
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
|
406
|
+
OpenAI::Responses::ComputerUsePreviewTool::OrHash,
|
|
407
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
|
408
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
|
409
|
+
OpenAI::Responses::Tool::ProgrammaticToolCalling::OrHash,
|
|
410
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
|
411
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
|
412
|
+
OpenAI::Responses::FunctionShellTool::OrHash,
|
|
413
|
+
OpenAI::Responses::CustomTool::OrHash,
|
|
414
|
+
OpenAI::Responses::NamespaceTool::OrHash,
|
|
415
|
+
OpenAI::Responses::ToolSearchTool::OrHash,
|
|
416
|
+
OpenAI::Responses::ApplyPatchTool::OrHash,
|
|
417
|
+
OpenAI::Responses::WebSearchTool::OrHash,
|
|
418
|
+
OpenAI::Responses::WebSearchPreviewTool::OrHash
|
|
419
|
+
)
|
|
420
|
+
]
|
|
421
|
+
)
|
|
422
|
+
.void
|
|
423
|
+
}
|
|
424
|
+
attr_writer :tools
|
|
759
425
|
|
|
760
426
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
761
427
|
# to return at each token position, each with an associated log probability. In
|
|
762
428
|
# some cases, the number of returned tokens may be fewer than requested.
|
|
763
|
-
|
|
429
|
+
sig { returns(T.nilable(Integer)) }
|
|
430
|
+
attr_accessor :top_logprobs
|
|
764
431
|
|
|
765
432
|
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
766
433
|
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
767
434
|
# means only the tokens comprising the top 10% probability mass are considered.
|
|
768
435
|
#
|
|
769
436
|
# We generally recommend altering this or `temperature` but not both.
|
|
770
|
-
|
|
437
|
+
sig { returns(T.nilable(Float)) }
|
|
438
|
+
attr_accessor :top_p
|
|
771
439
|
|
|
772
440
|
# The truncation strategy to use for the model response.
|
|
773
441
|
#
|
|
@@ -776,452 +444,926 @@ module OpenAI
|
|
|
776
444
|
# items from the beginning of the conversation.
|
|
777
445
|
# - `disabled` (default): If the input size will exceed the context window size
|
|
778
446
|
# for a model, the request will fail with a 400 error.
|
|
779
|
-
|
|
447
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation::OrSymbol)) }
|
|
448
|
+
attr_accessor :truncation
|
|
780
449
|
|
|
781
450
|
# This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
|
|
782
451
|
# `prompt_cache_key` instead to maintain caching optimizations. A stable
|
|
783
452
|
# identifier for your end-users. Used to boost cache hit rates by better bucketing
|
|
784
453
|
# similar requests and to help OpenAI detect and prevent abuse.
|
|
785
454
|
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
786
|
-
|
|
455
|
+
sig { returns(T.nilable(String)) }
|
|
456
|
+
attr_reader :user
|
|
787
457
|
|
|
788
|
-
|
|
458
|
+
sig { params(user: String).void }
|
|
459
|
+
attr_writer :user
|
|
789
460
|
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
461
|
+
# Client event for creating a response over a persistent WebSocket connection.
|
|
462
|
+
# This payload uses the same top-level fields as `POST /v1/responses`, plus
|
|
463
|
+
# WebSocket-only envelope metadata.
|
|
464
|
+
#
|
|
465
|
+
# Notes:
|
|
466
|
+
#
|
|
467
|
+
# - `stream` is implicit over WebSocket and should not be sent.
|
|
468
|
+
# - `background` is not supported over WebSocket.
|
|
469
|
+
# - `stream_id` is WebSocket-only and is not part of `POST /v1/responses`.
|
|
470
|
+
sig do
|
|
471
|
+
params(
|
|
793
472
|
|
|
794
|
-
sig do
|
|
795
|
-
override.returns(
|
|
796
|
-
{
|
|
797
|
-
type: Symbol,
|
|
798
473
|
background: T.nilable(T::Boolean),
|
|
799
|
-
|
|
800
|
-
|
|
474
|
+
|
|
475
|
+
context_management: T.nilable(
|
|
476
|
+
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement::OrHash]
|
|
477
|
+
),
|
|
478
|
+
|
|
479
|
+
conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam::OrHash)),
|
|
480
|
+
|
|
801
481
|
include: T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]),
|
|
802
|
-
|
|
482
|
+
|
|
483
|
+
input: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants,
|
|
484
|
+
|
|
803
485
|
instructions: T.nilable(String),
|
|
486
|
+
|
|
804
487
|
max_output_tokens: T.nilable(Integer),
|
|
488
|
+
|
|
805
489
|
max_tool_calls: T.nilable(Integer),
|
|
490
|
+
|
|
806
491
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
492
|
+
|
|
807
493
|
model: T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol),
|
|
808
|
-
|
|
494
|
+
|
|
495
|
+
moderation: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::OrHash),
|
|
496
|
+
|
|
809
497
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
498
|
+
|
|
810
499
|
previous_response_id: T.nilable(String),
|
|
811
|
-
|
|
500
|
+
|
|
501
|
+
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
502
|
+
|
|
812
503
|
prompt_cache_key: T.nilable(String),
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
504
|
+
|
|
505
|
+
prompt_cache_options: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::OrHash,
|
|
506
|
+
|
|
507
|
+
prompt_cache_retention: T.nilable(
|
|
508
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention::OrSymbol
|
|
509
|
+
),
|
|
510
|
+
|
|
511
|
+
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
512
|
+
|
|
816
513
|
safety_identifier: T.nilable(String),
|
|
817
|
-
|
|
514
|
+
|
|
515
|
+
service_tier: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::OrSymbol),
|
|
516
|
+
|
|
818
517
|
store: T.nilable(T::Boolean),
|
|
518
|
+
|
|
819
519
|
stream: T.nilable(T::Boolean),
|
|
520
|
+
|
|
820
521
|
stream_id: String,
|
|
821
|
-
|
|
522
|
+
|
|
523
|
+
stream_options: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::StreamOptions::OrHash),
|
|
524
|
+
|
|
822
525
|
temperature: T.nilable(Float),
|
|
823
|
-
|
|
526
|
+
|
|
527
|
+
text: OpenAI::Responses::ResponseTextConfig::OrHash,
|
|
528
|
+
|
|
824
529
|
tool_choice: T.any(
|
|
825
530
|
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
826
|
-
OpenAI::Responses::ToolChoiceAllowed,
|
|
827
|
-
OpenAI::Responses::ToolChoiceTypes,
|
|
828
|
-
OpenAI::Responses::ToolChoiceFunction,
|
|
829
|
-
OpenAI::Responses::ToolChoiceMcp,
|
|
830
|
-
OpenAI::Responses::ToolChoiceCustom,
|
|
831
|
-
OpenAI::Responses::ResponsesClientEvent::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
832
|
-
OpenAI::Responses::ToolChoiceApplyPatch,
|
|
833
|
-
OpenAI::Responses::ToolChoiceShell
|
|
531
|
+
OpenAI::Responses::ToolChoiceAllowed::OrHash,
|
|
532
|
+
OpenAI::Responses::ToolChoiceTypes::OrHash,
|
|
533
|
+
OpenAI::Responses::ToolChoiceFunction::OrHash,
|
|
534
|
+
OpenAI::Responses::ToolChoiceMcp::OrHash,
|
|
535
|
+
OpenAI::Responses::ToolChoiceCustom::OrHash,
|
|
536
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::SpecificProgrammaticToolCallingParam::OrHash,
|
|
537
|
+
OpenAI::Responses::ToolChoiceApplyPatch::OrHash,
|
|
538
|
+
OpenAI::Responses::ToolChoiceShell::OrHash
|
|
834
539
|
),
|
|
540
|
+
|
|
835
541
|
tools: T::Array[
|
|
836
542
|
T.any(
|
|
837
|
-
OpenAI::Responses::FunctionTool,
|
|
838
|
-
OpenAI::Responses::FileSearchTool,
|
|
839
|
-
OpenAI::Responses::ComputerTool,
|
|
840
|
-
OpenAI::Responses::ComputerUsePreviewTool,
|
|
841
|
-
OpenAI::Responses::Tool::Mcp,
|
|
842
|
-
OpenAI::Responses::Tool::CodeInterpreter,
|
|
843
|
-
OpenAI::Responses::Tool::ProgrammaticToolCalling,
|
|
844
|
-
OpenAI::Responses::Tool::ImageGeneration,
|
|
845
|
-
OpenAI::Responses::Tool::LocalShell,
|
|
846
|
-
OpenAI::Responses::FunctionShellTool,
|
|
847
|
-
OpenAI::Responses::CustomTool,
|
|
848
|
-
OpenAI::Responses::NamespaceTool,
|
|
849
|
-
OpenAI::Responses::ToolSearchTool,
|
|
850
|
-
OpenAI::Responses::ApplyPatchTool,
|
|
851
|
-
OpenAI::Responses::WebSearchTool,
|
|
852
|
-
OpenAI::Responses::WebSearchPreviewTool
|
|
543
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
|
544
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
|
545
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
|
546
|
+
OpenAI::Responses::ComputerUsePreviewTool::OrHash,
|
|
547
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
|
548
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
|
549
|
+
OpenAI::Responses::Tool::ProgrammaticToolCalling::OrHash,
|
|
550
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
|
551
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
|
552
|
+
OpenAI::Responses::FunctionShellTool::OrHash,
|
|
553
|
+
OpenAI::Responses::CustomTool::OrHash,
|
|
554
|
+
OpenAI::Responses::NamespaceTool::OrHash,
|
|
555
|
+
OpenAI::Responses::ToolSearchTool::OrHash,
|
|
556
|
+
OpenAI::Responses::ApplyPatchTool::OrHash,
|
|
557
|
+
OpenAI::Responses::WebSearchTool::OrHash,
|
|
558
|
+
OpenAI::Responses::WebSearchPreviewTool::OrHash
|
|
853
559
|
)
|
|
854
560
|
],
|
|
855
|
-
top_logprobs: T.nilable(Integer),
|
|
856
|
-
top_p: T.nilable(Float),
|
|
857
|
-
truncation: T.nilable(OpenAI::Responses::ResponsesClientEvent::Truncation::OrSymbol),
|
|
858
|
-
user: String
|
|
859
|
-
}
|
|
860
|
-
)
|
|
861
|
-
end
|
|
862
|
-
def to_hash
|
|
863
|
-
end
|
|
864
|
-
|
|
865
|
-
class ContextManagement < OpenAI::Internal::Type::BaseModel
|
|
866
|
-
OrHash = T.type_alias do
|
|
867
|
-
T.any(
|
|
868
|
-
OpenAI::Responses::ResponsesClientEvent::ContextManagement,
|
|
869
|
-
OpenAI::Internal::AnyHash
|
|
870
|
-
)
|
|
871
|
-
end
|
|
872
561
|
|
|
873
|
-
|
|
874
|
-
sig { returns(String) }
|
|
875
|
-
attr_accessor :type
|
|
562
|
+
top_logprobs: T.nilable(Integer),
|
|
876
563
|
|
|
877
|
-
|
|
878
|
-
sig { returns(T.nilable(Integer)) }
|
|
879
|
-
attr_accessor :compact_threshold
|
|
564
|
+
top_p: T.nilable(Float),
|
|
880
565
|
|
|
881
|
-
|
|
882
|
-
params(
|
|
566
|
+
truncation: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation::OrSymbol),
|
|
883
567
|
|
|
884
|
-
|
|
568
|
+
user: String,
|
|
885
569
|
|
|
886
|
-
|
|
570
|
+
type: Symbol
|
|
887
571
|
)
|
|
888
572
|
.returns(T.attached_class)
|
|
889
573
|
end
|
|
890
574
|
def self.new(
|
|
891
575
|
|
|
892
|
-
#
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
576
|
+
# Whether to run the model response in the background.
|
|
577
|
+
# [Learn more](https://platform.openai.com/docs/guides/background).
|
|
578
|
+
background: nil,
|
|
579
|
+
|
|
580
|
+
# Context management configuration for this request.
|
|
581
|
+
context_management: nil,
|
|
582
|
+
|
|
583
|
+
# The conversation that this response belongs to. Items from this conversation are
|
|
584
|
+
# prepended to `input_items` for this response request. Input items and output
|
|
585
|
+
# items from this response are automatically added to this conversation after this
|
|
586
|
+
# response completes.
|
|
587
|
+
conversation: nil,
|
|
588
|
+
|
|
589
|
+
# Specify additional output data to include in the model response. Currently
|
|
590
|
+
# supported values are:
|
|
591
|
+
#
|
|
592
|
+
# - `web_search_call.action.sources`: Include the sources of the web search tool
|
|
593
|
+
# call.
|
|
594
|
+
# - `code_interpreter_call.outputs`: Includes the outputs of python code execution
|
|
595
|
+
# in code interpreter tool call items.
|
|
596
|
+
# - `computer_call_output.output.image_url`: Include image urls from the computer
|
|
597
|
+
# call output.
|
|
598
|
+
# - `file_search_call.results`: Include the search results of the file search tool
|
|
599
|
+
# call.
|
|
600
|
+
# - `message.input_image.image_url`: Include image urls from the input message.
|
|
601
|
+
# - `message.output_text.logprobs`: Include logprobs with assistant messages.
|
|
602
|
+
# - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
|
|
603
|
+
# tokens in reasoning item outputs. This enables reasoning items to be used in
|
|
604
|
+
# multi-turn conversations when using the Responses API statelessly (like when
|
|
605
|
+
# the `store` parameter is set to `false`, or when an organization is enrolled
|
|
606
|
+
# in the zero data retention program).
|
|
607
|
+
include: nil,
|
|
608
|
+
|
|
609
|
+
# Text, image, or file inputs to the model, used to generate a response.
|
|
610
|
+
#
|
|
611
|
+
# Learn more:
|
|
612
|
+
#
|
|
613
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
614
|
+
# - [Image inputs](https://platform.openai.com/docs/guides/images)
|
|
615
|
+
# - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
|
|
616
|
+
# - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
|
|
617
|
+
# - [Function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
618
|
+
input: nil,
|
|
619
|
+
|
|
620
|
+
# A system (or developer) message inserted into the model's context.
|
|
621
|
+
#
|
|
622
|
+
# When using along with `previous_response_id`, the instructions from a previous
|
|
623
|
+
# response will not be carried over to the next response. This makes it simple to
|
|
624
|
+
# swap out system (or developer) messages in new responses.
|
|
625
|
+
instructions: nil,
|
|
626
|
+
|
|
627
|
+
# An upper bound for the number of tokens that can be generated for a response,
|
|
628
|
+
# including visible output tokens and
|
|
629
|
+
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
|
630
|
+
max_output_tokens: nil,
|
|
631
|
+
|
|
632
|
+
# The maximum number of total calls to built-in tools that can be processed in a
|
|
633
|
+
# response. This maximum number applies across all built-in tool calls, not per
|
|
634
|
+
# individual tool. Any further attempts to call a tool by the model will be
|
|
635
|
+
# ignored.
|
|
636
|
+
max_tool_calls: nil,
|
|
637
|
+
|
|
638
|
+
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
639
|
+
# for storing additional information about the object in a structured format, and
|
|
640
|
+
# querying for objects via API or the dashboard.
|
|
641
|
+
#
|
|
642
|
+
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
643
|
+
# a maximum length of 512 characters.
|
|
644
|
+
metadata: nil,
|
|
645
|
+
|
|
646
|
+
# Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide
|
|
647
|
+
# range of models with different capabilities, performance characteristics, and
|
|
648
|
+
# price points. Refer to the
|
|
649
|
+
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
650
|
+
# available models.
|
|
651
|
+
model: nil,
|
|
652
|
+
|
|
653
|
+
# Configuration for running moderation on the input and output of this response.
|
|
654
|
+
moderation: nil,
|
|
655
|
+
|
|
656
|
+
# Whether to allow the model to run tool calls in parallel.
|
|
657
|
+
parallel_tool_calls: nil,
|
|
658
|
+
|
|
659
|
+
# The unique ID of the previous response to the model. Use this to create
|
|
660
|
+
# multi-turn conversations. Learn more about
|
|
661
|
+
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
662
|
+
# Cannot be used in conjunction with `conversation`.
|
|
663
|
+
previous_response_id: nil,
|
|
664
|
+
|
|
665
|
+
# Reference to a prompt template and its variables.
|
|
666
|
+
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
667
|
+
prompt: nil,
|
|
668
|
+
|
|
669
|
+
# Used by OpenAI to cache responses for similar requests to optimize your cache
|
|
670
|
+
# hit rates. Replaces the `user` field.
|
|
671
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
672
|
+
prompt_cache_key: nil,
|
|
673
|
+
|
|
674
|
+
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
675
|
+
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
676
|
+
# explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
677
|
+
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
678
|
+
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
679
|
+
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
680
|
+
# `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
681
|
+
# [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
682
|
+
# for current details.
|
|
683
|
+
prompt_cache_options: nil,
|
|
684
|
+
|
|
685
|
+
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
686
|
+
#
|
|
687
|
+
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
688
|
+
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
689
|
+
# of 24 hours.
|
|
690
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
691
|
+
# This field expresses a maximum retention policy, while
|
|
692
|
+
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
693
|
+
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
694
|
+
# models, only `24h` is supported.
|
|
695
|
+
#
|
|
696
|
+
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
697
|
+
# your organization's data retention policy:
|
|
698
|
+
#
|
|
699
|
+
# - Organizations without ZDR enabled default to `24h`.
|
|
700
|
+
# - Organizations with ZDR enabled default to `in_memory` when
|
|
701
|
+
# `prompt_cache_retention` is not specified.
|
|
702
|
+
prompt_cache_retention: nil,
|
|
703
|
+
|
|
704
|
+
# Configuration options for
|
|
705
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
706
|
+
reasoning: nil,
|
|
707
|
+
|
|
708
|
+
# A stable identifier used to help detect users of your application that may be
|
|
709
|
+
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
710
|
+
# identifies each user, with a maximum length of 64 characters. We recommend
|
|
711
|
+
# hashing their username or email address, in order to avoid sending us any
|
|
712
|
+
# identifying information.
|
|
713
|
+
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
714
|
+
safety_identifier: nil,
|
|
715
|
+
|
|
716
|
+
# Specifies the processing type used for serving the request.
|
|
717
|
+
#
|
|
718
|
+
# - If set to 'auto', then the request will be processed with the service tier
|
|
719
|
+
# configured in the Project settings. Unless otherwise configured, the Project
|
|
720
|
+
# will use 'default'.
|
|
721
|
+
# - If set to 'default', then the request will be processed with the standard
|
|
722
|
+
# pricing and performance for the selected model.
|
|
723
|
+
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
|
|
724
|
+
# then the request will be processed with the Flex Processing service tier.
|
|
725
|
+
# - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
|
|
726
|
+
# include the `service_tier=fast` or `service_tier=priority` parameter for
|
|
727
|
+
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
728
|
+
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
729
|
+
# request.
|
|
730
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
731
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
732
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
733
|
+
# `service_tier=ultrafast`.
|
|
734
|
+
# - When not set, the default behavior is 'auto'.
|
|
735
|
+
#
|
|
736
|
+
# When the `service_tier` parameter is set, the response body will include the
|
|
737
|
+
# `service_tier` value based on the processing mode actually used to serve the
|
|
738
|
+
# request. This response value may be different from the value set in the
|
|
739
|
+
# parameter.
|
|
740
|
+
service_tier: nil,
|
|
741
|
+
|
|
742
|
+
# Whether to store the generated model response for later retrieval via API.
|
|
743
|
+
store: nil,
|
|
744
|
+
|
|
745
|
+
# If set to true, the model response data will be streamed to the client as it is
|
|
746
|
+
# generated using
|
|
747
|
+
# [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
|
|
748
|
+
# See the
|
|
749
|
+
# [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
|
|
750
|
+
# for more information.
|
|
751
|
+
stream: nil,
|
|
752
|
+
|
|
753
|
+
# The WebSocket lane for this response. Requests with the same `stream_id` are
|
|
754
|
+
# processed FIFO, and events for the response echo the same `stream_id`.
|
|
755
|
+
#
|
|
756
|
+
# `stream_id` controls routing; `previous_response_id` controls conversation
|
|
757
|
+
# lineage, so a new lane can fork from a response created on another lane.
|
|
758
|
+
stream_id: nil,
|
|
759
|
+
|
|
760
|
+
# Options for streaming responses. Only set this when you set `stream: true`.
|
|
761
|
+
stream_options: nil,
|
|
762
|
+
|
|
763
|
+
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
764
|
+
# make the output more random, while lower values like 0.2 will make it more
|
|
765
|
+
# focused and deterministic. We generally recommend altering this or `top_p` but
|
|
766
|
+
# not both.
|
|
767
|
+
temperature: nil,
|
|
768
|
+
|
|
769
|
+
# Configuration options for a text response from the model. Can be plain text or
|
|
770
|
+
# structured JSON data. Learn more:
|
|
771
|
+
#
|
|
772
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
773
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
774
|
+
text: nil,
|
|
775
|
+
|
|
776
|
+
# How the model should select which tool (or tools) to use when generating a
|
|
777
|
+
# response. See the `tools` parameter to see how to specify which tools the model
|
|
778
|
+
# can call.
|
|
779
|
+
tool_choice: nil,
|
|
780
|
+
|
|
781
|
+
# An array of tools the model may call while generating a response. You can
|
|
782
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
|
783
|
+
#
|
|
784
|
+
# We support the following categories of tools:
|
|
785
|
+
#
|
|
786
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
|
787
|
+
# capabilities, like
|
|
788
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
|
789
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
|
790
|
+
# Learn more about
|
|
791
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
|
792
|
+
# - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
|
|
793
|
+
# predefined connectors such as Google Drive and SharePoint. Learn more about
|
|
794
|
+
# [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
|
|
795
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
|
796
|
+
# the model to call your own code with strongly typed arguments and outputs.
|
|
797
|
+
# Learn more about
|
|
798
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
|
799
|
+
# You can also use custom tools to call your own code.
|
|
800
|
+
tools: nil,
|
|
801
|
+
|
|
802
|
+
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
803
|
+
# to return at each token position, each with an associated log probability. In
|
|
804
|
+
# some cases, the number of returned tokens may be fewer than requested.
|
|
805
|
+
top_logprobs: nil,
|
|
806
|
+
|
|
807
|
+
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
808
|
+
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
809
|
+
# means only the tokens comprising the top 10% probability mass are considered.
|
|
810
|
+
#
|
|
811
|
+
# We generally recommend altering this or `temperature` but not both.
|
|
812
|
+
top_p: nil,
|
|
813
|
+
|
|
814
|
+
# The truncation strategy to use for the model response.
|
|
815
|
+
#
|
|
816
|
+
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
817
|
+
# the model will truncate the response to fit the context window by dropping
|
|
818
|
+
# items from the beginning of the conversation.
|
|
819
|
+
# - `disabled` (default): If the input size will exceed the context window size
|
|
820
|
+
# for a model, the request will fail with a 400 error.
|
|
821
|
+
truncation: nil,
|
|
822
|
+
|
|
823
|
+
# This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
|
|
824
|
+
# `prompt_cache_key` instead to maintain caching optimizations. A stable
|
|
825
|
+
# identifier for your end-users. Used to boost cache hit rates by better bucketing
|
|
826
|
+
# similar requests and to help OpenAI detect and prevent abuse.
|
|
827
|
+
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
828
|
+
user: nil,
|
|
829
|
+
|
|
830
|
+
# The type of the client event. Always `response.create`.
|
|
831
|
+
|
|
832
|
+
type: :"response.create"
|
|
898
833
|
)
|
|
899
834
|
end
|
|
900
835
|
|
|
901
836
|
sig do
|
|
902
837
|
override.returns(
|
|
903
|
-
{
|
|
838
|
+
{
|
|
839
|
+
type: Symbol,
|
|
840
|
+
background: T.nilable(T::Boolean),
|
|
841
|
+
context_management: T.nilable(
|
|
842
|
+
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement]
|
|
843
|
+
),
|
|
844
|
+
conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam)),
|
|
845
|
+
include: T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]),
|
|
846
|
+
input: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants,
|
|
847
|
+
instructions: T.nilable(String),
|
|
848
|
+
max_output_tokens: T.nilable(Integer),
|
|
849
|
+
max_tool_calls: T.nilable(Integer),
|
|
850
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
851
|
+
model: T.any(String, OpenAI::ChatModel::OrSymbol, OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol),
|
|
852
|
+
moderation: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation),
|
|
853
|
+
parallel_tool_calls: T.nilable(T::Boolean),
|
|
854
|
+
previous_response_id: T.nilable(String),
|
|
855
|
+
prompt: T.nilable(OpenAI::Responses::ResponsePrompt),
|
|
856
|
+
prompt_cache_key: T.nilable(String),
|
|
857
|
+
prompt_cache_options: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions,
|
|
858
|
+
prompt_cache_retention: T.nilable(
|
|
859
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention::OrSymbol
|
|
860
|
+
),
|
|
861
|
+
reasoning: T.nilable(OpenAI::Reasoning),
|
|
862
|
+
safety_identifier: T.nilable(String),
|
|
863
|
+
service_tier: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::OrSymbol),
|
|
864
|
+
store: T.nilable(T::Boolean),
|
|
865
|
+
stream: T.nilable(T::Boolean),
|
|
866
|
+
stream_id: String,
|
|
867
|
+
stream_options: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::StreamOptions),
|
|
868
|
+
temperature: T.nilable(Float),
|
|
869
|
+
text: OpenAI::Responses::ResponseTextConfig,
|
|
870
|
+
tool_choice: T.any(
|
|
871
|
+
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
872
|
+
OpenAI::Responses::ToolChoiceAllowed,
|
|
873
|
+
OpenAI::Responses::ToolChoiceTypes,
|
|
874
|
+
OpenAI::Responses::ToolChoiceFunction,
|
|
875
|
+
OpenAI::Responses::ToolChoiceMcp,
|
|
876
|
+
OpenAI::Responses::ToolChoiceCustom,
|
|
877
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
878
|
+
OpenAI::Responses::ToolChoiceApplyPatch,
|
|
879
|
+
OpenAI::Responses::ToolChoiceShell
|
|
880
|
+
),
|
|
881
|
+
tools: T::Array[
|
|
882
|
+
T.any(
|
|
883
|
+
OpenAI::Responses::FunctionTool,
|
|
884
|
+
OpenAI::Responses::FileSearchTool,
|
|
885
|
+
OpenAI::Responses::ComputerTool,
|
|
886
|
+
OpenAI::Responses::ComputerUsePreviewTool,
|
|
887
|
+
OpenAI::Responses::Tool::Mcp,
|
|
888
|
+
OpenAI::Responses::Tool::CodeInterpreter,
|
|
889
|
+
OpenAI::Responses::Tool::ProgrammaticToolCalling,
|
|
890
|
+
OpenAI::Responses::Tool::ImageGeneration,
|
|
891
|
+
OpenAI::Responses::Tool::LocalShell,
|
|
892
|
+
OpenAI::Responses::FunctionShellTool,
|
|
893
|
+
OpenAI::Responses::CustomTool,
|
|
894
|
+
OpenAI::Responses::NamespaceTool,
|
|
895
|
+
OpenAI::Responses::ToolSearchTool,
|
|
896
|
+
OpenAI::Responses::ApplyPatchTool,
|
|
897
|
+
OpenAI::Responses::WebSearchTool,
|
|
898
|
+
OpenAI::Responses::WebSearchPreviewTool
|
|
899
|
+
)
|
|
900
|
+
],
|
|
901
|
+
top_logprobs: T.nilable(Integer),
|
|
902
|
+
top_p: T.nilable(Float),
|
|
903
|
+
truncation: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation::OrSymbol),
|
|
904
|
+
user: String
|
|
905
|
+
}
|
|
904
906
|
)
|
|
905
907
|
end
|
|
906
908
|
def to_hash
|
|
907
909
|
end
|
|
908
910
|
|
|
909
|
-
|
|
911
|
+
class ContextManagement < OpenAI::Internal::Type::BaseModel
|
|
912
|
+
OrHash = T.type_alias do
|
|
913
|
+
T.any(
|
|
914
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement,
|
|
915
|
+
OpenAI::Internal::AnyHash
|
|
916
|
+
)
|
|
917
|
+
end
|
|
910
918
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
# response completes.
|
|
915
|
-
module Conversation
|
|
916
|
-
extend OpenAI::Internal::Type::Union
|
|
919
|
+
# The context management entry type. Currently only 'compaction' is supported.
|
|
920
|
+
sig { returns(String) }
|
|
921
|
+
attr_accessor :type
|
|
917
922
|
|
|
918
|
-
|
|
923
|
+
# Token threshold at which compaction should be triggered for this entry.
|
|
924
|
+
sig { returns(T.nilable(Integer)) }
|
|
925
|
+
attr_accessor :compact_threshold
|
|
919
926
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
end
|
|
927
|
+
sig do
|
|
928
|
+
params(
|
|
923
929
|
|
|
924
|
-
|
|
930
|
+
type: String,
|
|
925
931
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
# - [Image inputs](https://platform.openai.com/docs/guides/images)
|
|
932
|
-
# - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
|
|
933
|
-
# - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
|
|
934
|
-
# - [Function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
935
|
-
module Input
|
|
936
|
-
extend OpenAI::Internal::Type::Union
|
|
937
|
-
|
|
938
|
-
Variants = T.type_alias { T.any(String, T::Array[OpenAI::Responses::ResponseInputItem::Variants]) }
|
|
939
|
-
|
|
940
|
-
sig { override.returns(T::Array[OpenAI::Responses::ResponsesClientEvent::Input::Variants]) }
|
|
941
|
-
def self.variants
|
|
942
|
-
end
|
|
932
|
+
compact_threshold: T.nilable(Integer)
|
|
933
|
+
)
|
|
934
|
+
.returns(T.attached_class)
|
|
935
|
+
end
|
|
936
|
+
def self.new(
|
|
943
937
|
|
|
944
|
-
|
|
938
|
+
# The context management entry type. Currently only 'compaction' is supported.
|
|
939
|
+
type:,
|
|
945
940
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
OpenAI::Responses::ResponsesClientEvent::Moderation,
|
|
950
|
-
OpenAI::Internal::AnyHash
|
|
941
|
+
# Token threshold at which compaction should be triggered for this entry.
|
|
942
|
+
|
|
943
|
+
compact_threshold: nil
|
|
951
944
|
)
|
|
952
|
-
|
|
945
|
+
end
|
|
953
946
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
947
|
+
sig do
|
|
948
|
+
override.returns(
|
|
949
|
+
{type: String, compact_threshold: T.nilable(Integer)}
|
|
950
|
+
)
|
|
951
|
+
end
|
|
952
|
+
def to_hash
|
|
953
|
+
end
|
|
958
954
|
|
|
959
|
-
|
|
960
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::Policy)) }
|
|
961
|
-
attr_reader :policy
|
|
955
|
+
end
|
|
962
956
|
|
|
963
|
-
|
|
964
|
-
|
|
957
|
+
# The conversation that this response belongs to. Items from this conversation are
|
|
958
|
+
# prepended to `input_items` for this response request. Input items and output
|
|
959
|
+
# items from this response are automatically added to this conversation after this
|
|
960
|
+
# response completes.
|
|
961
|
+
module Conversation
|
|
962
|
+
extend OpenAI::Internal::Type::Union
|
|
965
963
|
|
|
966
|
-
|
|
967
|
-
sig do
|
|
968
|
-
params(
|
|
964
|
+
Variants = T.type_alias { T.any(String, OpenAI::Responses::ResponseConversationParam) }
|
|
969
965
|
|
|
970
|
-
|
|
966
|
+
sig {
|
|
967
|
+
override.returns(
|
|
968
|
+
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Conversation::Variants]
|
|
969
|
+
)
|
|
970
|
+
}
|
|
971
|
+
def self.variants
|
|
972
|
+
end
|
|
971
973
|
|
|
972
|
-
policy: T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::Policy::OrHash)
|
|
973
|
-
)
|
|
974
|
-
.returns(T.attached_class)
|
|
975
974
|
end
|
|
976
|
-
def self.new(
|
|
977
|
-
|
|
978
|
-
# The moderation model to use for moderated completions, e.g.
|
|
979
|
-
# 'omni-moderation-latest'.
|
|
980
|
-
model:,
|
|
981
975
|
|
|
982
|
-
|
|
976
|
+
# Text, image, or file inputs to the model, used to generate a response.
|
|
977
|
+
#
|
|
978
|
+
# Learn more:
|
|
979
|
+
#
|
|
980
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
981
|
+
# - [Image inputs](https://platform.openai.com/docs/guides/images)
|
|
982
|
+
# - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
|
|
983
|
+
# - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
|
|
984
|
+
# - [Function calling](https://platform.openai.com/docs/guides/function-calling)
|
|
985
|
+
module Input
|
|
986
|
+
extend OpenAI::Internal::Type::Union
|
|
983
987
|
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
988
|
+
Variants = T.type_alias { T.any(String, T::Array[OpenAI::Responses::ResponseInputItem::Variants]) }
|
|
989
|
+
|
|
990
|
+
sig {
|
|
991
|
+
override.returns(T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants])
|
|
992
|
+
}
|
|
993
|
+
def self.variants
|
|
994
|
+
end
|
|
987
995
|
|
|
988
|
-
sig do
|
|
989
|
-
override.returns(
|
|
990
|
-
{model: String, policy: T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::Policy)}
|
|
991
|
-
)
|
|
992
|
-
end
|
|
993
|
-
def to_hash
|
|
994
996
|
end
|
|
995
997
|
|
|
996
|
-
class
|
|
998
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
997
999
|
OrHash = T.type_alias do
|
|
998
1000
|
T.any(
|
|
999
|
-
OpenAI::Responses::ResponsesClientEvent::Moderation
|
|
1001
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation,
|
|
1000
1002
|
OpenAI::Internal::AnyHash
|
|
1001
1003
|
)
|
|
1002
1004
|
end
|
|
1003
1005
|
|
|
1004
|
-
# The moderation
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
sig {
|
|
1009
|
-
params(input: T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::Policy::Input::OrHash)).void
|
|
1010
|
-
}
|
|
1011
|
-
attr_writer :input
|
|
1006
|
+
# The moderation model to use for moderated completions, e.g.
|
|
1007
|
+
# 'omni-moderation-latest'.
|
|
1008
|
+
sig { returns(String) }
|
|
1009
|
+
attr_accessor :model
|
|
1012
1010
|
|
|
1013
|
-
# The
|
|
1014
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::Moderation::Policy
|
|
1015
|
-
attr_reader :
|
|
1011
|
+
# The policy to apply to moderated response input and output.
|
|
1012
|
+
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy)) }
|
|
1013
|
+
attr_reader :policy
|
|
1016
1014
|
|
|
1017
1015
|
sig {
|
|
1018
|
-
params(
|
|
1016
|
+
params(
|
|
1017
|
+
policy: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::OrHash)
|
|
1018
|
+
)
|
|
1019
1019
|
.void
|
|
1020
1020
|
}
|
|
1021
|
-
attr_writer :
|
|
1021
|
+
attr_writer :policy
|
|
1022
1022
|
|
|
1023
|
-
#
|
|
1023
|
+
# Configuration for running moderation on the input and output of this response.
|
|
1024
1024
|
sig do
|
|
1025
1025
|
params(
|
|
1026
1026
|
|
|
1027
|
-
|
|
1027
|
+
model: String,
|
|
1028
1028
|
|
|
1029
|
-
|
|
1029
|
+
policy: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::OrHash)
|
|
1030
1030
|
)
|
|
1031
1031
|
.returns(T.attached_class)
|
|
1032
1032
|
end
|
|
1033
1033
|
def self.new(
|
|
1034
1034
|
|
|
1035
|
-
# The moderation
|
|
1036
|
-
|
|
1035
|
+
# The moderation model to use for moderated completions, e.g.
|
|
1036
|
+
# 'omni-moderation-latest'.
|
|
1037
|
+
model:,
|
|
1037
1038
|
|
|
1038
|
-
# The
|
|
1039
|
+
# The policy to apply to moderated response input and output.
|
|
1039
1040
|
|
|
1040
|
-
|
|
1041
|
+
policy: nil
|
|
1041
1042
|
)
|
|
1042
1043
|
end
|
|
1043
1044
|
|
|
1044
1045
|
sig do
|
|
1045
1046
|
override.returns(
|
|
1046
1047
|
{
|
|
1047
|
-
|
|
1048
|
-
|
|
1048
|
+
model: String,
|
|
1049
|
+
policy: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy)
|
|
1049
1050
|
}
|
|
1050
1051
|
)
|
|
1051
1052
|
end
|
|
1052
1053
|
def to_hash
|
|
1053
1054
|
end
|
|
1054
1055
|
|
|
1055
|
-
class
|
|
1056
|
+
class Policy < OpenAI::Internal::Type::BaseModel
|
|
1056
1057
|
OrHash = T.type_alias do
|
|
1057
1058
|
T.any(
|
|
1058
|
-
OpenAI::Responses::ResponsesClientEvent::Moderation::Policy
|
|
1059
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy,
|
|
1059
1060
|
OpenAI::Internal::AnyHash
|
|
1060
1061
|
)
|
|
1061
1062
|
end
|
|
1062
1063
|
|
|
1063
|
-
sig { returns(OpenAI::Responses::ResponsesClientEvent::Moderation::Policy::Input::Mode::OrSymbol) }
|
|
1064
|
-
attr_accessor :mode
|
|
1065
|
-
|
|
1066
1064
|
# The moderation policy for the response input.
|
|
1065
|
+
sig {
|
|
1066
|
+
returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input))
|
|
1067
|
+
}
|
|
1068
|
+
attr_reader :input
|
|
1069
|
+
|
|
1070
|
+
sig {
|
|
1071
|
+
params(
|
|
1072
|
+
input: T.nilable(
|
|
1073
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::OrHash
|
|
1074
|
+
)
|
|
1075
|
+
)
|
|
1076
|
+
.void
|
|
1077
|
+
}
|
|
1078
|
+
attr_writer :input
|
|
1079
|
+
|
|
1080
|
+
# The moderation policy for the response output.
|
|
1081
|
+
sig {
|
|
1082
|
+
returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output))
|
|
1083
|
+
}
|
|
1084
|
+
attr_reader :output
|
|
1085
|
+
|
|
1086
|
+
sig {
|
|
1087
|
+
params(
|
|
1088
|
+
output: T.nilable(
|
|
1089
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::OrHash
|
|
1090
|
+
)
|
|
1091
|
+
)
|
|
1092
|
+
.void
|
|
1093
|
+
}
|
|
1094
|
+
attr_writer :output
|
|
1095
|
+
|
|
1096
|
+
# The policy to apply to moderated response input and output.
|
|
1067
1097
|
sig do
|
|
1068
1098
|
params(
|
|
1069
1099
|
|
|
1070
|
-
|
|
1100
|
+
input: T.nilable(
|
|
1101
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::OrHash
|
|
1102
|
+
),
|
|
1103
|
+
|
|
1104
|
+
output: T.nilable(
|
|
1105
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::OrHash
|
|
1106
|
+
)
|
|
1071
1107
|
)
|
|
1072
1108
|
.returns(T.attached_class)
|
|
1073
1109
|
end
|
|
1074
1110
|
def self.new(
|
|
1075
1111
|
|
|
1076
|
-
|
|
1112
|
+
# The moderation policy for the response input.
|
|
1113
|
+
input: nil,
|
|
1114
|
+
|
|
1115
|
+
# The moderation policy for the response output.
|
|
1116
|
+
|
|
1117
|
+
output: nil
|
|
1077
1118
|
)
|
|
1078
1119
|
end
|
|
1079
1120
|
|
|
1080
1121
|
sig do
|
|
1081
1122
|
override.returns(
|
|
1082
|
-
{
|
|
1123
|
+
{
|
|
1124
|
+
input: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input),
|
|
1125
|
+
output: T.nilable(
|
|
1126
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output
|
|
1127
|
+
)
|
|
1128
|
+
}
|
|
1083
1129
|
)
|
|
1084
1130
|
end
|
|
1085
1131
|
def to_hash
|
|
1086
1132
|
end
|
|
1087
1133
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1134
|
+
class Input < OpenAI::Internal::Type::BaseModel
|
|
1135
|
+
OrHash = T.type_alias do
|
|
1136
|
+
T.any(
|
|
1137
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input,
|
|
1138
|
+
OpenAI::Internal::AnyHash
|
|
1139
|
+
)
|
|
1140
|
+
end
|
|
1090
1141
|
|
|
1091
|
-
|
|
1092
|
-
|
|
1142
|
+
sig {
|
|
1143
|
+
returns(
|
|
1144
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode::OrSymbol
|
|
1145
|
+
)
|
|
1093
1146
|
}
|
|
1094
|
-
|
|
1147
|
+
attr_accessor :mode
|
|
1095
1148
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
)
|
|
1100
|
-
BLOCK = T.let(
|
|
1101
|
-
:block,
|
|
1102
|
-
OpenAI::Responses::ResponsesClientEvent::Moderation::Policy::Input::Mode::TaggedSymbol
|
|
1103
|
-
)
|
|
1149
|
+
# The moderation policy for the response input.
|
|
1150
|
+
sig do
|
|
1151
|
+
params(
|
|
1104
1152
|
|
|
1105
|
-
|
|
1106
|
-
override.returns(
|
|
1107
|
-
T::Array[OpenAI::Responses::ResponsesClientEvent::Moderation::Policy::Input::Mode::TaggedSymbol]
|
|
1153
|
+
mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode::OrSymbol
|
|
1108
1154
|
)
|
|
1109
|
-
|
|
1110
|
-
def self.values
|
|
1155
|
+
.returns(T.attached_class)
|
|
1111
1156
|
end
|
|
1112
|
-
|
|
1113
|
-
end
|
|
1157
|
+
def self.new(
|
|
1114
1158
|
|
|
1115
|
-
|
|
1116
|
-
OrHash = T.type_alias do
|
|
1117
|
-
T.any(
|
|
1118
|
-
OpenAI::Responses::ResponsesClientEvent::Moderation::Policy::Output,
|
|
1119
|
-
OpenAI::Internal::AnyHash
|
|
1159
|
+
mode:
|
|
1120
1160
|
)
|
|
1121
|
-
|
|
1161
|
+
end
|
|
1122
1162
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1163
|
+
sig do
|
|
1164
|
+
override.returns(
|
|
1165
|
+
{
|
|
1166
|
+
mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode::OrSymbol
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
1169
|
+
end
|
|
1170
|
+
def to_hash
|
|
1171
|
+
end
|
|
1125
1172
|
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
params(
|
|
1173
|
+
module Mode
|
|
1174
|
+
extend OpenAI::Internal::Type::Enum
|
|
1129
1175
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1176
|
+
TaggedSymbol = T.type_alias {
|
|
1177
|
+
T.all(
|
|
1178
|
+
Symbol,
|
|
1179
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode
|
|
1180
|
+
)
|
|
1181
|
+
}
|
|
1182
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1135
1183
|
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1184
|
+
SCORE = T.let(
|
|
1185
|
+
:score,
|
|
1186
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode::TaggedSymbol
|
|
1187
|
+
)
|
|
1188
|
+
BLOCK = T.let(
|
|
1189
|
+
:block,
|
|
1190
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode::TaggedSymbol
|
|
1191
|
+
)
|
|
1139
1192
|
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1193
|
+
sig {
|
|
1194
|
+
override.returns(
|
|
1195
|
+
T::Array[
|
|
1196
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Input::Mode::TaggedSymbol
|
|
1197
|
+
]
|
|
1198
|
+
)
|
|
1199
|
+
}
|
|
1200
|
+
def self.values
|
|
1201
|
+
end
|
|
1202
|
+
end
|
|
1146
1203
|
end
|
|
1147
1204
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1205
|
+
class Output < OpenAI::Internal::Type::BaseModel
|
|
1206
|
+
OrHash = T.type_alias do
|
|
1207
|
+
T.any(
|
|
1208
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output,
|
|
1209
|
+
OpenAI::Internal::AnyHash
|
|
1210
|
+
)
|
|
1211
|
+
end
|
|
1150
1212
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1213
|
+
sig {
|
|
1214
|
+
returns(
|
|
1215
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode::OrSymbol
|
|
1216
|
+
)
|
|
1153
1217
|
}
|
|
1154
|
-
|
|
1218
|
+
attr_accessor :mode
|
|
1155
1219
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1220
|
+
# The moderation policy for the response output.
|
|
1221
|
+
sig do
|
|
1222
|
+
params(
|
|
1223
|
+
|
|
1224
|
+
mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode::OrSymbol
|
|
1225
|
+
)
|
|
1226
|
+
.returns(T.attached_class)
|
|
1227
|
+
end
|
|
1228
|
+
def self.new(
|
|
1229
|
+
|
|
1230
|
+
mode:
|
|
1163
1231
|
)
|
|
1232
|
+
end
|
|
1164
1233
|
|
|
1165
|
-
sig
|
|
1234
|
+
sig do
|
|
1166
1235
|
override.returns(
|
|
1167
|
-
|
|
1236
|
+
{
|
|
1237
|
+
mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode::OrSymbol
|
|
1238
|
+
}
|
|
1168
1239
|
)
|
|
1169
|
-
|
|
1170
|
-
def
|
|
1240
|
+
end
|
|
1241
|
+
def to_hash
|
|
1242
|
+
end
|
|
1243
|
+
|
|
1244
|
+
module Mode
|
|
1245
|
+
extend OpenAI::Internal::Type::Enum
|
|
1246
|
+
|
|
1247
|
+
TaggedSymbol = T.type_alias {
|
|
1248
|
+
T.all(
|
|
1249
|
+
Symbol,
|
|
1250
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode
|
|
1251
|
+
)
|
|
1252
|
+
}
|
|
1253
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1254
|
+
|
|
1255
|
+
SCORE = T.let(
|
|
1256
|
+
:score,
|
|
1257
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode::TaggedSymbol
|
|
1258
|
+
)
|
|
1259
|
+
BLOCK = T.let(
|
|
1260
|
+
:block,
|
|
1261
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode::TaggedSymbol
|
|
1262
|
+
)
|
|
1263
|
+
|
|
1264
|
+
sig {
|
|
1265
|
+
override.returns(
|
|
1266
|
+
T::Array[
|
|
1267
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Moderation::Policy::Output::Mode::TaggedSymbol
|
|
1268
|
+
]
|
|
1269
|
+
)
|
|
1270
|
+
}
|
|
1271
|
+
def self.values
|
|
1272
|
+
end
|
|
1171
1273
|
end
|
|
1172
1274
|
end
|
|
1173
1275
|
end
|
|
1174
1276
|
end
|
|
1175
|
-
end
|
|
1176
1277
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1278
|
+
class PromptCacheOptions < OpenAI::Internal::Type::BaseModel
|
|
1279
|
+
OrHash = T.type_alias do
|
|
1280
|
+
T.any(
|
|
1281
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions,
|
|
1282
|
+
OpenAI::Internal::AnyHash
|
|
1283
|
+
)
|
|
1284
|
+
end
|
|
1184
1285
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1286
|
+
# Controls whether OpenAI automatically creates an implicit cache breakpoint.
|
|
1287
|
+
# Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
|
|
1288
|
+
# and writes up to the latest three explicit breakpoints in the request. With
|
|
1289
|
+
# `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
|
|
1290
|
+
# latest four explicit breakpoints. If there are no explicit breakpoints, the
|
|
1291
|
+
# request does not use prompt caching.
|
|
1292
|
+
sig {
|
|
1293
|
+
returns(
|
|
1294
|
+
T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::OrSymbol)
|
|
1295
|
+
)
|
|
1296
|
+
}
|
|
1297
|
+
attr_reader :mode
|
|
1193
1298
|
|
|
1194
|
-
|
|
1195
|
-
|
|
1299
|
+
sig {
|
|
1300
|
+
params(mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::OrSymbol)
|
|
1301
|
+
.void
|
|
1302
|
+
}
|
|
1303
|
+
attr_writer :mode
|
|
1304
|
+
|
|
1305
|
+
# The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
1306
|
+
# written by the request. Defaults to `30m`, which is currently the only supported
|
|
1307
|
+
# value. The backend may retain cache entries for longer.
|
|
1308
|
+
sig {
|
|
1309
|
+
returns(
|
|
1310
|
+
T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::OrSymbol)
|
|
1311
|
+
)
|
|
1312
|
+
}
|
|
1313
|
+
attr_reader :ttl
|
|
1314
|
+
|
|
1315
|
+
sig {
|
|
1316
|
+
params(ttl: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::OrSymbol)
|
|
1317
|
+
.void
|
|
1318
|
+
}
|
|
1319
|
+
attr_writer :ttl
|
|
1320
|
+
|
|
1321
|
+
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
1322
|
+
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
1323
|
+
# explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
1324
|
+
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
1325
|
+
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
1326
|
+
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
1327
|
+
# `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
1328
|
+
# [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
1329
|
+
# for current details.
|
|
1330
|
+
sig do
|
|
1331
|
+
params(
|
|
1196
1332
|
|
|
1197
|
-
|
|
1198
|
-
# written by the request. Defaults to `30m`, which is currently the only supported
|
|
1199
|
-
# value. The backend may retain cache entries for longer.
|
|
1200
|
-
sig { returns(T.nilable(OpenAI::Responses::ResponsesClientEvent::PromptCacheOptions::Ttl::OrSymbol)) }
|
|
1201
|
-
attr_reader :ttl
|
|
1333
|
+
mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::OrSymbol,
|
|
1202
1334
|
|
|
1203
|
-
|
|
1204
|
-
|
|
1335
|
+
ttl: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::OrSymbol
|
|
1336
|
+
)
|
|
1337
|
+
.returns(T.attached_class)
|
|
1338
|
+
end
|
|
1339
|
+
def self.new(
|
|
1205
1340
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
# [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
1214
|
-
# for current details.
|
|
1215
|
-
sig do
|
|
1216
|
-
params(
|
|
1341
|
+
# Controls whether OpenAI automatically creates an implicit cache breakpoint.
|
|
1342
|
+
# Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
|
|
1343
|
+
# and writes up to the latest three explicit breakpoints in the request. With
|
|
1344
|
+
# `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
|
|
1345
|
+
# latest four explicit breakpoints. If there are no explicit breakpoints, the
|
|
1346
|
+
# request does not use prompt caching.
|
|
1347
|
+
mode: nil,
|
|
1217
1348
|
|
|
1218
|
-
|
|
1349
|
+
# The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
1350
|
+
# written by the request. Defaults to `30m`, which is currently the only supported
|
|
1351
|
+
# value. The backend may retain cache entries for longer.
|
|
1219
1352
|
|
|
1220
|
-
ttl:
|
|
1353
|
+
ttl: nil
|
|
1221
1354
|
)
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1355
|
+
end
|
|
1356
|
+
|
|
1357
|
+
sig do
|
|
1358
|
+
override.returns(
|
|
1359
|
+
{
|
|
1360
|
+
mode: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::OrSymbol,
|
|
1361
|
+
ttl: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::OrSymbol
|
|
1362
|
+
}
|
|
1363
|
+
)
|
|
1364
|
+
end
|
|
1365
|
+
def to_hash
|
|
1366
|
+
end
|
|
1225
1367
|
|
|
1226
1368
|
# Controls whether OpenAI automatically creates an implicit cache breakpoint.
|
|
1227
1369
|
# Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
|
|
@@ -1229,182 +1371,170 @@ module OpenAI
|
|
|
1229
1371
|
# `explicit`, OpenAI does not create an implicit breakpoint and writes up to the
|
|
1230
1372
|
# latest four explicit breakpoints. If there are no explicit breakpoints, the
|
|
1231
1373
|
# request does not use prompt caching.
|
|
1232
|
-
|
|
1374
|
+
module Mode
|
|
1375
|
+
extend OpenAI::Internal::Type::Enum
|
|
1376
|
+
|
|
1377
|
+
TaggedSymbol = T.type_alias {
|
|
1378
|
+
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode)
|
|
1379
|
+
}
|
|
1380
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1381
|
+
|
|
1382
|
+
IMPLICIT = T.let(
|
|
1383
|
+
:implicit,
|
|
1384
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::TaggedSymbol
|
|
1385
|
+
)
|
|
1386
|
+
EXPLICIT = T.let(
|
|
1387
|
+
:explicit,
|
|
1388
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::TaggedSymbol
|
|
1389
|
+
)
|
|
1390
|
+
|
|
1391
|
+
sig {
|
|
1392
|
+
override.returns(
|
|
1393
|
+
T::Array[
|
|
1394
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Mode::TaggedSymbol
|
|
1395
|
+
]
|
|
1396
|
+
)
|
|
1397
|
+
}
|
|
1398
|
+
def self.values
|
|
1399
|
+
end
|
|
1400
|
+
end
|
|
1233
1401
|
|
|
1234
1402
|
# The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
1235
1403
|
# written by the request. Defaults to `30m`, which is currently the only supported
|
|
1236
1404
|
# value. The backend may retain cache entries for longer.
|
|
1405
|
+
module Ttl
|
|
1406
|
+
extend OpenAI::Internal::Type::Enum
|
|
1237
1407
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1408
|
+
TaggedSymbol = T.type_alias {
|
|
1409
|
+
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl)
|
|
1410
|
+
}
|
|
1411
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1241
1412
|
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1413
|
+
TTL_30M = T.let(
|
|
1414
|
+
:"30m",
|
|
1415
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::TaggedSymbol
|
|
1416
|
+
)
|
|
1417
|
+
|
|
1418
|
+
sig {
|
|
1419
|
+
override.returns(
|
|
1420
|
+
T::Array[
|
|
1421
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl::TaggedSymbol
|
|
1422
|
+
]
|
|
1423
|
+
)
|
|
1247
1424
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1425
|
+
def self.values
|
|
1426
|
+
end
|
|
1427
|
+
end
|
|
1251
1428
|
end
|
|
1252
1429
|
|
|
1253
|
-
#
|
|
1254
|
-
#
|
|
1255
|
-
#
|
|
1256
|
-
#
|
|
1257
|
-
#
|
|
1258
|
-
#
|
|
1259
|
-
|
|
1430
|
+
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
1431
|
+
#
|
|
1432
|
+
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
1433
|
+
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
1434
|
+
# of 24 hours.
|
|
1435
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
1436
|
+
# This field expresses a maximum retention policy, while
|
|
1437
|
+
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
1438
|
+
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
1439
|
+
# models, only `24h` is supported.
|
|
1440
|
+
#
|
|
1441
|
+
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
1442
|
+
# your organization's data retention policy:
|
|
1443
|
+
#
|
|
1444
|
+
# - Organizations without ZDR enabled default to `24h`.
|
|
1445
|
+
# - Organizations with ZDR enabled default to `in_memory` when
|
|
1446
|
+
# `prompt_cache_retention` is not specified.
|
|
1447
|
+
module PromptCacheRetention
|
|
1260
1448
|
extend OpenAI::Internal::Type::Enum
|
|
1261
1449
|
|
|
1262
1450
|
TaggedSymbol = T.type_alias {
|
|
1263
|
-
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::
|
|
1451
|
+
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention)
|
|
1264
1452
|
}
|
|
1265
1453
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1266
1454
|
|
|
1267
|
-
|
|
1268
|
-
|
|
1455
|
+
IN_MEMORY = T.let(
|
|
1456
|
+
:in_memory,
|
|
1457
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention::TaggedSymbol
|
|
1458
|
+
)
|
|
1459
|
+
PROMPT_CACHE_RETENTION_24H = T.let(
|
|
1460
|
+
:"24h",
|
|
1461
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention::TaggedSymbol
|
|
1462
|
+
)
|
|
1269
1463
|
|
|
1270
1464
|
sig {
|
|
1271
1465
|
override.returns(
|
|
1272
|
-
T::Array[OpenAI::Responses::ResponsesClientEvent::
|
|
1466
|
+
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheRetention::TaggedSymbol]
|
|
1273
1467
|
)
|
|
1274
1468
|
}
|
|
1275
1469
|
def self.values
|
|
1276
1470
|
end
|
|
1277
1471
|
end
|
|
1278
1472
|
|
|
1279
|
-
#
|
|
1280
|
-
#
|
|
1281
|
-
#
|
|
1282
|
-
|
|
1473
|
+
# Specifies the processing type used for serving the request.
|
|
1474
|
+
#
|
|
1475
|
+
# - If set to 'auto', then the request will be processed with the service tier
|
|
1476
|
+
# configured in the Project settings. Unless otherwise configured, the Project
|
|
1477
|
+
# will use 'default'.
|
|
1478
|
+
# - If set to 'default', then the request will be processed with the standard
|
|
1479
|
+
# pricing and performance for the selected model.
|
|
1480
|
+
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
|
|
1481
|
+
# then the request will be processed with the Flex Processing service tier.
|
|
1482
|
+
# - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
|
|
1483
|
+
# include the `service_tier=fast` or `service_tier=priority` parameter for
|
|
1484
|
+
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
1485
|
+
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
1486
|
+
# request.
|
|
1487
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
1488
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
1489
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
1490
|
+
# `service_tier=ultrafast`.
|
|
1491
|
+
# - When not set, the default behavior is 'auto'.
|
|
1492
|
+
#
|
|
1493
|
+
# When the `service_tier` parameter is set, the response body will include the
|
|
1494
|
+
# `service_tier` value based on the processing mode actually used to serve the
|
|
1495
|
+
# request. This response value may be different from the value set in the
|
|
1496
|
+
# parameter.
|
|
1497
|
+
module ServiceTier
|
|
1283
1498
|
extend OpenAI::Internal::Type::Enum
|
|
1284
1499
|
|
|
1285
1500
|
TaggedSymbol = T.type_alias {
|
|
1286
|
-
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::
|
|
1501
|
+
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier)
|
|
1287
1502
|
}
|
|
1288
1503
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1289
1504
|
|
|
1290
|
-
|
|
1505
|
+
AUTO = T.let(:auto, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol)
|
|
1506
|
+
DEFAULT = T.let(
|
|
1507
|
+
:default,
|
|
1508
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol
|
|
1509
|
+
)
|
|
1510
|
+
FLEX = T.let(:flex, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol)
|
|
1511
|
+
SCALE = T.let(:scale, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol)
|
|
1512
|
+
PRIORITY = T.let(
|
|
1513
|
+
:priority,
|
|
1514
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol
|
|
1515
|
+
)
|
|
1516
|
+
FAST = T.let(:fast, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol)
|
|
1517
|
+
ULTRAFAST = T.let(
|
|
1518
|
+
:ultrafast,
|
|
1519
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol
|
|
1520
|
+
)
|
|
1291
1521
|
|
|
1292
1522
|
sig {
|
|
1293
|
-
override.returns(
|
|
1523
|
+
override.returns(
|
|
1524
|
+
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ServiceTier::TaggedSymbol]
|
|
1525
|
+
)
|
|
1294
1526
|
}
|
|
1295
1527
|
def self.values
|
|
1296
1528
|
end
|
|
1297
1529
|
end
|
|
1298
|
-
end
|
|
1299
|
-
|
|
1300
|
-
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
1301
|
-
#
|
|
1302
|
-
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
1303
|
-
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
1304
|
-
# of 24 hours.
|
|
1305
|
-
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
1306
|
-
# This field expresses a maximum retention policy, while
|
|
1307
|
-
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
1308
|
-
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
1309
|
-
# models, only `24h` is supported.
|
|
1310
|
-
#
|
|
1311
|
-
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
1312
|
-
# your organization's data retention policy:
|
|
1313
|
-
#
|
|
1314
|
-
# - Organizations without ZDR enabled default to `24h`.
|
|
1315
|
-
# - Organizations with ZDR enabled default to `in_memory` when
|
|
1316
|
-
# `prompt_cache_retention` is not specified.
|
|
1317
|
-
module PromptCacheRetention
|
|
1318
|
-
extend OpenAI::Internal::Type::Enum
|
|
1319
|
-
|
|
1320
|
-
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention) }
|
|
1321
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1322
|
-
|
|
1323
|
-
IN_MEMORY = T.let(:in_memory, OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::TaggedSymbol)
|
|
1324
|
-
PROMPT_CACHE_RETENTION_24H = T.let(
|
|
1325
|
-
:"24h",
|
|
1326
|
-
OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::TaggedSymbol
|
|
1327
|
-
)
|
|
1328
|
-
|
|
1329
|
-
sig {
|
|
1330
|
-
override.returns(T::Array[OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::TaggedSymbol])
|
|
1331
|
-
}
|
|
1332
|
-
def self.values
|
|
1333
|
-
end
|
|
1334
|
-
end
|
|
1335
|
-
|
|
1336
|
-
# Specifies the processing type used for serving the request.
|
|
1337
|
-
#
|
|
1338
|
-
# - If set to 'auto', then the request will be processed with the service tier
|
|
1339
|
-
# configured in the Project settings. Unless otherwise configured, the Project
|
|
1340
|
-
# will use 'default'.
|
|
1341
|
-
# - If set to 'default', then the request will be processed with the standard
|
|
1342
|
-
# pricing and performance for the selected model.
|
|
1343
|
-
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
|
|
1344
|
-
# then the request will be processed with the Flex Processing service tier.
|
|
1345
|
-
# - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
|
|
1346
|
-
# include the `service_tier=fast` or `service_tier=priority` parameter for
|
|
1347
|
-
# Responses or Chat Completions. The response will show `service_tier=priority`
|
|
1348
|
-
# regardless of if you specify `service_tier=fast` or `priority` in your
|
|
1349
|
-
# request.
|
|
1350
|
-
# - If set to 'ultrafast', then the request will be processed with the
|
|
1351
|
-
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
1352
|
-
# available for `gpt-5.6-sol`; a response served through it will show
|
|
1353
|
-
# `service_tier=ultrafast`.
|
|
1354
|
-
# - When not set, the default behavior is 'auto'.
|
|
1355
|
-
#
|
|
1356
|
-
# When the `service_tier` parameter is set, the response body will include the
|
|
1357
|
-
# `service_tier` value based on the processing mode actually used to serve the
|
|
1358
|
-
# request. This response value may be different from the value set in the
|
|
1359
|
-
# parameter.
|
|
1360
|
-
module ServiceTier
|
|
1361
|
-
extend OpenAI::Internal::Type::Enum
|
|
1362
|
-
|
|
1363
|
-
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::ServiceTier) }
|
|
1364
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1365
|
-
|
|
1366
|
-
AUTO = T.let(:auto, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1367
|
-
DEFAULT = T.let(:default, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1368
|
-
FLEX = T.let(:flex, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1369
|
-
SCALE = T.let(:scale, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1370
|
-
PRIORITY = T.let(:priority, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1371
|
-
FAST = T.let(:fast, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1372
|
-
ULTRAFAST = T.let(:ultrafast, OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol)
|
|
1373
|
-
|
|
1374
|
-
sig { override.returns(T::Array[OpenAI::Responses::ResponsesClientEvent::ServiceTier::TaggedSymbol]) }
|
|
1375
|
-
def self.values
|
|
1376
|
-
end
|
|
1377
|
-
end
|
|
1378
1530
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
# When true, stream obfuscation will be enabled. Stream obfuscation adds random
|
|
1388
|
-
# characters to an `obfuscation` field on streaming delta events to normalize
|
|
1389
|
-
# payload sizes as a mitigation to certain side-channel attacks. These obfuscation
|
|
1390
|
-
# fields are included by default, but add a small amount of overhead to the data
|
|
1391
|
-
# stream. You can set `include_obfuscation` to false to optimize for bandwidth if
|
|
1392
|
-
# you trust the network links between your application and the OpenAI API.
|
|
1393
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
1394
|
-
attr_reader :include_obfuscation
|
|
1395
|
-
|
|
1396
|
-
sig { params(include_obfuscation: T::Boolean).void }
|
|
1397
|
-
attr_writer :include_obfuscation
|
|
1398
|
-
|
|
1399
|
-
# Options for streaming responses. Only set this when you set `stream: true`.
|
|
1400
|
-
sig do
|
|
1401
|
-
params(
|
|
1402
|
-
|
|
1403
|
-
include_obfuscation: T::Boolean
|
|
1404
|
-
)
|
|
1405
|
-
.returns(T.attached_class)
|
|
1406
|
-
end
|
|
1407
|
-
def self.new(
|
|
1531
|
+
class StreamOptions < OpenAI::Internal::Type::BaseModel
|
|
1532
|
+
OrHash = T.type_alias do
|
|
1533
|
+
T.any(
|
|
1534
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::StreamOptions,
|
|
1535
|
+
OpenAI::Internal::AnyHash
|
|
1536
|
+
)
|
|
1537
|
+
end
|
|
1408
1538
|
|
|
1409
1539
|
# When true, stream obfuscation will be enabled. Stream obfuscation adds random
|
|
1410
1540
|
# characters to an `obfuscation` field on streaming delta events to normalize
|
|
@@ -1412,71 +1542,36 @@ module OpenAI
|
|
|
1412
1542
|
# fields are included by default, but add a small amount of overhead to the data
|
|
1413
1543
|
# stream. You can set `include_obfuscation` to false to optimize for bandwidth if
|
|
1414
1544
|
# you trust the network links between your application and the OpenAI API.
|
|
1545
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1546
|
+
attr_reader :include_obfuscation
|
|
1415
1547
|
|
|
1416
|
-
include_obfuscation:
|
|
1417
|
-
|
|
1418
|
-
end
|
|
1419
|
-
|
|
1420
|
-
sig do
|
|
1421
|
-
override.returns(
|
|
1422
|
-
{include_obfuscation: T::Boolean}
|
|
1423
|
-
)
|
|
1424
|
-
end
|
|
1425
|
-
def to_hash
|
|
1426
|
-
end
|
|
1427
|
-
|
|
1428
|
-
end
|
|
1429
|
-
|
|
1430
|
-
# How the model should select which tool (or tools) to use when generating a
|
|
1431
|
-
# response. See the `tools` parameter to see how to specify which tools the model
|
|
1432
|
-
# can call.
|
|
1433
|
-
module ToolChoice
|
|
1434
|
-
extend OpenAI::Internal::Type::Union
|
|
1435
|
-
|
|
1436
|
-
Variants = T.type_alias {
|
|
1437
|
-
T.any(
|
|
1438
|
-
OpenAI::Responses::ToolChoiceOptions::TaggedSymbol,
|
|
1439
|
-
OpenAI::Responses::ToolChoiceAllowed,
|
|
1440
|
-
OpenAI::Responses::ToolChoiceTypes,
|
|
1441
|
-
OpenAI::Responses::ToolChoiceFunction,
|
|
1442
|
-
OpenAI::Responses::ToolChoiceMcp,
|
|
1443
|
-
OpenAI::Responses::ToolChoiceCustom,
|
|
1444
|
-
OpenAI::Responses::ResponsesClientEvent::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
1445
|
-
OpenAI::Responses::ToolChoiceApplyPatch,
|
|
1446
|
-
OpenAI::Responses::ToolChoiceShell
|
|
1447
|
-
)
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
class SpecificProgrammaticToolCallingParam < OpenAI::Internal::Type::BaseModel
|
|
1451
|
-
OrHash = T.type_alias do
|
|
1452
|
-
T.any(
|
|
1453
|
-
OpenAI::Responses::ResponsesClientEvent::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
1454
|
-
OpenAI::Internal::AnyHash
|
|
1455
|
-
)
|
|
1456
|
-
end
|
|
1457
|
-
|
|
1458
|
-
# The tool to call. Always `programmatic_tool_calling`.
|
|
1459
|
-
sig { returns(Symbol) }
|
|
1460
|
-
attr_accessor :type
|
|
1548
|
+
sig { params(include_obfuscation: T::Boolean).void }
|
|
1549
|
+
attr_writer :include_obfuscation
|
|
1461
1550
|
|
|
1551
|
+
# Options for streaming responses. Only set this when you set `stream: true`.
|
|
1462
1552
|
sig do
|
|
1463
1553
|
params(
|
|
1464
1554
|
|
|
1465
|
-
|
|
1555
|
+
include_obfuscation: T::Boolean
|
|
1466
1556
|
)
|
|
1467
1557
|
.returns(T.attached_class)
|
|
1468
1558
|
end
|
|
1469
1559
|
def self.new(
|
|
1470
1560
|
|
|
1471
|
-
#
|
|
1561
|
+
# When true, stream obfuscation will be enabled. Stream obfuscation adds random
|
|
1562
|
+
# characters to an `obfuscation` field on streaming delta events to normalize
|
|
1563
|
+
# payload sizes as a mitigation to certain side-channel attacks. These obfuscation
|
|
1564
|
+
# fields are included by default, but add a small amount of overhead to the data
|
|
1565
|
+
# stream. You can set `include_obfuscation` to false to optimize for bandwidth if
|
|
1566
|
+
# you trust the network links between your application and the OpenAI API.
|
|
1472
1567
|
|
|
1473
|
-
|
|
1568
|
+
include_obfuscation: nil
|
|
1474
1569
|
)
|
|
1475
1570
|
end
|
|
1476
1571
|
|
|
1477
1572
|
sig do
|
|
1478
1573
|
override.returns(
|
|
1479
|
-
{
|
|
1574
|
+
{include_obfuscation: T::Boolean}
|
|
1480
1575
|
)
|
|
1481
1576
|
end
|
|
1482
1577
|
def to_hash
|
|
@@ -1484,33 +1579,106 @@ module OpenAI
|
|
|
1484
1579
|
|
|
1485
1580
|
end
|
|
1486
1581
|
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1582
|
+
# How the model should select which tool (or tools) to use when generating a
|
|
1583
|
+
# response. See the `tools` parameter to see how to specify which tools the model
|
|
1584
|
+
# can call.
|
|
1585
|
+
module ToolChoice
|
|
1586
|
+
extend OpenAI::Internal::Type::Union
|
|
1490
1587
|
|
|
1491
|
-
|
|
1588
|
+
Variants = T.type_alias {
|
|
1589
|
+
T.any(
|
|
1590
|
+
OpenAI::Responses::ToolChoiceOptions::TaggedSymbol,
|
|
1591
|
+
OpenAI::Responses::ToolChoiceAllowed,
|
|
1592
|
+
OpenAI::Responses::ToolChoiceTypes,
|
|
1593
|
+
OpenAI::Responses::ToolChoiceFunction,
|
|
1594
|
+
OpenAI::Responses::ToolChoiceMcp,
|
|
1595
|
+
OpenAI::Responses::ToolChoiceCustom,
|
|
1596
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
1597
|
+
OpenAI::Responses::ToolChoiceApplyPatch,
|
|
1598
|
+
OpenAI::Responses::ToolChoiceShell
|
|
1599
|
+
)
|
|
1600
|
+
}
|
|
1492
1601
|
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
module Truncation
|
|
1501
|
-
extend OpenAI::Internal::Type::Enum
|
|
1602
|
+
class SpecificProgrammaticToolCallingParam < OpenAI::Internal::Type::BaseModel
|
|
1603
|
+
OrHash = T.type_alias do
|
|
1604
|
+
T.any(
|
|
1605
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::SpecificProgrammaticToolCallingParam,
|
|
1606
|
+
OpenAI::Internal::AnyHash
|
|
1607
|
+
)
|
|
1608
|
+
end
|
|
1502
1609
|
|
|
1503
|
-
|
|
1504
|
-
|
|
1610
|
+
# The tool to call. Always `programmatic_tool_calling`.
|
|
1611
|
+
sig { returns(Symbol) }
|
|
1612
|
+
attr_accessor :type
|
|
1505
1613
|
|
|
1506
|
-
|
|
1507
|
-
|
|
1614
|
+
sig do
|
|
1615
|
+
params(
|
|
1508
1616
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1617
|
+
type: Symbol
|
|
1618
|
+
)
|
|
1619
|
+
.returns(T.attached_class)
|
|
1620
|
+
end
|
|
1621
|
+
def self.new(
|
|
1622
|
+
|
|
1623
|
+
# The tool to call. Always `programmatic_tool_calling`.
|
|
1624
|
+
|
|
1625
|
+
type: :programmatic_tool_calling
|
|
1626
|
+
)
|
|
1627
|
+
end
|
|
1628
|
+
|
|
1629
|
+
sig do
|
|
1630
|
+
override.returns(
|
|
1631
|
+
{type: Symbol}
|
|
1632
|
+
)
|
|
1633
|
+
end
|
|
1634
|
+
def to_hash
|
|
1635
|
+
end
|
|
1636
|
+
|
|
1637
|
+
end
|
|
1638
|
+
|
|
1639
|
+
sig {
|
|
1640
|
+
override.returns(T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ToolChoice::Variants])
|
|
1641
|
+
}
|
|
1642
|
+
def self.variants
|
|
1643
|
+
end
|
|
1644
|
+
|
|
1645
|
+
end
|
|
1646
|
+
|
|
1647
|
+
# The truncation strategy to use for the model response.
|
|
1648
|
+
#
|
|
1649
|
+
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
1650
|
+
# the model will truncate the response to fit the context window by dropping
|
|
1651
|
+
# items from the beginning of the conversation.
|
|
1652
|
+
# - `disabled` (default): If the input size will exceed the context window size
|
|
1653
|
+
# for a model, the request will fail with a 400 error.
|
|
1654
|
+
module Truncation
|
|
1655
|
+
extend OpenAI::Internal::Type::Enum
|
|
1656
|
+
|
|
1657
|
+
TaggedSymbol = T.type_alias {
|
|
1658
|
+
T.all(Symbol, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation)
|
|
1659
|
+
}
|
|
1660
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1661
|
+
|
|
1662
|
+
AUTO = T.let(:auto, OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation::TaggedSymbol)
|
|
1663
|
+
DISABLED = T.let(
|
|
1664
|
+
:disabled,
|
|
1665
|
+
OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation::TaggedSymbol
|
|
1666
|
+
)
|
|
1667
|
+
|
|
1668
|
+
sig {
|
|
1669
|
+
override.returns(
|
|
1670
|
+
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Truncation::TaggedSymbol]
|
|
1671
|
+
)
|
|
1672
|
+
}
|
|
1673
|
+
def self.values
|
|
1674
|
+
end
|
|
1511
1675
|
end
|
|
1512
1676
|
end
|
|
1513
1677
|
|
|
1678
|
+
sig { override.returns(T::Array[OpenAI::Responses::ResponsesClientEvent::Variants]) }
|
|
1679
|
+
def self.variants
|
|
1680
|
+
end
|
|
1681
|
+
|
|
1514
1682
|
end
|
|
1515
1683
|
|
|
1516
1684
|
end
|