openai 0.67.0 → 0.69.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 +31 -0
- data/README.md +7 -7
- data/lib/openai/internal/type/enum.rb +6 -6
- data/lib/openai/internal/util.rb +14 -2
- data/lib/openai/models/beta/assistant_create_params.rb +7 -14
- data/lib/openai/models/beta/assistant_update_params.rb +7 -14
- data/lib/openai/models/beta/beta_apply_patch_tool.rb +44 -0
- data/lib/openai/models/beta/beta_compacted_response.rb +58 -0
- data/lib/openai/models/beta/beta_computer_action.rb +398 -0
- data/lib/openai/models/beta/beta_computer_action_list.rb +13 -0
- data/lib/openai/models/beta/beta_computer_tool.rb +23 -0
- data/lib/openai/models/beta/beta_computer_use_preview_tool.rb +63 -0
- data/lib/openai/models/beta/beta_container_auto.rb +96 -0
- data/lib/openai/models/beta/beta_container_network_policy_allowlist.rb +37 -0
- data/lib/openai/models/beta/beta_container_network_policy_disabled.rb +20 -0
- data/lib/openai/models/beta/beta_container_network_policy_domain_secret.rb +36 -0
- data/lib/openai/models/beta/beta_container_reference.rb +28 -0
- data/lib/openai/models/beta/beta_custom_tool.rb +148 -0
- data/lib/openai/models/beta/beta_easy_input_message.rb +120 -0
- data/lib/openai/models/beta/beta_file_search_tool.rb +424 -0
- data/lib/openai/models/beta/beta_function_shell_tool.rb +67 -0
- data/lib/openai/models/beta/beta_function_tool.rb +97 -0
- data/lib/openai/models/beta/beta_inline_skill.rb +44 -0
- data/lib/openai/models/beta/beta_inline_skill_source.rb +38 -0
- data/lib/openai/models/beta/beta_local_environment.rb +28 -0
- data/lib/openai/models/beta/beta_local_skill.rb +36 -0
- data/lib/openai/models/beta/beta_namespace_tool.rb +146 -0
- data/lib/openai/models/beta/beta_response.rb +1425 -0
- data/lib/openai/models/beta/beta_response_apply_patch_tool_call.rb +258 -0
- data/lib/openai/models/beta/beta_response_apply_patch_tool_call_output.rb +156 -0
- data/lib/openai/models/beta/beta_response_audio_delta_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_audio_done_event.rb +55 -0
- data/lib/openai/models/beta/beta_response_audio_transcript_delta_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_audio_transcript_done_event.rb +55 -0
- data/lib/openai/models/beta/beta_response_code_interpreter_call_code_delta_event.rb +81 -0
- data/lib/openai/models/beta/beta_response_code_interpreter_call_code_done_event.rb +76 -0
- data/lib/openai/models/beta/beta_response_code_interpreter_call_completed_event.rb +73 -0
- data/lib/openai/models/beta/beta_response_code_interpreter_call_in_progress_event.rb +77 -0
- data/lib/openai/models/beta/beta_response_code_interpreter_call_interpreting_event.rb +77 -0
- data/lib/openai/models/beta/beta_response_code_interpreter_tool_call.rb +168 -0
- data/lib/openai/models/beta/beta_response_compaction_item.rb +69 -0
- data/lib/openai/models/beta/beta_response_compaction_item_param.rb +61 -0
- data/lib/openai/models/beta/beta_response_completed_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call.rb +156 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +141 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_screenshot.rb +43 -0
- data/lib/openai/models/beta/beta_response_container_reference.rb +29 -0
- data/lib/openai/models/beta/beta_response_content.rb +56 -0
- data/lib/openai/models/beta/beta_response_content_part_added_event.rb +129 -0
- data/lib/openai/models/beta/beta_response_content_part_done_event.rb +129 -0
- data/lib/openai/models/beta/beta_response_conversation_param.rb +22 -0
- data/lib/openai/models/beta/beta_response_created_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call.rb +142 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call_input_delta_event.rb +76 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call_input_done_event.rb +76 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call_item.rb +55 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call_output.rb +171 -0
- data/lib/openai/models/beta/beta_response_custom_tool_call_output_item.rb +55 -0
- data/lib/openai/models/beta/beta_response_error.rb +63 -0
- data/lib/openai/models/beta/beta_response_error_event.rb +79 -0
- data/lib/openai/models/beta/beta_response_failed_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_file_search_call_completed_event.rb +72 -0
- data/lib/openai/models/beta/beta_response_file_search_call_in_progress_event.rb +72 -0
- data/lib/openai/models/beta/beta_response_file_search_call_searching_event.rb +72 -0
- data/lib/openai/models/beta/beta_response_file_search_tool_call.rb +168 -0
- data/lib/openai/models/beta/beta_response_format_text_config.rb +72 -0
- data/lib/openai/models/beta/beta_response_format_text_json_schema_config.rb +66 -0
- data/lib/openai/models/beta/beta_response_function_call_arguments_delta_event.rb +80 -0
- data/lib/openai/models/beta/beta_response_function_call_arguments_done_event.rb +83 -0
- data/lib/openai/models/beta/beta_response_function_call_output_item.rb +28 -0
- data/lib/openai/models/beta/beta_response_function_call_output_item_list.rb +14 -0
- data/lib/openai/models/beta/beta_response_function_shell_call_output_content.rb +90 -0
- data/lib/openai/models/beta/beta_response_function_shell_tool_call.rb +216 -0
- data/lib/openai/models/beta/beta_response_function_shell_tool_call_output.rb +265 -0
- data/lib/openai/models/beta/beta_response_function_tool_call.rb +168 -0
- data/lib/openai/models/beta/beta_response_function_tool_call_item.rb +57 -0
- data/lib/openai/models/beta/beta_response_function_tool_call_output_item.rb +201 -0
- data/lib/openai/models/beta/beta_response_function_web_search.rb +238 -0
- data/lib/openai/models/beta/beta_response_image_gen_call_completed_event.rb +69 -0
- data/lib/openai/models/beta/beta_response_image_gen_call_generating_event.rb +69 -0
- data/lib/openai/models/beta/beta_response_image_gen_call_in_progress_event.rb +68 -0
- data/lib/openai/models/beta/beta_response_image_gen_call_partial_image_event.rb +89 -0
- data/lib/openai/models/beta/beta_response_in_progress_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_includable.rb +45 -0
- data/lib/openai/models/beta/beta_response_incomplete_event.rb +63 -0
- data/lib/openai/models/beta/beta_response_inject_created_event.rb +51 -0
- data/lib/openai/models/beta/beta_response_inject_event.rb +40 -0
- data/lib/openai/models/beta/beta_response_inject_failed_event.rb +103 -0
- data/lib/openai/models/beta/beta_response_input.rb +13 -0
- data/lib/openai/models/beta/beta_response_input_audio.rb +70 -0
- data/lib/openai/models/beta/beta_response_input_content.rb +28 -0
- data/lib/openai/models/beta/beta_response_input_file.rb +113 -0
- data/lib/openai/models/beta/beta_response_input_file_content.rb +115 -0
- data/lib/openai/models/beta/beta_response_input_image.rb +94 -0
- data/lib/openai/models/beta/beta_response_input_image_content.rb +96 -0
- data/lib/openai/models/beta/beta_response_input_item.rb +2819 -0
- data/lib/openai/models/beta/beta_response_input_message_content_list.rb +14 -0
- data/lib/openai/models/beta/beta_response_input_message_item.rb +108 -0
- data/lib/openai/models/beta/beta_response_input_text.rb +59 -0
- data/lib/openai/models/beta/beta_response_input_text_content.rb +61 -0
- data/lib/openai/models/beta/beta_response_item.rb +1438 -0
- data/lib/openai/models/beta/beta_response_local_environment.rb +22 -0
- data/lib/openai/models/beta/beta_response_mcp_call_arguments_delta_event.rb +81 -0
- data/lib/openai/models/beta/beta_response_mcp_call_arguments_done_event.rb +79 -0
- data/lib/openai/models/beta/beta_response_mcp_call_completed_event.rb +68 -0
- data/lib/openai/models/beta/beta_response_mcp_call_failed_event.rb +68 -0
- data/lib/openai/models/beta/beta_response_mcp_call_in_progress_event.rb +68 -0
- data/lib/openai/models/beta/beta_response_mcp_list_tools_completed_event.rb +68 -0
- data/lib/openai/models/beta/beta_response_mcp_list_tools_failed_event.rb +68 -0
- data/lib/openai/models/beta/beta_response_mcp_list_tools_in_progress_event.rb +69 -0
- data/lib/openai/models/beta/beta_response_output_audio.rb +41 -0
- data/lib/openai/models/beta/beta_response_output_item.rb +1444 -0
- data/lib/openai/models/beta/beta_response_output_item_added_event.rb +71 -0
- data/lib/openai/models/beta/beta_response_output_item_done_event.rb +71 -0
- data/lib/openai/models/beta/beta_response_output_message.rb +139 -0
- data/lib/openai/models/beta/beta_response_output_refusal.rb +30 -0
- data/lib/openai/models/beta/beta_response_output_text.rb +292 -0
- data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +92 -0
- data/lib/openai/models/beta/beta_response_prompt.rb +65 -0
- data/lib/openai/models/beta/beta_response_queued_event.rb +60 -0
- data/lib/openai/models/beta/beta_response_reasoning_item.rb +151 -0
- data/lib/openai/models/beta/beta_response_reasoning_summary_part_added_event.rb +110 -0
- data/lib/openai/models/beta/beta_response_reasoning_summary_part_done_event.rb +132 -0
- data/lib/openai/models/beta/beta_response_reasoning_summary_text_delta_event.rb +88 -0
- data/lib/openai/models/beta/beta_response_reasoning_summary_text_done_event.rb +88 -0
- data/lib/openai/models/beta/beta_response_reasoning_text_delta_event.rb +87 -0
- data/lib/openai/models/beta/beta_response_reasoning_text_done_event.rb +87 -0
- data/lib/openai/models/beta/beta_response_refusal_delta_event.rb +87 -0
- data/lib/openai/models/beta/beta_response_refusal_done_event.rb +87 -0
- data/lib/openai/models/beta/beta_response_status.rb +25 -0
- data/lib/openai/models/beta/beta_response_stream_event.rb +203 -0
- data/lib/openai/models/beta/beta_response_text_config.rb +67 -0
- data/lib/openai/models/beta/beta_response_text_delta_event.rb +150 -0
- data/lib/openai/models/beta/beta_response_text_done_event.rb +150 -0
- data/lib/openai/models/beta/beta_response_tool_search_call.rb +117 -0
- data/lib/openai/models/beta/beta_response_tool_search_output_item.rb +117 -0
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +109 -0
- data/lib/openai/models/beta/beta_response_usage.rb +95 -0
- data/lib/openai/models/beta/beta_response_web_search_call_completed_event.rb +72 -0
- data/lib/openai/models/beta/beta_response_web_search_call_in_progress_event.rb +72 -0
- data/lib/openai/models/beta/beta_response_web_search_call_searching_event.rb +72 -0
- data/lib/openai/models/beta/beta_responses_client_event.rb +1432 -0
- data/lib/openai/models/beta/beta_responses_server_event.rb +212 -0
- data/lib/openai/models/beta/beta_skill_reference.rb +36 -0
- data/lib/openai/models/beta/beta_tool.rb +910 -0
- data/lib/openai/models/beta/beta_tool_choice_allowed.rb +75 -0
- data/lib/openai/models/beta/beta_tool_choice_apply_patch.rb +22 -0
- data/lib/openai/models/beta/beta_tool_choice_custom.rb +30 -0
- data/lib/openai/models/beta/beta_tool_choice_function.rb +30 -0
- data/lib/openai/models/beta/beta_tool_choice_mcp.rb +42 -0
- data/lib/openai/models/beta/beta_tool_choice_options.rb +28 -0
- data/lib/openai/models/beta/beta_tool_choice_shell.rb +22 -0
- data/lib/openai/models/beta/beta_tool_choice_types.rb +67 -0
- data/lib/openai/models/beta/beta_tool_search_tool.rb +59 -0
- data/lib/openai/models/beta/beta_web_search_preview_tool.rb +143 -0
- data/lib/openai/models/beta/beta_web_search_tool.rb +162 -0
- data/lib/openai/models/beta/response_cancel_params.rb +37 -0
- data/lib/openai/models/beta/response_compact_params.rb +549 -0
- data/lib/openai/models/beta/response_create_params.rb +1343 -0
- data/lib/openai/models/beta/response_delete_params.rb +37 -0
- data/lib/openai/models/beta/response_retrieve_params.rb +74 -0
- data/lib/openai/models/beta/responses/beta_response_item_list.rb +54 -0
- data/lib/openai/models/beta/responses/input_item_list_params.rb +96 -0
- data/lib/openai/models/beta/responses/input_token_count_params.rb +542 -0
- data/lib/openai/models/beta/responses/input_token_count_response.rb +26 -0
- data/lib/openai/models/beta/threads/run_create_params.rb +7 -14
- data/lib/openai/models/chat/chat_completion_content_part.rb +31 -1
- data/lib/openai/models/chat/chat_completion_content_part_image.rb +31 -1
- data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +31 -1
- data/lib/openai/models/chat/chat_completion_content_part_text.rb +31 -1
- data/lib/openai/models/chat/completion_create_params.rb +200 -19
- data/lib/openai/models/chat_model.rb +3 -0
- data/lib/openai/models/completion_usage.rb +9 -1
- data/lib/openai/models/conversations/computer_screenshot_content.rb +28 -1
- data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
- data/lib/openai/models/conversations/conversation_item.rb +106 -3
- 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/evals/create_eval_completions_run_data_source.rb +7 -14
- data/lib/openai/models/evals/run_cancel_response.rb +16 -30
- data/lib/openai/models/evals/run_create_params.rb +16 -30
- data/lib/openai/models/evals/run_create_response.rb +16 -30
- data/lib/openai/models/evals/run_list_response.rb +16 -30
- data/lib/openai/models/evals/run_retrieve_response.rb +16 -30
- data/lib/openai/models/graders/score_model_grader.rb +7 -14
- data/lib/openai/models/realtime/realtime_response_create_mcp_tool.rb +39 -8
- data/lib/openai/models/realtime/realtime_session_create_request.rb +6 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +45 -8
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +39 -8
- data/lib/openai/models/reasoning.rb +47 -15
- data/lib/openai/models/reasoning_effort.rb +7 -13
- data/lib/openai/models/responses/apply_patch_tool.rb +23 -1
- data/lib/openai/models/responses/compacted_response.rb +2 -2
- data/lib/openai/models/responses/custom_tool.rb +21 -1
- data/lib/openai/models/responses/function_shell_tool.rb +23 -1
- data/lib/openai/models/responses/function_tool.rb +32 -3
- data/lib/openai/models/responses/input_token_count_params.rb +21 -8
- data/lib/openai/models/responses/namespace_tool.rb +41 -2
- data/lib/openai/models/responses/response.rb +98 -14
- data/lib/openai/models/responses/response_apply_patch_tool_call.rb +56 -1
- data/lib/openai/models/responses/response_apply_patch_tool_call_output.rb +56 -1
- data/lib/openai/models/responses/response_compact_params.rb +107 -4
- data/lib/openai/models/responses/response_create_params.rb +214 -13
- data/lib/openai/models/responses/response_custom_tool_call.rb +56 -1
- data/lib/openai/models/responses/response_custom_tool_call_output.rb +58 -1
- data/lib/openai/models/responses/response_error.rb +1 -0
- data/lib/openai/models/responses/response_function_shell_tool_call.rb +56 -1
- data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +56 -1
- data/lib/openai/models/responses/response_function_tool_call.rb +56 -1
- data/lib/openai/models/responses/response_function_tool_call_output_item.rb +58 -1
- data/lib/openai/models/responses/response_input_file.rb +39 -8
- data/lib/openai/models/responses/response_input_file_content.rb +41 -8
- data/lib/openai/models/responses/response_input_image.rb +27 -1
- data/lib/openai/models/responses/response_input_image_content.rb +29 -1
- data/lib/openai/models/responses/response_input_item.rb +396 -8
- data/lib/openai/models/responses/response_input_text.rb +30 -1
- data/lib/openai/models/responses/response_input_text_content.rb +32 -1
- data/lib/openai/models/responses/response_item.rb +106 -3
- data/lib/openai/models/responses/response_item_list.rb +2 -2
- data/lib/openai/models/responses/response_output_item.rb +106 -3
- data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/response_reasoning_summary_part_done_event.rb +23 -1
- data/lib/openai/models/responses/response_tool_search_output_item.rb +2 -2
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +2 -2
- data/lib/openai/models/responses/response_usage.rb +9 -1
- data/lib/openai/models/responses/responses_client_event.rb +215 -13
- data/lib/openai/models/responses/tool.rb +74 -10
- data/lib/openai/models/video_create_params.rb +1 -0
- data/lib/openai/models/video_edit_params.rb +2 -2
- data/lib/openai/models/webhooks/safety_identifier_blocked_webhook_event.rb +118 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -1
- data/lib/openai/resources/beta/assistants.rb +2 -2
- data/lib/openai/resources/beta/responses/input_items.rb +58 -0
- data/lib/openai/resources/beta/responses/input_tokens.rb +73 -0
- data/lib/openai/resources/beta/responses.rb +440 -0
- data/lib/openai/resources/beta/threads/runs.rb +2 -2
- data/lib/openai/resources/beta.rb +4 -0
- data/lib/openai/resources/chat/completions.rb +10 -6
- 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 +3 -3
- data/lib/openai/resources/responses.rb +22 -12
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +163 -0
- data/rbi/openai/models/beta/assistant_create_params.rbi +12 -26
- data/rbi/openai/models/beta/assistant_update_params.rbi +12 -26
- data/rbi/openai/models/beta/beta_apply_patch_tool.rbi +99 -0
- data/rbi/openai/models/beta/beta_compacted_response.rbi +120 -0
- data/rbi/openai/models/beta/beta_computer_action.rbi +593 -0
- data/rbi/openai/models/beta/beta_computer_action_list.rbi +18 -0
- data/rbi/openai/models/beta/beta_computer_tool.rbi +33 -0
- data/rbi/openai/models/beta/beta_computer_use_preview_tool.rbi +126 -0
- data/rbi/openai/models/beta/beta_container_auto.rbi +231 -0
- data/rbi/openai/models/beta/beta_container_network_policy_allowlist.rbi +81 -0
- data/rbi/openai/models/beta/beta_container_network_policy_disabled.rbi +35 -0
- data/rbi/openai/models/beta/beta_container_network_policy_domain_secret.rbi +53 -0
- data/rbi/openai/models/beta/beta_container_reference.rbi +42 -0
- data/rbi/openai/models/beta/beta_custom_tool.rbi +302 -0
- data/rbi/openai/models/beta/beta_easy_input_message.rbi +211 -0
- data/rbi/openai/models/beta/beta_file_search_tool.rbi +863 -0
- data/rbi/openai/models/beta/beta_function_shell_tool.rbi +155 -0
- data/rbi/openai/models/beta/beta_function_tool.rbi +154 -0
- data/rbi/openai/models/beta/beta_inline_skill.rbi +68 -0
- data/rbi/openai/models/beta/beta_inline_skill_source.rbi +53 -0
- data/rbi/openai/models/beta/beta_local_environment.rbi +51 -0
- data/rbi/openai/models/beta/beta_local_skill.rbi +49 -0
- data/rbi/openai/models/beta/beta_namespace_tool.rbi +252 -0
- data/rbi/openai/models/beta/beta_response.rbi +2495 -0
- data/rbi/openai/models/beta/beta_response_apply_patch_tool_call.rbi +431 -0
- data/rbi/openai/models/beta/beta_response_apply_patch_tool_call_output.rbi +277 -0
- data/rbi/openai/models/beta/beta_response_audio_delta_event.rbi +110 -0
- data/rbi/openai/models/beta/beta_response_audio_done_event.rbi +100 -0
- data/rbi/openai/models/beta/beta_response_audio_transcript_delta_event.rbi +118 -0
- data/rbi/openai/models/beta/beta_response_audio_transcript_done_event.rbi +108 -0
- data/rbi/openai/models/beta/beta_response_code_interpreter_call_code_delta_event.rbi +136 -0
- data/rbi/openai/models/beta/beta_response_code_interpreter_call_code_done_event.rbi +134 -0
- data/rbi/openai/models/beta/beta_response_code_interpreter_call_completed_event.rbi +128 -0
- data/rbi/openai/models/beta/beta_response_code_interpreter_call_in_progress_event.rbi +128 -0
- data/rbi/openai/models/beta/beta_response_code_interpreter_call_interpreting_event.rbi +128 -0
- data/rbi/openai/models/beta/beta_response_code_interpreter_tool_call.rbi +315 -0
- data/rbi/openai/models/beta/beta_response_compaction_item.rbi +116 -0
- data/rbi/openai/models/beta/beta_response_compaction_item_param.rbi +114 -0
- data/rbi/openai/models/beta/beta_response_completed_event.rbi +111 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call.rbi +404 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +296 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_screenshot.rbi +62 -0
- data/rbi/openai/models/beta/beta_response_container_reference.rbi +41 -0
- data/rbi/openai/models/beta/beta_response_content.rbi +66 -0
- data/rbi/openai/models/beta/beta_response_content_part_added_event.rbi +205 -0
- data/rbi/openai/models/beta/beta_response_content_part_done_event.rbi +203 -0
- data/rbi/openai/models/beta/beta_response_conversation_param.rbi +35 -0
- data/rbi/openai/models/beta/beta_response_created_event.rbi +109 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call.rbi +242 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call_input_delta_event.rbi +134 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call_input_done_event.rbi +134 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call_item.rbi +113 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call_output.rbi +303 -0
- data/rbi/openai/models/beta/beta_response_custom_tool_call_output_item.rbi +114 -0
- data/rbi/openai/models/beta/beta_response_error.rbi +165 -0
- data/rbi/openai/models/beta/beta_response_error_event.rbi +120 -0
- data/rbi/openai/models/beta/beta_response_failed_event.rbi +107 -0
- data/rbi/openai/models/beta/beta_response_file_search_call_completed_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_file_search_call_in_progress_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_file_search_call_searching_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_file_search_tool_call.rbi +328 -0
- data/rbi/openai/models/beta/beta_response_format_text_config.rbi +97 -0
- data/rbi/openai/models/beta/beta_response_format_text_json_schema_config.rbi +97 -0
- data/rbi/openai/models/beta/beta_response_function_call_arguments_delta_event.rbi +134 -0
- data/rbi/openai/models/beta/beta_response_function_call_arguments_done_event.rbi +140 -0
- data/rbi/openai/models/beta/beta_response_function_call_output_item.rbi +32 -0
- data/rbi/openai/models/beta/beta_response_function_call_output_item_list.rbi +21 -0
- data/rbi/openai/models/beta/beta_response_function_shell_call_output_content.rbi +160 -0
- data/rbi/openai/models/beta/beta_response_function_shell_tool_call.rbi +389 -0
- data/rbi/openai/models/beta/beta_response_function_shell_tool_call_output.rbi +470 -0
- data/rbi/openai/models/beta/beta_response_function_tool_call.rbi +310 -0
- data/rbi/openai/models/beta/beta_response_function_tool_call_item.rbi +115 -0
- data/rbi/openai/models/beta/beta_response_function_tool_call_output_item.rbi +364 -0
- data/rbi/openai/models/beta/beta_response_function_web_search.rbi +416 -0
- data/rbi/openai/models/beta/beta_response_image_gen_call_completed_event.rbi +127 -0
- data/rbi/openai/models/beta/beta_response_image_gen_call_generating_event.rbi +127 -0
- data/rbi/openai/models/beta/beta_response_image_gen_call_in_progress_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_image_gen_call_partial_image_event.rbi +144 -0
- data/rbi/openai/models/beta/beta_response_in_progress_event.rbi +113 -0
- data/rbi/openai/models/beta/beta_response_includable.rbi +86 -0
- data/rbi/openai/models/beta/beta_response_incomplete_event.rbi +113 -0
- data/rbi/openai/models/beta/beta_response_inject_created_event.rbi +75 -0
- data/rbi/openai/models/beta/beta_response_inject_event.rbi +183 -0
- data/rbi/openai/models/beta/beta_response_inject_failed_event.rbi +304 -0
- data/rbi/openai/models/beta/beta_response_input.rbi +18 -0
- data/rbi/openai/models/beta/beta_response_input_audio.rbi +144 -0
- data/rbi/openai/models/beta/beta_response_input_content.rbi +31 -0
- data/rbi/openai/models/beta/beta_response_input_file.rbi +210 -0
- data/rbi/openai/models/beta/beta_response_input_file_content.rbi +211 -0
- data/rbi/openai/models/beta/beta_response_input_image.rbi +173 -0
- data/rbi/openai/models/beta/beta_response_input_image_content.rbi +191 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +5505 -0
- data/rbi/openai/models/beta/beta_response_input_message_content_list.rbi +21 -0
- data/rbi/openai/models/beta/beta_response_input_message_item.rbi +235 -0
- data/rbi/openai/models/beta/beta_response_input_text.rbi +109 -0
- data/rbi/openai/models/beta/beta_response_input_text_content.rbi +115 -0
- data/rbi/openai/models/beta/beta_response_item.rbi +2592 -0
- data/rbi/openai/models/beta/beta_response_local_environment.rbi +35 -0
- data/rbi/openai/models/beta/beta_response_mcp_call_arguments_delta_event.rbi +137 -0
- data/rbi/openai/models/beta/beta_response_mcp_call_arguments_done_event.rbi +134 -0
- data/rbi/openai/models/beta/beta_response_mcp_call_completed_event.rbi +123 -0
- data/rbi/openai/models/beta/beta_response_mcp_call_failed_event.rbi +121 -0
- data/rbi/openai/models/beta/beta_response_mcp_call_in_progress_event.rbi +124 -0
- data/rbi/openai/models/beta/beta_response_mcp_list_tools_completed_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_mcp_list_tools_failed_event.rbi +124 -0
- data/rbi/openai/models/beta/beta_response_mcp_list_tools_in_progress_event.rbi +127 -0
- data/rbi/openai/models/beta/beta_response_output_audio.rbi +53 -0
- data/rbi/openai/models/beta/beta_response_output_item.rbi +2627 -0
- data/rbi/openai/models/beta/beta_response_output_item_added_event.rbi +154 -0
- data/rbi/openai/models/beta/beta_response_output_item_done_event.rbi +154 -0
- data/rbi/openai/models/beta/beta_response_output_message.rbi +267 -0
- data/rbi/openai/models/beta/beta_response_output_refusal.rbi +41 -0
- data/rbi/openai/models/beta/beta_response_output_text.rbi +479 -0
- data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +150 -0
- data/rbi/openai/models/beta/beta_response_prompt.rbi +122 -0
- data/rbi/openai/models/beta/beta_response_queued_event.rbi +107 -0
- data/rbi/openai/models/beta/beta_response_reasoning_item.rbi +274 -0
- data/rbi/openai/models/beta/beta_response_reasoning_summary_part_added_event.rbi +188 -0
- data/rbi/openai/models/beta/beta_response_reasoning_summary_part_done_event.rbi +243 -0
- data/rbi/openai/models/beta/beta_response_reasoning_summary_text_delta_event.rbi +142 -0
- data/rbi/openai/models/beta/beta_response_reasoning_summary_text_done_event.rbi +142 -0
- data/rbi/openai/models/beta/beta_response_reasoning_text_delta_event.rbi +140 -0
- data/rbi/openai/models/beta/beta_response_reasoning_text_done_event.rbi +140 -0
- data/rbi/openai/models/beta/beta_response_refusal_delta_event.rbi +135 -0
- data/rbi/openai/models/beta/beta_response_refusal_done_event.rbi +135 -0
- data/rbi/openai/models/beta/beta_response_status.rbi +38 -0
- data/rbi/openai/models/beta/beta_response_stream_event.rbi +81 -0
- data/rbi/openai/models/beta/beta_response_text_config.rbi +166 -0
- data/rbi/openai/models/beta/beta_response_text_delta_event.rbi +263 -0
- data/rbi/openai/models/beta/beta_response_text_done_event.rbi +261 -0
- data/rbi/openai/models/beta/beta_response_tool_search_call.rbi +218 -0
- data/rbi/openai/models/beta/beta_response_tool_search_output_item.rbi +248 -0
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +307 -0
- data/rbi/openai/models/beta/beta_response_usage.rbi +163 -0
- data/rbi/openai/models/beta/beta_response_web_search_call_completed_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_web_search_call_in_progress_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_response_web_search_call_searching_event.rbi +126 -0
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +2831 -0
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +83 -0
- data/rbi/openai/models/beta/beta_skill_reference.rbi +52 -0
- data/rbi/openai/models/beta/beta_tool.rbi +1835 -0
- data/rbi/openai/models/beta/beta_tool_choice_allowed.rbi +126 -0
- data/rbi/openai/models/beta/beta_tool_choice_apply_patch.rbi +35 -0
- data/rbi/openai/models/beta/beta_tool_choice_custom.rbi +38 -0
- data/rbi/openai/models/beta/beta_tool_choice_function.rbi +41 -0
- data/rbi/openai/models/beta/beta_tool_choice_mcp.rbi +55 -0
- data/rbi/openai/models/beta/beta_tool_choice_options.rbi +38 -0
- data/rbi/openai/models/beta/beta_tool_choice_shell.rbi +32 -0
- data/rbi/openai/models/beta/beta_tool_choice_types.rbi +134 -0
- data/rbi/openai/models/beta/beta_tool_search_tool.rbi +109 -0
- data/rbi/openai/models/beta/beta_web_search_preview_tool.rbi +311 -0
- data/rbi/openai/models/beta/beta_web_search_tool.rbi +329 -0
- data/rbi/openai/models/beta/response_cancel_params.rbi +83 -0
- data/rbi/openai/models/beta/response_compact_params.rbi +1033 -0
- data/rbi/openai/models/beta/response_create_params.rbi +2739 -0
- data/rbi/openai/models/beta/response_delete_params.rbi +83 -0
- data/rbi/openai/models/beta/response_retrieve_params.rbi +145 -0
- data/rbi/openai/models/beta/responses/beta_response_item_list.rbi +113 -0
- data/rbi/openai/models/beta/responses/input_item_list_params.rbi +223 -0
- data/rbi/openai/models/beta/responses/input_token_count_params.rbi +1248 -0
- data/rbi/openai/models/beta/responses/input_token_count_response.rbi +37 -0
- data/rbi/openai/models/beta/threads/run_create_params.rbi +12 -26
- data/rbi/openai/models/chat/chat_completion_content_part.rbi +57 -1
- data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +57 -1
- data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +57 -1
- data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +70 -2
- data/rbi/openai/models/chat/completion_create_params.rbi +513 -32
- data/rbi/openai/models/chat_model.rbi +3 -0
- data/rbi/openai/models/completion_usage.rbi +21 -4
- data/rbi/openai/models/conversations/computer_screenshot_content.rbi +57 -1
- data/rbi/openai/models/conversations/conversation_create_params.rbi +9 -3
- data/rbi/openai/models/conversations/conversation_item.rbi +178 -0
- data/rbi/openai/models/conversations/conversation_item_list.rbi +2 -0
- data/rbi/openai/models/conversations/item_create_params.rbi +9 -3
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +12 -26
- data/rbi/openai/models/evals/run_cancel_response.rbi +26 -52
- data/rbi/openai/models/evals/run_create_params.rbi +28 -52
- data/rbi/openai/models/evals/run_create_response.rbi +26 -52
- data/rbi/openai/models/evals/run_list_response.rbi +26 -52
- data/rbi/openai/models/evals/run_retrieve_response.rbi +26 -52
- data/rbi/openai/models/graders/score_model_grader.rbi +12 -26
- data/rbi/openai/models/realtime/realtime_response_create_mcp_tool.rbi +84 -11
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +10 -0
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +94 -11
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +84 -11
- data/rbi/openai/models/reasoning.rbi +51 -26
- data/rbi/openai/models/reasoning_effort.rbi +7 -13
- data/rbi/openai/models/responses/apply_patch_tool.rbi +69 -2
- data/rbi/openai/models/responses/compacted_response.rbi +2 -0
- data/rbi/openai/models/responses/custom_tool.rbi +53 -0
- data/rbi/openai/models/responses/function_shell_tool.rbi +57 -0
- data/rbi/openai/models/responses/function_tool.rbi +68 -3
- data/rbi/openai/models/responses/input_token_count_params.rbi +32 -0
- data/rbi/openai/models/responses/namespace_tool.rbi +76 -0
- data/rbi/openai/models/responses/response.rbi +192 -3
- data/rbi/openai/models/responses/response_apply_patch_tool_call.rbi +98 -0
- data/rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi +98 -0
- data/rbi/openai/models/responses/response_compact_params.rbi +231 -0
- data/rbi/openai/models/responses/response_create_params.rbi +537 -6
- data/rbi/openai/models/responses/response_custom_tool_call.rbi +104 -0
- data/rbi/openai/models/responses/response_custom_tool_call_output.rbi +111 -1
- data/rbi/openai/models/responses/response_error.rbi +5 -0
- data/rbi/openai/models/responses/response_function_shell_tool_call.rbi +98 -0
- data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +98 -0
- data/rbi/openai/models/responses/response_function_tool_call.rbi +104 -0
- data/rbi/openai/models/responses/response_function_tool_call_output_item.rbi +104 -0
- data/rbi/openai/models/responses/response_input_file.rbi +77 -10
- data/rbi/openai/models/responses/response_input_file_content.rbi +83 -10
- data/rbi/openai/models/responses/response_input_image.rbi +57 -1
- data/rbi/openai/models/responses/response_input_image_content.rbi +63 -1
- data/rbi/openai/models/responses/response_input_item.rbi +748 -8
- data/rbi/openai/models/responses/response_input_text.rbi +70 -2
- data/rbi/openai/models/responses/response_input_text_content.rbi +76 -2
- data/rbi/openai/models/responses/response_item.rbi +178 -0
- data/rbi/openai/models/responses/response_item_list.rbi +2 -0
- data/rbi/openai/models/responses/response_output_item.rbi +178 -0
- data/rbi/openai/models/responses/response_output_item_added_event.rbi +2 -0
- data/rbi/openai/models/responses/response_output_item_done_event.rbi +2 -0
- data/rbi/openai/models/responses/response_reasoning_summary_part_done_event.rbi +58 -1
- data/rbi/openai/models/responses/response_tool_search_output_item.rbi +1 -0
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +3 -0
- data/rbi/openai/models/responses/response_usage.rbi +16 -2
- data/rbi/openai/models/responses/responses_client_event.rbi +537 -6
- data/rbi/openai/models/responses/tool.rbi +166 -12
- data/rbi/openai/models/video_edit_params.rbi +1 -1
- data/rbi/openai/models/webhooks/safety_identifier_blocked_webhook_event.rbi +209 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +2 -1
- data/rbi/openai/resources/beta/assistants.rbi +12 -26
- data/rbi/openai/resources/beta/responses/input_items.rbi +58 -0
- data/rbi/openai/resources/beta/responses/input_tokens.rbi +154 -0
- data/rbi/openai/resources/beta/responses.rbi +903 -0
- data/rbi/openai/resources/beta/threads/runs.rbi +12 -26
- data/rbi/openai/resources/beta.rbi +3 -0
- data/rbi/openai/resources/chat/completions.rbi +48 -28
- data/rbi/openai/resources/conversations/items.rbi +3 -1
- data/rbi/openai/resources/conversations.rbi +3 -1
- data/rbi/openai/resources/responses/input_tokens.rbi +2 -0
- data/rbi/openai/resources/responses.rbi +54 -2
- data/rbi/openai/resources/webhooks.rbi +2 -1
- data/sig/openai/client.rbs +1 -1
- data/sig/openai/internal/transport/base_client.rbs +2 -2
- data/sig/openai/models/beta/beta_apply_patch_tool.rbs +40 -0
- data/sig/openai/models/beta/beta_compacted_response.rbs +44 -0
- data/sig/openai/models/beta/beta_computer_action.rbs +259 -0
- data/sig/openai/models/beta/beta_computer_action_list.rbs +12 -0
- data/sig/openai/models/beta/beta_computer_tool.rbs +17 -0
- data/sig/openai/models/beta/beta_computer_use_preview_tool.rbs +53 -0
- data/sig/openai/models/beta/beta_container_auto.rbs +86 -0
- data/sig/openai/models/beta/beta_container_network_policy_allowlist.rbs +38 -0
- data/sig/openai/models/beta/beta_container_network_policy_disabled.rbs +17 -0
- data/sig/openai/models/beta/beta_container_network_policy_domain_secret.rbs +22 -0
- data/sig/openai/models/beta/beta_container_reference.rbs +23 -0
- data/sig/openai/models/beta/beta_custom_tool.rbs +126 -0
- data/sig/openai/models/beta/beta_easy_input_message.rbs +87 -0
- data/sig/openai/models/beta/beta_file_search_tool.rbs +298 -0
- data/sig/openai/models/beta/beta_function_shell_tool.rbs +56 -0
- data/sig/openai/models/beta/beta_function_tool.rbs +72 -0
- data/sig/openai/models/beta/beta_inline_skill.rbs +39 -0
- data/sig/openai/models/beta/beta_inline_skill_source.rbs +30 -0
- data/sig/openai/models/beta/beta_local_environment.rbs +30 -0
- data/sig/openai/models/beta/beta_local_skill.rbs +26 -0
- data/sig/openai/models/beta/beta_namespace_tool.rbs +114 -0
- data/sig/openai/models/beta/beta_response.rbs +860 -0
- data/sig/openai/models/beta/beta_response_apply_patch_tool_call.rbs +177 -0
- data/sig/openai/models/beta/beta_response_apply_patch_tool_call_output.rbs +118 -0
- data/sig/openai/models/beta/beta_response_audio_delta_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_audio_done_event.rbs +44 -0
- data/sig/openai/models/beta/beta_response_audio_transcript_delta_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_audio_transcript_done_event.rbs +44 -0
- data/sig/openai/models/beta/beta_response_code_interpreter_call_code_delta_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_code_interpreter_call_code_done_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_code_interpreter_call_completed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_code_interpreter_call_in_progress_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_code_interpreter_call_interpreting_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_code_interpreter_tool_call.rbs +113 -0
- data/sig/openai/models/beta/beta_response_compaction_item.rbs +60 -0
- data/sig/openai/models/beta/beta_response_compaction_item_param.rbs +49 -0
- data/sig/openai/models/beta/beta_response_completed_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call.rbs +118 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +107 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_screenshot.rbs +34 -0
- data/sig/openai/models/beta/beta_response_container_reference.rbs +23 -0
- data/sig/openai/models/beta/beta_response_content.rbs +33 -0
- data/sig/openai/models/beta/beta_response_content_part_added_event.rbs +87 -0
- data/sig/openai/models/beta/beta_response_content_part_done_event.rbs +87 -0
- data/sig/openai/models/beta/beta_response_conversation_param.rbs +17 -0
- data/sig/openai/models/beta/beta_response_created_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call.rbs +105 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call_input_delta_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call_input_done_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call_item.rbs +54 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call_output.rbs +116 -0
- data/sig/openai/models/beta/beta_response_custom_tool_call_output_item.rbs +54 -0
- data/sig/openai/models/beta/beta_response_error.rbs +73 -0
- data/sig/openai/models/beta/beta_response_error_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_failed_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_file_search_call_completed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_file_search_call_in_progress_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_file_search_call_searching_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_file_search_tool_call.rbs +127 -0
- data/sig/openai/models/beta/beta_response_format_text_config.rbs +38 -0
- data/sig/openai/models/beta/beta_response_format_text_json_schema_config.rbs +46 -0
- data/sig/openai/models/beta/beta_response_function_call_arguments_delta_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_function_call_arguments_done_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_function_call_output_item.rbs +18 -0
- data/sig/openai/models/beta/beta_response_function_call_output_item_list.rbs +12 -0
- data/sig/openai/models/beta/beta_response_function_shell_call_output_content.rbs +66 -0
- data/sig/openai/models/beta/beta_response_function_shell_tool_call.rbs +161 -0
- data/sig/openai/models/beta/beta_response_function_shell_tool_call_output.rbs +190 -0
- data/sig/openai/models/beta/beta_response_function_tool_call.rbs +126 -0
- data/sig/openai/models/beta/beta_response_function_tool_call_item.rbs +54 -0
- data/sig/openai/models/beta/beta_response_function_tool_call_output_item.rbs +138 -0
- data/sig/openai/models/beta/beta_response_function_web_search.rbs +165 -0
- data/sig/openai/models/beta/beta_response_image_gen_call_completed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_image_gen_call_generating_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_image_gen_call_in_progress_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_image_gen_call_partial_image_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_in_progress_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_includable.rbs +32 -0
- data/sig/openai/models/beta/beta_response_incomplete_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_inject_created_event.rbs +41 -0
- data/sig/openai/models/beta/beta_response_inject_event.rbs +34 -0
- data/sig/openai/models/beta/beta_response_inject_failed_event.rbs +84 -0
- data/sig/openai/models/beta/beta_response_input.rbs +12 -0
- data/sig/openai/models/beta/beta_response_input_audio.rbs +62 -0
- data/sig/openai/models/beta/beta_response_input_content.rbs +18 -0
- data/sig/openai/models/beta/beta_response_input_file.rbs +90 -0
- data/sig/openai/models/beta/beta_response_input_file_content.rbs +80 -0
- data/sig/openai/models/beta/beta_response_input_image.rbs +71 -0
- data/sig/openai/models/beta/beta_response_input_image_content.rbs +67 -0
- data/sig/openai/models/beta/beta_response_input_item.rbs +2064 -0
- data/sig/openai/models/beta/beta_response_input_message_content_list.rbs +12 -0
- data/sig/openai/models/beta/beta_response_input_message_item.rbs +87 -0
- data/sig/openai/models/beta/beta_response_input_text.rbs +48 -0
- data/sig/openai/models/beta/beta_response_input_text_content.rbs +44 -0
- data/sig/openai/models/beta/beta_response_item.rbs +1097 -0
- data/sig/openai/models/beta/beta_response_local_environment.rbs +17 -0
- data/sig/openai/models/beta/beta_response_mcp_call_arguments_delta_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_mcp_call_arguments_done_event.rbs +59 -0
- data/sig/openai/models/beta/beta_response_mcp_call_completed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_mcp_call_failed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_mcp_call_in_progress_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_mcp_list_tools_completed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_mcp_list_tools_failed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_mcp_list_tools_in_progress_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_output_audio.rbs +30 -0
- data/sig/openai/models/beta/beta_response_output_item.rbs +1096 -0
- data/sig/openai/models/beta/beta_response_output_item_added_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_output_item_done_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_output_message.rbs +97 -0
- data/sig/openai/models/beta/beta_response_output_refusal.rbs +19 -0
- data/sig/openai/models/beta/beta_response_output_text.rbs +243 -0
- data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +69 -0
- data/sig/openai/models/beta/beta_response_prompt.rbs +46 -0
- data/sig/openai/models/beta/beta_response_queued_event.rbs +49 -0
- data/sig/openai/models/beta/beta_response_reasoning_item.rbs +108 -0
- data/sig/openai/models/beta/beta_response_reasoning_summary_part_added_event.rbs +76 -0
- data/sig/openai/models/beta/beta_response_reasoning_summary_part_done_event.rbs +95 -0
- data/sig/openai/models/beta/beta_response_reasoning_summary_text_delta_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_reasoning_summary_text_done_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_reasoning_text_delta_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_reasoning_text_done_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_refusal_delta_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_refusal_done_event.rbs +64 -0
- data/sig/openai/models/beta/beta_response_status.rbs +23 -0
- data/sig/openai/models/beta/beta_response_stream_event.rbs +68 -0
- data/sig/openai/models/beta/beta_response_text_config.rbs +45 -0
- data/sig/openai/models/beta/beta_response_text_delta_event.rbs +116 -0
- data/sig/openai/models/beta/beta_response_text_done_event.rbs +116 -0
- data/sig/openai/models/beta/beta_response_tool_search_call.rbs +98 -0
- data/sig/openai/models/beta/beta_response_tool_search_output_item.rbs +98 -0
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +91 -0
- data/sig/openai/models/beta/beta_response_usage.rbs +73 -0
- data/sig/openai/models/beta/beta_response_web_search_call_completed_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_web_search_call_in_progress_event.rbs +54 -0
- data/sig/openai/models/beta/beta_response_web_search_call_searching_event.rbs +54 -0
- data/sig/openai/models/beta/beta_responses_client_event.rbs +804 -0
- data/sig/openai/models/beta/beta_responses_server_event.rbs +70 -0
- data/sig/openai/models/beta/beta_skill_reference.rbs +32 -0
- data/sig/openai/models/beta/beta_tool.rbs +634 -0
- data/sig/openai/models/beta/beta_tool_choice_allowed.rbs +45 -0
- data/sig/openai/models/beta/beta_tool_choice_apply_patch.rbs +17 -0
- data/sig/openai/models/beta/beta_tool_choice_custom.rbs +19 -0
- data/sig/openai/models/beta/beta_tool_choice_function.rbs +19 -0
- data/sig/openai/models/beta/beta_tool_choice_mcp.rbs +26 -0
- data/sig/openai/models/beta/beta_tool_choice_options.rbs +19 -0
- data/sig/openai/models/beta/beta_tool_choice_shell.rbs +17 -0
- data/sig/openai/models/beta/beta_tool_choice_types.rbs +47 -0
- data/sig/openai/models/beta/beta_tool_search_tool.rbs +54 -0
- data/sig/openai/models/beta/beta_web_search_preview_tool.rbs +118 -0
- data/sig/openai/models/beta/beta_web_search_tool.rbs +127 -0
- data/sig/openai/models/beta/response_cancel_params.rbs +47 -0
- data/sig/openai/models/beta/response_compact_params.rbs +368 -0
- data/sig/openai/models/beta/response_create_params.rbs +804 -0
- data/sig/openai/models/beta/response_delete_params.rbs +47 -0
- data/sig/openai/models/beta/response_retrieve_params.rbs +70 -0
- data/sig/openai/models/beta/responses/beta_response_item_list.rbs +44 -0
- data/sig/openai/models/beta/responses/input_item_list_params.rbs +92 -0
- data/sig/openai/models/beta/responses/input_token_count_params.rbs +325 -0
- data/sig/openai/models/beta/responses/input_token_count_response.rbs +26 -0
- data/sig/openai/models/chat/chat_completion_content_part.rbs +21 -2
- data/sig/openai/models/chat/chat_completion_content_part_image.rbs +21 -2
- data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +21 -2
- data/sig/openai/models/chat/chat_completion_content_part_text.rbs +32 -3
- data/sig/openai/models/chat/completion_create_params.rbs +153 -3
- data/sig/openai/models/chat_model.rbs +7 -1
- data/sig/openai/models/completion_usage.rbs +15 -2
- data/sig/openai/models/conversations/computer_screenshot_content.rbs +21 -2
- data/sig/openai/models/conversations/conversation_item.rbs +87 -0
- data/sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs +25 -2
- data/sig/openai/models/realtime/realtime_session_create_request.rbs +4 -0
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +29 -2
- data/sig/openai/models/realtime/realtime_tools_config_union.rbs +25 -2
- data/sig/openai/models/reasoning.rbs +20 -0
- data/sig/openai/models/reasoning_effort.rbs +3 -1
- data/sig/openai/models/responses/apply_patch_tool.rbs +26 -3
- data/sig/openai/models/responses/custom_tool.rbs +16 -0
- data/sig/openai/models/responses/function_shell_tool.rbs +16 -0
- data/sig/openai/models/responses/function_tool.rbs +23 -2
- data/sig/openai/models/responses/input_token_count_params.rbs +12 -0
- data/sig/openai/models/responses/namespace_tool.rbs +21 -0
- data/sig/openai/models/responses/response.rbs +64 -0
- data/sig/openai/models/responses/response_apply_patch_tool_call.rbs +37 -0
- data/sig/openai/models/responses/response_apply_patch_tool_call_output.rbs +37 -0
- data/sig/openai/models/responses/response_compact_params.rbs +63 -1
- data/sig/openai/models/responses/response_create_params.rbs +165 -3
- data/sig/openai/models/responses/response_custom_tool_call.rbs +37 -0
- data/sig/openai/models/responses/response_custom_tool_call_output.rbs +39 -2
- data/sig/openai/models/responses/response_error.rbs +2 -0
- data/sig/openai/models/responses/response_function_shell_tool_call.rbs +37 -0
- data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +37 -0
- data/sig/openai/models/responses/response_function_tool_call.rbs +37 -0
- data/sig/openai/models/responses/response_function_tool_call_output_item.rbs +37 -0
- data/sig/openai/models/responses/response_input_file.rbs +23 -3
- data/sig/openai/models/responses/response_input_file_content.rbs +19 -3
- data/sig/openai/models/responses/response_input_image.rbs +21 -2
- data/sig/openai/models/responses/response_input_image_content.rbs +17 -2
- data/sig/openai/models/responses/response_input_item.rbs +274 -2
- data/sig/openai/models/responses/response_input_text.rbs +32 -3
- data/sig/openai/models/responses/response_input_text_content.rbs +28 -3
- data/sig/openai/models/responses/response_item.rbs +87 -0
- data/sig/openai/models/responses/response_output_item.rbs +87 -0
- data/sig/openai/models/responses/response_reasoning_summary_part_done_event.rbs +21 -2
- data/sig/openai/models/responses/response_usage.rbs +12 -3
- data/sig/openai/models/responses/responses_client_event.rbs +165 -3
- data/sig/openai/models/responses/tool.rbs +54 -4
- data/sig/openai/models/webhooks/safety_identifier_blocked_webhook_event.rbs +99 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
- data/sig/openai/resources/beta/responses/input_items.rbs +21 -0
- data/sig/openai/resources/beta/responses/input_tokens.rbs +28 -0
- data/sig/openai/resources/beta/responses.rbs +128 -0
- data/sig/openai/resources/beta.rbs +2 -0
- data/sig/openai/resources/chat/completions.rbs +2 -0
- data/sig/openai/resources/responses.rbs +3 -0
- data/sig/openai/resources/webhooks.rbs +2 -1
- metadata +491 -2
|
@@ -0,0 +1,2495 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
BetaResponse = Beta::BetaResponse
|
|
6
|
+
|
|
7
|
+
module Beta
|
|
8
|
+
class BetaResponse < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(OpenAI::Beta::BetaResponse, OpenAI::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Unique identifier for this Response.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# Unix timestamp (in seconds) of when this Response was created.
|
|
19
|
+
sig { returns(Float) }
|
|
20
|
+
attr_accessor :created_at
|
|
21
|
+
|
|
22
|
+
# An error object returned when the model fails to generate a Response.
|
|
23
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponseError)) }
|
|
24
|
+
attr_reader :error
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
params(error: T.nilable(OpenAI::Beta::BetaResponseError::OrHash)).void
|
|
28
|
+
end
|
|
29
|
+
attr_writer :error
|
|
30
|
+
|
|
31
|
+
# Details about why the response is incomplete.
|
|
32
|
+
sig do
|
|
33
|
+
returns(T.nilable(OpenAI::Beta::BetaResponse::IncompleteDetails))
|
|
34
|
+
end
|
|
35
|
+
attr_reader :incomplete_details
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
incomplete_details:
|
|
40
|
+
T.nilable(OpenAI::Beta::BetaResponse::IncompleteDetails::OrHash)
|
|
41
|
+
).void
|
|
42
|
+
end
|
|
43
|
+
attr_writer :incomplete_details
|
|
44
|
+
|
|
45
|
+
# A system (or developer) message inserted into the model's context.
|
|
46
|
+
#
|
|
47
|
+
# When using along with `previous_response_id`, the instructions from a previous
|
|
48
|
+
# response will not be carried over to the next response. This makes it simple to
|
|
49
|
+
# swap out system (or developer) messages in new responses.
|
|
50
|
+
sig do
|
|
51
|
+
returns(T.nilable(OpenAI::Beta::BetaResponse::Instructions::Variants))
|
|
52
|
+
end
|
|
53
|
+
attr_accessor :instructions
|
|
54
|
+
|
|
55
|
+
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
56
|
+
# for storing additional information about the object in a structured format, and
|
|
57
|
+
# querying for objects via API or the dashboard.
|
|
58
|
+
#
|
|
59
|
+
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
60
|
+
# a maximum length of 512 characters.
|
|
61
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
62
|
+
attr_accessor :metadata
|
|
63
|
+
|
|
64
|
+
# Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
|
|
65
|
+
# wide range of models with different capabilities, performance characteristics,
|
|
66
|
+
# and price points. Refer to the
|
|
67
|
+
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
68
|
+
# available models.
|
|
69
|
+
sig { returns(OpenAI::Beta::BetaResponse::Model::Variants) }
|
|
70
|
+
attr_accessor :model
|
|
71
|
+
|
|
72
|
+
# The object type of this resource - always set to `response`.
|
|
73
|
+
sig { returns(Symbol) }
|
|
74
|
+
attr_accessor :object
|
|
75
|
+
|
|
76
|
+
# An array of content items generated by the model.
|
|
77
|
+
#
|
|
78
|
+
# - The length and order of items in the `output` array is dependent on the
|
|
79
|
+
# model's response.
|
|
80
|
+
# - Rather than accessing the first item in the `output` array and assuming it's
|
|
81
|
+
# an `assistant` message with the content generated by the model, you might
|
|
82
|
+
# consider using the `output_text` property where supported in SDKs.
|
|
83
|
+
sig do
|
|
84
|
+
returns(T::Array[OpenAI::Beta::BetaResponseOutputItem::Variants])
|
|
85
|
+
end
|
|
86
|
+
attr_accessor :output
|
|
87
|
+
|
|
88
|
+
# Whether to allow the model to run tool calls in parallel.
|
|
89
|
+
sig { returns(T::Boolean) }
|
|
90
|
+
attr_accessor :parallel_tool_calls
|
|
91
|
+
|
|
92
|
+
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
93
|
+
# make the output more random, while lower values like 0.2 will make it more
|
|
94
|
+
# focused and deterministic. We generally recommend altering this or `top_p` but
|
|
95
|
+
# not both.
|
|
96
|
+
sig { returns(T.nilable(Float)) }
|
|
97
|
+
attr_accessor :temperature
|
|
98
|
+
|
|
99
|
+
# How the model should select which tool (or tools) to use when generating a
|
|
100
|
+
# response. See the `tools` parameter to see how to specify which tools the model
|
|
101
|
+
# can call.
|
|
102
|
+
sig { returns(OpenAI::Beta::BetaResponse::ToolChoice::Variants) }
|
|
103
|
+
attr_accessor :tool_choice
|
|
104
|
+
|
|
105
|
+
# An array of tools the model may call while generating a response. You can
|
|
106
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
|
107
|
+
#
|
|
108
|
+
# We support the following categories of tools:
|
|
109
|
+
#
|
|
110
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
|
111
|
+
# capabilities, like
|
|
112
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
|
113
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
|
114
|
+
# Learn more about
|
|
115
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
|
116
|
+
# - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
|
|
117
|
+
# predefined connectors such as Google Drive and SharePoint. Learn more about
|
|
118
|
+
# [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
|
|
119
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
|
120
|
+
# the model to call your own code with strongly typed arguments and outputs.
|
|
121
|
+
# Learn more about
|
|
122
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
|
123
|
+
# You can also use custom tools to call your own code.
|
|
124
|
+
sig { returns(T::Array[OpenAI::Beta::BetaTool::Variants]) }
|
|
125
|
+
attr_accessor :tools
|
|
126
|
+
|
|
127
|
+
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
128
|
+
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
129
|
+
# means only the tokens comprising the top 10% probability mass are considered.
|
|
130
|
+
#
|
|
131
|
+
# We generally recommend altering this or `temperature` but not both.
|
|
132
|
+
sig { returns(T.nilable(Float)) }
|
|
133
|
+
attr_accessor :top_p
|
|
134
|
+
|
|
135
|
+
# Whether to run the model response in the background.
|
|
136
|
+
# [Learn more](https://platform.openai.com/docs/guides/background).
|
|
137
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
138
|
+
attr_accessor :background
|
|
139
|
+
|
|
140
|
+
# Unix timestamp (in seconds) of when this Response was completed. Only present
|
|
141
|
+
# when the status is `completed`.
|
|
142
|
+
sig { returns(T.nilable(Float)) }
|
|
143
|
+
attr_accessor :completed_at
|
|
144
|
+
|
|
145
|
+
# The conversation that this response belonged to. Input items and output items
|
|
146
|
+
# from this response were automatically added to this conversation.
|
|
147
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponse::Conversation)) }
|
|
148
|
+
attr_reader :conversation
|
|
149
|
+
|
|
150
|
+
sig do
|
|
151
|
+
params(
|
|
152
|
+
conversation:
|
|
153
|
+
T.nilable(OpenAI::Beta::BetaResponse::Conversation::OrHash)
|
|
154
|
+
).void
|
|
155
|
+
end
|
|
156
|
+
attr_writer :conversation
|
|
157
|
+
|
|
158
|
+
# An upper bound for the number of tokens that can be generated for a response,
|
|
159
|
+
# including visible output tokens and
|
|
160
|
+
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
|
161
|
+
sig { returns(T.nilable(Integer)) }
|
|
162
|
+
attr_accessor :max_output_tokens
|
|
163
|
+
|
|
164
|
+
# The maximum number of total calls to built-in tools that can be processed in a
|
|
165
|
+
# response. This maximum number applies across all built-in tool calls, not per
|
|
166
|
+
# individual tool. Any further attempts to call a tool by the model will be
|
|
167
|
+
# ignored.
|
|
168
|
+
sig { returns(T.nilable(Integer)) }
|
|
169
|
+
attr_accessor :max_tool_calls
|
|
170
|
+
|
|
171
|
+
# Moderation results for the response input and output, if moderated completions
|
|
172
|
+
# were requested.
|
|
173
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponse::Moderation)) }
|
|
174
|
+
attr_reader :moderation
|
|
175
|
+
|
|
176
|
+
sig do
|
|
177
|
+
params(
|
|
178
|
+
moderation:
|
|
179
|
+
T.nilable(OpenAI::Beta::BetaResponse::Moderation::OrHash)
|
|
180
|
+
).void
|
|
181
|
+
end
|
|
182
|
+
attr_writer :moderation
|
|
183
|
+
|
|
184
|
+
# The unique ID of the previous response to the model. Use this to create
|
|
185
|
+
# multi-turn conversations. Learn more about
|
|
186
|
+
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
187
|
+
# Cannot be used in conjunction with `conversation`.
|
|
188
|
+
sig { returns(T.nilable(String)) }
|
|
189
|
+
attr_accessor :previous_response_id
|
|
190
|
+
|
|
191
|
+
# Reference to a prompt template and its variables.
|
|
192
|
+
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
193
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponsePrompt)) }
|
|
194
|
+
attr_reader :prompt
|
|
195
|
+
|
|
196
|
+
sig do
|
|
197
|
+
params(
|
|
198
|
+
prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash)
|
|
199
|
+
).void
|
|
200
|
+
end
|
|
201
|
+
attr_writer :prompt
|
|
202
|
+
|
|
203
|
+
# Used by OpenAI to cache responses for similar requests to optimize your cache
|
|
204
|
+
# hit rates. Replaces the `user` field.
|
|
205
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
206
|
+
sig { returns(T.nilable(String)) }
|
|
207
|
+
attr_reader :prompt_cache_key
|
|
208
|
+
|
|
209
|
+
sig { params(prompt_cache_key: String).void }
|
|
210
|
+
attr_writer :prompt_cache_key
|
|
211
|
+
|
|
212
|
+
# The prompt-caching options that were applied to the response. Supported for
|
|
213
|
+
# `gpt-5.6` and later models.
|
|
214
|
+
sig do
|
|
215
|
+
returns(T.nilable(OpenAI::Beta::BetaResponse::PromptCacheOptions))
|
|
216
|
+
end
|
|
217
|
+
attr_reader :prompt_cache_options
|
|
218
|
+
|
|
219
|
+
sig do
|
|
220
|
+
params(
|
|
221
|
+
prompt_cache_options:
|
|
222
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::OrHash
|
|
223
|
+
).void
|
|
224
|
+
end
|
|
225
|
+
attr_writer :prompt_cache_options
|
|
226
|
+
|
|
227
|
+
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
228
|
+
#
|
|
229
|
+
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
230
|
+
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
231
|
+
# of 24 hours.
|
|
232
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
233
|
+
# This field expresses a maximum retention policy, while
|
|
234
|
+
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
235
|
+
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
236
|
+
# models, only `24h` is supported.
|
|
237
|
+
#
|
|
238
|
+
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
239
|
+
# your organization's data retention policy:
|
|
240
|
+
#
|
|
241
|
+
# - Organizations without ZDR enabled default to `24h`.
|
|
242
|
+
# - Organizations with ZDR enabled default to `in_memory` when
|
|
243
|
+
# `prompt_cache_retention` is not specified.
|
|
244
|
+
sig do
|
|
245
|
+
returns(
|
|
246
|
+
T.nilable(
|
|
247
|
+
OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol
|
|
248
|
+
)
|
|
249
|
+
)
|
|
250
|
+
end
|
|
251
|
+
attr_accessor :prompt_cache_retention
|
|
252
|
+
|
|
253
|
+
# **gpt-5 and o-series models only**
|
|
254
|
+
#
|
|
255
|
+
# Configuration options for
|
|
256
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
257
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponse::Reasoning)) }
|
|
258
|
+
attr_reader :reasoning
|
|
259
|
+
|
|
260
|
+
sig do
|
|
261
|
+
params(
|
|
262
|
+
reasoning: T.nilable(OpenAI::Beta::BetaResponse::Reasoning::OrHash)
|
|
263
|
+
).void
|
|
264
|
+
end
|
|
265
|
+
attr_writer :reasoning
|
|
266
|
+
|
|
267
|
+
# A stable identifier used to help detect users of your application that may be
|
|
268
|
+
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
269
|
+
# identifies each user, with a maximum length of 64 characters. We recommend
|
|
270
|
+
# hashing their username or email address, in order to avoid sending us any
|
|
271
|
+
# identifying information.
|
|
272
|
+
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
273
|
+
sig { returns(T.nilable(String)) }
|
|
274
|
+
attr_reader :safety_identifier
|
|
275
|
+
|
|
276
|
+
sig { params(safety_identifier: String).void }
|
|
277
|
+
attr_writer :safety_identifier
|
|
278
|
+
|
|
279
|
+
# Specifies the processing type used for serving the request.
|
|
280
|
+
#
|
|
281
|
+
# - If set to 'auto', then the request will be processed with the service tier
|
|
282
|
+
# configured in the Project settings. Unless otherwise configured, the Project
|
|
283
|
+
# will use 'default'.
|
|
284
|
+
# - If set to 'default', then the request will be processed with the standard
|
|
285
|
+
# pricing and performance for the selected model.
|
|
286
|
+
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
|
|
287
|
+
# '[priority](https://openai.com/api-priority-processing/)', then the request
|
|
288
|
+
# will be processed with the corresponding service tier.
|
|
289
|
+
# - When not set, the default behavior is 'auto'.
|
|
290
|
+
#
|
|
291
|
+
# When the `service_tier` parameter is set, the response body will include the
|
|
292
|
+
# `service_tier` value based on the processing mode actually used to serve the
|
|
293
|
+
# request. This response value may be different from the value set in the
|
|
294
|
+
# parameter.
|
|
295
|
+
sig do
|
|
296
|
+
returns(
|
|
297
|
+
T.nilable(OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol)
|
|
298
|
+
)
|
|
299
|
+
end
|
|
300
|
+
attr_accessor :service_tier
|
|
301
|
+
|
|
302
|
+
# The status of the response generation. One of `completed`, `failed`,
|
|
303
|
+
# `in_progress`, `cancelled`, `queued`, or `incomplete`.
|
|
304
|
+
sig do
|
|
305
|
+
returns(T.nilable(OpenAI::Beta::BetaResponseStatus::TaggedSymbol))
|
|
306
|
+
end
|
|
307
|
+
attr_reader :status
|
|
308
|
+
|
|
309
|
+
sig { params(status: OpenAI::Beta::BetaResponseStatus::OrSymbol).void }
|
|
310
|
+
attr_writer :status
|
|
311
|
+
|
|
312
|
+
# Configuration options for a text response from the model. Can be plain text or
|
|
313
|
+
# structured JSON data. Learn more:
|
|
314
|
+
#
|
|
315
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
316
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
317
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponseTextConfig)) }
|
|
318
|
+
attr_reader :text
|
|
319
|
+
|
|
320
|
+
sig { params(text: OpenAI::Beta::BetaResponseTextConfig::OrHash).void }
|
|
321
|
+
attr_writer :text
|
|
322
|
+
|
|
323
|
+
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
324
|
+
# to return at each token position, each with an associated log probability. In
|
|
325
|
+
# some cases, the number of returned tokens may be fewer than requested.
|
|
326
|
+
sig { returns(T.nilable(Integer)) }
|
|
327
|
+
attr_accessor :top_logprobs
|
|
328
|
+
|
|
329
|
+
# The truncation strategy to use for the model response.
|
|
330
|
+
#
|
|
331
|
+
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
332
|
+
# the model will truncate the response to fit the context window by dropping
|
|
333
|
+
# items from the beginning of the conversation.
|
|
334
|
+
# - `disabled` (default): If the input size will exceed the context window size
|
|
335
|
+
# for a model, the request will fail with a 400 error.
|
|
336
|
+
sig do
|
|
337
|
+
returns(
|
|
338
|
+
T.nilable(OpenAI::Beta::BetaResponse::Truncation::TaggedSymbol)
|
|
339
|
+
)
|
|
340
|
+
end
|
|
341
|
+
attr_accessor :truncation
|
|
342
|
+
|
|
343
|
+
# Represents token usage details including input tokens, output tokens, a
|
|
344
|
+
# breakdown of output tokens, and the total tokens used.
|
|
345
|
+
sig { returns(T.nilable(OpenAI::Beta::BetaResponseUsage)) }
|
|
346
|
+
attr_reader :usage
|
|
347
|
+
|
|
348
|
+
sig { params(usage: OpenAI::Beta::BetaResponseUsage::OrHash).void }
|
|
349
|
+
attr_writer :usage
|
|
350
|
+
|
|
351
|
+
# This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
|
|
352
|
+
# `prompt_cache_key` instead to maintain caching optimizations. A stable
|
|
353
|
+
# identifier for your end-users. Used to boost cache hit rates by better bucketing
|
|
354
|
+
# similar requests and to help OpenAI detect and prevent abuse.
|
|
355
|
+
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
356
|
+
sig { returns(T.nilable(String)) }
|
|
357
|
+
attr_reader :user
|
|
358
|
+
|
|
359
|
+
sig { params(user: String).void }
|
|
360
|
+
attr_writer :user
|
|
361
|
+
|
|
362
|
+
sig do
|
|
363
|
+
params(
|
|
364
|
+
id: String,
|
|
365
|
+
created_at: Float,
|
|
366
|
+
error: T.nilable(OpenAI::Beta::BetaResponseError::OrHash),
|
|
367
|
+
incomplete_details:
|
|
368
|
+
T.nilable(OpenAI::Beta::BetaResponse::IncompleteDetails::OrHash),
|
|
369
|
+
instructions:
|
|
370
|
+
T.nilable(OpenAI::Beta::BetaResponse::Instructions::Variants),
|
|
371
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
372
|
+
model: T.any(OpenAI::Beta::BetaResponse::Model::OrSymbol, String),
|
|
373
|
+
output:
|
|
374
|
+
T::Array[
|
|
375
|
+
T.any(
|
|
376
|
+
OpenAI::Beta::BetaResponseOutputMessage::OrHash,
|
|
377
|
+
OpenAI::Beta::BetaResponseFileSearchToolCall::OrHash,
|
|
378
|
+
OpenAI::Beta::BetaResponseFunctionToolCall::OrHash,
|
|
379
|
+
OpenAI::Beta::BetaResponseFunctionToolCallOutputItem::OrHash,
|
|
380
|
+
OpenAI::Beta::BetaResponseOutputItem::AgentMessage::OrHash,
|
|
381
|
+
OpenAI::Beta::BetaResponseOutputItem::MultiAgentCall::OrHash,
|
|
382
|
+
OpenAI::Beta::BetaResponseOutputItem::MultiAgentCallOutput::OrHash,
|
|
383
|
+
OpenAI::Beta::BetaResponseFunctionWebSearch::OrHash,
|
|
384
|
+
OpenAI::Beta::BetaResponseComputerToolCall::OrHash,
|
|
385
|
+
OpenAI::Beta::BetaResponseComputerToolCallOutputItem::OrHash,
|
|
386
|
+
OpenAI::Beta::BetaResponseReasoningItem::OrHash,
|
|
387
|
+
OpenAI::Beta::BetaResponseOutputItem::Program::OrHash,
|
|
388
|
+
OpenAI::Beta::BetaResponseOutputItem::ProgramOutput::OrHash,
|
|
389
|
+
OpenAI::Beta::BetaResponseToolSearchCall::OrHash,
|
|
390
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItem::OrHash,
|
|
391
|
+
OpenAI::Beta::BetaResponseOutputItem::AdditionalTools::OrHash,
|
|
392
|
+
OpenAI::Beta::BetaResponseCompactionItem::OrHash,
|
|
393
|
+
OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::OrHash,
|
|
394
|
+
OpenAI::Beta::BetaResponseCodeInterpreterToolCall::OrHash,
|
|
395
|
+
OpenAI::Beta::BetaResponseOutputItem::LocalShellCall::OrHash,
|
|
396
|
+
OpenAI::Beta::BetaResponseOutputItem::LocalShellCallOutput::OrHash,
|
|
397
|
+
OpenAI::Beta::BetaResponseFunctionShellToolCall::OrHash,
|
|
398
|
+
OpenAI::Beta::BetaResponseFunctionShellToolCallOutput::OrHash,
|
|
399
|
+
OpenAI::Beta::BetaResponseApplyPatchToolCall::OrHash,
|
|
400
|
+
OpenAI::Beta::BetaResponseApplyPatchToolCallOutput::OrHash,
|
|
401
|
+
OpenAI::Beta::BetaResponseOutputItem::McpCall::OrHash,
|
|
402
|
+
OpenAI::Beta::BetaResponseOutputItem::McpListTools::OrHash,
|
|
403
|
+
OpenAI::Beta::BetaResponseOutputItem::McpApprovalRequest::OrHash,
|
|
404
|
+
OpenAI::Beta::BetaResponseOutputItem::McpApprovalResponse::OrHash,
|
|
405
|
+
OpenAI::Beta::BetaResponseCustomToolCall::OrHash,
|
|
406
|
+
OpenAI::Beta::BetaResponseCustomToolCallOutputItem::OrHash
|
|
407
|
+
)
|
|
408
|
+
],
|
|
409
|
+
parallel_tool_calls: T::Boolean,
|
|
410
|
+
temperature: T.nilable(Float),
|
|
411
|
+
tool_choice:
|
|
412
|
+
T.any(
|
|
413
|
+
OpenAI::Beta::BetaToolChoiceOptions::OrSymbol,
|
|
414
|
+
OpenAI::Beta::BetaToolChoiceAllowed::OrHash,
|
|
415
|
+
OpenAI::Beta::BetaToolChoiceTypes::OrHash,
|
|
416
|
+
OpenAI::Beta::BetaToolChoiceFunction::OrHash,
|
|
417
|
+
OpenAI::Beta::BetaToolChoiceMcp::OrHash,
|
|
418
|
+
OpenAI::Beta::BetaToolChoiceCustom::OrHash,
|
|
419
|
+
OpenAI::Beta::BetaResponse::ToolChoice::BetaSpecificProgrammaticToolCallingParam::OrHash,
|
|
420
|
+
OpenAI::Beta::BetaToolChoiceApplyPatch::OrHash,
|
|
421
|
+
OpenAI::Beta::BetaToolChoiceShell::OrHash
|
|
422
|
+
),
|
|
423
|
+
tools:
|
|
424
|
+
T::Array[
|
|
425
|
+
T.any(
|
|
426
|
+
OpenAI::Beta::BetaFunctionTool::OrHash,
|
|
427
|
+
OpenAI::Beta::BetaFileSearchTool::OrHash,
|
|
428
|
+
OpenAI::Beta::BetaComputerTool::OrHash,
|
|
429
|
+
OpenAI::Beta::BetaComputerUsePreviewTool::OrHash,
|
|
430
|
+
OpenAI::Beta::BetaTool::Mcp::OrHash,
|
|
431
|
+
OpenAI::Beta::BetaTool::CodeInterpreter::OrHash,
|
|
432
|
+
OpenAI::Beta::BetaTool::ProgrammaticToolCalling::OrHash,
|
|
433
|
+
OpenAI::Beta::BetaTool::ImageGeneration::OrHash,
|
|
434
|
+
OpenAI::Beta::BetaTool::LocalShell::OrHash,
|
|
435
|
+
OpenAI::Beta::BetaFunctionShellTool::OrHash,
|
|
436
|
+
OpenAI::Beta::BetaCustomTool::OrHash,
|
|
437
|
+
OpenAI::Beta::BetaNamespaceTool::OrHash,
|
|
438
|
+
OpenAI::Beta::BetaToolSearchTool::OrHash,
|
|
439
|
+
OpenAI::Beta::BetaApplyPatchTool::OrHash,
|
|
440
|
+
OpenAI::Beta::BetaWebSearchTool::OrHash,
|
|
441
|
+
OpenAI::Beta::BetaWebSearchPreviewTool::OrHash
|
|
442
|
+
)
|
|
443
|
+
],
|
|
444
|
+
top_p: T.nilable(Float),
|
|
445
|
+
background: T.nilable(T::Boolean),
|
|
446
|
+
completed_at: T.nilable(Float),
|
|
447
|
+
conversation:
|
|
448
|
+
T.nilable(OpenAI::Beta::BetaResponse::Conversation::OrHash),
|
|
449
|
+
max_output_tokens: T.nilable(Integer),
|
|
450
|
+
max_tool_calls: T.nilable(Integer),
|
|
451
|
+
moderation:
|
|
452
|
+
T.nilable(OpenAI::Beta::BetaResponse::Moderation::OrHash),
|
|
453
|
+
previous_response_id: T.nilable(String),
|
|
454
|
+
prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
|
|
455
|
+
prompt_cache_key: String,
|
|
456
|
+
prompt_cache_options:
|
|
457
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::OrHash,
|
|
458
|
+
prompt_cache_retention:
|
|
459
|
+
T.nilable(
|
|
460
|
+
OpenAI::Beta::BetaResponse::PromptCacheRetention::OrSymbol
|
|
461
|
+
),
|
|
462
|
+
reasoning: T.nilable(OpenAI::Beta::BetaResponse::Reasoning::OrHash),
|
|
463
|
+
safety_identifier: String,
|
|
464
|
+
service_tier:
|
|
465
|
+
T.nilable(OpenAI::Beta::BetaResponse::ServiceTier::OrSymbol),
|
|
466
|
+
status: OpenAI::Beta::BetaResponseStatus::OrSymbol,
|
|
467
|
+
text: OpenAI::Beta::BetaResponseTextConfig::OrHash,
|
|
468
|
+
top_logprobs: T.nilable(Integer),
|
|
469
|
+
truncation:
|
|
470
|
+
T.nilable(OpenAI::Beta::BetaResponse::Truncation::OrSymbol),
|
|
471
|
+
usage: OpenAI::Beta::BetaResponseUsage::OrHash,
|
|
472
|
+
user: String,
|
|
473
|
+
object: Symbol
|
|
474
|
+
).returns(T.attached_class)
|
|
475
|
+
end
|
|
476
|
+
def self.new(
|
|
477
|
+
# Unique identifier for this Response.
|
|
478
|
+
id:,
|
|
479
|
+
# Unix timestamp (in seconds) of when this Response was created.
|
|
480
|
+
created_at:,
|
|
481
|
+
# An error object returned when the model fails to generate a Response.
|
|
482
|
+
error:,
|
|
483
|
+
# Details about why the response is incomplete.
|
|
484
|
+
incomplete_details:,
|
|
485
|
+
# A system (or developer) message inserted into the model's context.
|
|
486
|
+
#
|
|
487
|
+
# When using along with `previous_response_id`, the instructions from a previous
|
|
488
|
+
# response will not be carried over to the next response. This makes it simple to
|
|
489
|
+
# swap out system (or developer) messages in new responses.
|
|
490
|
+
instructions:,
|
|
491
|
+
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
492
|
+
# for storing additional information about the object in a structured format, and
|
|
493
|
+
# querying for objects via API or the dashboard.
|
|
494
|
+
#
|
|
495
|
+
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
496
|
+
# a maximum length of 512 characters.
|
|
497
|
+
metadata:,
|
|
498
|
+
# Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
|
|
499
|
+
# wide range of models with different capabilities, performance characteristics,
|
|
500
|
+
# and price points. Refer to the
|
|
501
|
+
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
502
|
+
# available models.
|
|
503
|
+
model:,
|
|
504
|
+
# An array of content items generated by the model.
|
|
505
|
+
#
|
|
506
|
+
# - The length and order of items in the `output` array is dependent on the
|
|
507
|
+
# model's response.
|
|
508
|
+
# - Rather than accessing the first item in the `output` array and assuming it's
|
|
509
|
+
# an `assistant` message with the content generated by the model, you might
|
|
510
|
+
# consider using the `output_text` property where supported in SDKs.
|
|
511
|
+
output:,
|
|
512
|
+
# Whether to allow the model to run tool calls in parallel.
|
|
513
|
+
parallel_tool_calls:,
|
|
514
|
+
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
515
|
+
# make the output more random, while lower values like 0.2 will make it more
|
|
516
|
+
# focused and deterministic. We generally recommend altering this or `top_p` but
|
|
517
|
+
# not both.
|
|
518
|
+
temperature:,
|
|
519
|
+
# How the model should select which tool (or tools) to use when generating a
|
|
520
|
+
# response. See the `tools` parameter to see how to specify which tools the model
|
|
521
|
+
# can call.
|
|
522
|
+
tool_choice:,
|
|
523
|
+
# An array of tools the model may call while generating a response. You can
|
|
524
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
|
525
|
+
#
|
|
526
|
+
# We support the following categories of tools:
|
|
527
|
+
#
|
|
528
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
|
529
|
+
# capabilities, like
|
|
530
|
+
# [web search](https://platform.openai.com/docs/guides/tools-web-search) or
|
|
531
|
+
# [file search](https://platform.openai.com/docs/guides/tools-file-search).
|
|
532
|
+
# Learn more about
|
|
533
|
+
# [built-in tools](https://platform.openai.com/docs/guides/tools).
|
|
534
|
+
# - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
|
|
535
|
+
# predefined connectors such as Google Drive and SharePoint. Learn more about
|
|
536
|
+
# [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).
|
|
537
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
|
538
|
+
# the model to call your own code with strongly typed arguments and outputs.
|
|
539
|
+
# Learn more about
|
|
540
|
+
# [function calling](https://platform.openai.com/docs/guides/function-calling).
|
|
541
|
+
# You can also use custom tools to call your own code.
|
|
542
|
+
tools:,
|
|
543
|
+
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
544
|
+
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
545
|
+
# means only the tokens comprising the top 10% probability mass are considered.
|
|
546
|
+
#
|
|
547
|
+
# We generally recommend altering this or `temperature` but not both.
|
|
548
|
+
top_p:,
|
|
549
|
+
# Whether to run the model response in the background.
|
|
550
|
+
# [Learn more](https://platform.openai.com/docs/guides/background).
|
|
551
|
+
background: nil,
|
|
552
|
+
# Unix timestamp (in seconds) of when this Response was completed. Only present
|
|
553
|
+
# when the status is `completed`.
|
|
554
|
+
completed_at: nil,
|
|
555
|
+
# The conversation that this response belonged to. Input items and output items
|
|
556
|
+
# from this response were automatically added to this conversation.
|
|
557
|
+
conversation: nil,
|
|
558
|
+
# An upper bound for the number of tokens that can be generated for a response,
|
|
559
|
+
# including visible output tokens and
|
|
560
|
+
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
|
561
|
+
max_output_tokens: nil,
|
|
562
|
+
# The maximum number of total calls to built-in tools that can be processed in a
|
|
563
|
+
# response. This maximum number applies across all built-in tool calls, not per
|
|
564
|
+
# individual tool. Any further attempts to call a tool by the model will be
|
|
565
|
+
# ignored.
|
|
566
|
+
max_tool_calls: nil,
|
|
567
|
+
# Moderation results for the response input and output, if moderated completions
|
|
568
|
+
# were requested.
|
|
569
|
+
moderation: nil,
|
|
570
|
+
# The unique ID of the previous response to the model. Use this to create
|
|
571
|
+
# multi-turn conversations. Learn more about
|
|
572
|
+
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
|
573
|
+
# Cannot be used in conjunction with `conversation`.
|
|
574
|
+
previous_response_id: nil,
|
|
575
|
+
# Reference to a prompt template and its variables.
|
|
576
|
+
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
577
|
+
prompt: nil,
|
|
578
|
+
# Used by OpenAI to cache responses for similar requests to optimize your cache
|
|
579
|
+
# hit rates. Replaces the `user` field.
|
|
580
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
581
|
+
prompt_cache_key: nil,
|
|
582
|
+
# The prompt-caching options that were applied to the response. Supported for
|
|
583
|
+
# `gpt-5.6` and later models.
|
|
584
|
+
prompt_cache_options: nil,
|
|
585
|
+
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
586
|
+
#
|
|
587
|
+
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
588
|
+
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
589
|
+
# of 24 hours.
|
|
590
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
591
|
+
# This field expresses a maximum retention policy, while
|
|
592
|
+
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
593
|
+
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
594
|
+
# models, only `24h` is supported.
|
|
595
|
+
#
|
|
596
|
+
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
597
|
+
# your organization's data retention policy:
|
|
598
|
+
#
|
|
599
|
+
# - Organizations without ZDR enabled default to `24h`.
|
|
600
|
+
# - Organizations with ZDR enabled default to `in_memory` when
|
|
601
|
+
# `prompt_cache_retention` is not specified.
|
|
602
|
+
prompt_cache_retention: nil,
|
|
603
|
+
# **gpt-5 and o-series models only**
|
|
604
|
+
#
|
|
605
|
+
# Configuration options for
|
|
606
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
607
|
+
reasoning: nil,
|
|
608
|
+
# A stable identifier used to help detect users of your application that may be
|
|
609
|
+
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
610
|
+
# identifies each user, with a maximum length of 64 characters. We recommend
|
|
611
|
+
# hashing their username or email address, in order to avoid sending us any
|
|
612
|
+
# identifying information.
|
|
613
|
+
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
614
|
+
safety_identifier: nil,
|
|
615
|
+
# Specifies the processing type used for serving the request.
|
|
616
|
+
#
|
|
617
|
+
# - If set to 'auto', then the request will be processed with the service tier
|
|
618
|
+
# configured in the Project settings. Unless otherwise configured, the Project
|
|
619
|
+
# will use 'default'.
|
|
620
|
+
# - If set to 'default', then the request will be processed with the standard
|
|
621
|
+
# pricing and performance for the selected model.
|
|
622
|
+
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
|
|
623
|
+
# '[priority](https://openai.com/api-priority-processing/)', then the request
|
|
624
|
+
# will be processed with the corresponding service tier.
|
|
625
|
+
# - When not set, the default behavior is 'auto'.
|
|
626
|
+
#
|
|
627
|
+
# When the `service_tier` parameter is set, the response body will include the
|
|
628
|
+
# `service_tier` value based on the processing mode actually used to serve the
|
|
629
|
+
# request. This response value may be different from the value set in the
|
|
630
|
+
# parameter.
|
|
631
|
+
service_tier: nil,
|
|
632
|
+
# The status of the response generation. One of `completed`, `failed`,
|
|
633
|
+
# `in_progress`, `cancelled`, `queued`, or `incomplete`.
|
|
634
|
+
status: nil,
|
|
635
|
+
# Configuration options for a text response from the model. Can be plain text or
|
|
636
|
+
# structured JSON data. Learn more:
|
|
637
|
+
#
|
|
638
|
+
# - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
|
|
639
|
+
# - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
640
|
+
text: nil,
|
|
641
|
+
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
642
|
+
# to return at each token position, each with an associated log probability. In
|
|
643
|
+
# some cases, the number of returned tokens may be fewer than requested.
|
|
644
|
+
top_logprobs: nil,
|
|
645
|
+
# The truncation strategy to use for the model response.
|
|
646
|
+
#
|
|
647
|
+
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
648
|
+
# the model will truncate the response to fit the context window by dropping
|
|
649
|
+
# items from the beginning of the conversation.
|
|
650
|
+
# - `disabled` (default): If the input size will exceed the context window size
|
|
651
|
+
# for a model, the request will fail with a 400 error.
|
|
652
|
+
truncation: nil,
|
|
653
|
+
# Represents token usage details including input tokens, output tokens, a
|
|
654
|
+
# breakdown of output tokens, and the total tokens used.
|
|
655
|
+
usage: nil,
|
|
656
|
+
# This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
|
|
657
|
+
# `prompt_cache_key` instead to maintain caching optimizations. A stable
|
|
658
|
+
# identifier for your end-users. Used to boost cache hit rates by better bucketing
|
|
659
|
+
# similar requests and to help OpenAI detect and prevent abuse.
|
|
660
|
+
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
661
|
+
user: nil,
|
|
662
|
+
# The object type of this resource - always set to `response`.
|
|
663
|
+
object: :response
|
|
664
|
+
)
|
|
665
|
+
end
|
|
666
|
+
|
|
667
|
+
sig do
|
|
668
|
+
override.returns(
|
|
669
|
+
{
|
|
670
|
+
id: String,
|
|
671
|
+
created_at: Float,
|
|
672
|
+
error: T.nilable(OpenAI::Beta::BetaResponseError),
|
|
673
|
+
incomplete_details:
|
|
674
|
+
T.nilable(OpenAI::Beta::BetaResponse::IncompleteDetails),
|
|
675
|
+
instructions:
|
|
676
|
+
T.nilable(OpenAI::Beta::BetaResponse::Instructions::Variants),
|
|
677
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
678
|
+
model: OpenAI::Beta::BetaResponse::Model::Variants,
|
|
679
|
+
object: Symbol,
|
|
680
|
+
output: T::Array[OpenAI::Beta::BetaResponseOutputItem::Variants],
|
|
681
|
+
parallel_tool_calls: T::Boolean,
|
|
682
|
+
temperature: T.nilable(Float),
|
|
683
|
+
tool_choice: OpenAI::Beta::BetaResponse::ToolChoice::Variants,
|
|
684
|
+
tools: T::Array[OpenAI::Beta::BetaTool::Variants],
|
|
685
|
+
top_p: T.nilable(Float),
|
|
686
|
+
background: T.nilable(T::Boolean),
|
|
687
|
+
completed_at: T.nilable(Float),
|
|
688
|
+
conversation: T.nilable(OpenAI::Beta::BetaResponse::Conversation),
|
|
689
|
+
max_output_tokens: T.nilable(Integer),
|
|
690
|
+
max_tool_calls: T.nilable(Integer),
|
|
691
|
+
moderation: T.nilable(OpenAI::Beta::BetaResponse::Moderation),
|
|
692
|
+
previous_response_id: T.nilable(String),
|
|
693
|
+
prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt),
|
|
694
|
+
prompt_cache_key: String,
|
|
695
|
+
prompt_cache_options:
|
|
696
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions,
|
|
697
|
+
prompt_cache_retention:
|
|
698
|
+
T.nilable(
|
|
699
|
+
OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol
|
|
700
|
+
),
|
|
701
|
+
reasoning: T.nilable(OpenAI::Beta::BetaResponse::Reasoning),
|
|
702
|
+
safety_identifier: String,
|
|
703
|
+
service_tier:
|
|
704
|
+
T.nilable(
|
|
705
|
+
OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol
|
|
706
|
+
),
|
|
707
|
+
status: OpenAI::Beta::BetaResponseStatus::TaggedSymbol,
|
|
708
|
+
text: OpenAI::Beta::BetaResponseTextConfig,
|
|
709
|
+
top_logprobs: T.nilable(Integer),
|
|
710
|
+
truncation:
|
|
711
|
+
T.nilable(OpenAI::Beta::BetaResponse::Truncation::TaggedSymbol),
|
|
712
|
+
usage: OpenAI::Beta::BetaResponseUsage,
|
|
713
|
+
user: String
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
end
|
|
717
|
+
def to_hash
|
|
718
|
+
end
|
|
719
|
+
|
|
720
|
+
class IncompleteDetails < OpenAI::Internal::Type::BaseModel
|
|
721
|
+
OrHash =
|
|
722
|
+
T.type_alias do
|
|
723
|
+
T.any(
|
|
724
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails,
|
|
725
|
+
OpenAI::Internal::AnyHash
|
|
726
|
+
)
|
|
727
|
+
end
|
|
728
|
+
|
|
729
|
+
# The reason why the response is incomplete.
|
|
730
|
+
sig do
|
|
731
|
+
returns(
|
|
732
|
+
T.nilable(
|
|
733
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol
|
|
734
|
+
)
|
|
735
|
+
)
|
|
736
|
+
end
|
|
737
|
+
attr_reader :reason
|
|
738
|
+
|
|
739
|
+
sig do
|
|
740
|
+
params(
|
|
741
|
+
reason:
|
|
742
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::OrSymbol
|
|
743
|
+
).void
|
|
744
|
+
end
|
|
745
|
+
attr_writer :reason
|
|
746
|
+
|
|
747
|
+
# Details about why the response is incomplete.
|
|
748
|
+
sig do
|
|
749
|
+
params(
|
|
750
|
+
reason:
|
|
751
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::OrSymbol
|
|
752
|
+
).returns(T.attached_class)
|
|
753
|
+
end
|
|
754
|
+
def self.new(
|
|
755
|
+
# The reason why the response is incomplete.
|
|
756
|
+
reason: nil
|
|
757
|
+
)
|
|
758
|
+
end
|
|
759
|
+
|
|
760
|
+
sig do
|
|
761
|
+
override.returns(
|
|
762
|
+
{
|
|
763
|
+
reason:
|
|
764
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol
|
|
765
|
+
}
|
|
766
|
+
)
|
|
767
|
+
end
|
|
768
|
+
def to_hash
|
|
769
|
+
end
|
|
770
|
+
|
|
771
|
+
# The reason why the response is incomplete.
|
|
772
|
+
module Reason
|
|
773
|
+
extend OpenAI::Internal::Type::Enum
|
|
774
|
+
|
|
775
|
+
TaggedSymbol =
|
|
776
|
+
T.type_alias do
|
|
777
|
+
T.all(
|
|
778
|
+
Symbol,
|
|
779
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason
|
|
780
|
+
)
|
|
781
|
+
end
|
|
782
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
783
|
+
|
|
784
|
+
MAX_OUTPUT_TOKENS =
|
|
785
|
+
T.let(
|
|
786
|
+
:max_output_tokens,
|
|
787
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol
|
|
788
|
+
)
|
|
789
|
+
CONTENT_FILTER =
|
|
790
|
+
T.let(
|
|
791
|
+
:content_filter,
|
|
792
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol
|
|
793
|
+
)
|
|
794
|
+
|
|
795
|
+
sig do
|
|
796
|
+
override.returns(
|
|
797
|
+
T::Array[
|
|
798
|
+
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol
|
|
799
|
+
]
|
|
800
|
+
)
|
|
801
|
+
end
|
|
802
|
+
def self.values
|
|
803
|
+
end
|
|
804
|
+
end
|
|
805
|
+
end
|
|
806
|
+
|
|
807
|
+
# A system (or developer) message inserted into the model's context.
|
|
808
|
+
#
|
|
809
|
+
# When using along with `previous_response_id`, the instructions from a previous
|
|
810
|
+
# response will not be carried over to the next response. This makes it simple to
|
|
811
|
+
# swap out system (or developer) messages in new responses.
|
|
812
|
+
module Instructions
|
|
813
|
+
extend OpenAI::Internal::Type::Union
|
|
814
|
+
|
|
815
|
+
Variants =
|
|
816
|
+
T.type_alias do
|
|
817
|
+
T.any(
|
|
818
|
+
String,
|
|
819
|
+
T::Array[OpenAI::Beta::BetaResponseInputItem::Variants]
|
|
820
|
+
)
|
|
821
|
+
end
|
|
822
|
+
|
|
823
|
+
sig do
|
|
824
|
+
override.returns(
|
|
825
|
+
T::Array[OpenAI::Beta::BetaResponse::Instructions::Variants]
|
|
826
|
+
)
|
|
827
|
+
end
|
|
828
|
+
def self.variants
|
|
829
|
+
end
|
|
830
|
+
|
|
831
|
+
BetaResponseInputItemArray =
|
|
832
|
+
T.let(
|
|
833
|
+
OpenAI::Internal::Type::ArrayOf[
|
|
834
|
+
union: OpenAI::Beta::BetaResponseInputItem
|
|
835
|
+
],
|
|
836
|
+
OpenAI::Internal::Type::Converter
|
|
837
|
+
)
|
|
838
|
+
end
|
|
839
|
+
|
|
840
|
+
# Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a
|
|
841
|
+
# wide range of models with different capabilities, performance characteristics,
|
|
842
|
+
# and price points. Refer to the
|
|
843
|
+
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
844
|
+
# available models.
|
|
845
|
+
module Model
|
|
846
|
+
extend OpenAI::Internal::Type::Union
|
|
847
|
+
|
|
848
|
+
Variants =
|
|
849
|
+
T.type_alias do
|
|
850
|
+
T.any(OpenAI::Beta::BetaResponse::Model::TaggedSymbol, String)
|
|
851
|
+
end
|
|
852
|
+
|
|
853
|
+
sig do
|
|
854
|
+
override.returns(
|
|
855
|
+
T::Array[OpenAI::Beta::BetaResponse::Model::Variants]
|
|
856
|
+
)
|
|
857
|
+
end
|
|
858
|
+
def self.variants
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
TaggedSymbol =
|
|
862
|
+
T.type_alias { T.all(Symbol, OpenAI::Beta::BetaResponse::Model) }
|
|
863
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
864
|
+
|
|
865
|
+
GPT_5_6_SOL =
|
|
866
|
+
T.let(
|
|
867
|
+
:"gpt-5.6-sol",
|
|
868
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
869
|
+
)
|
|
870
|
+
GPT_5_6_TERRA =
|
|
871
|
+
T.let(
|
|
872
|
+
:"gpt-5.6-terra",
|
|
873
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
874
|
+
)
|
|
875
|
+
GPT_5_6_LUNA =
|
|
876
|
+
T.let(
|
|
877
|
+
:"gpt-5.6-luna",
|
|
878
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
879
|
+
)
|
|
880
|
+
GPT_5_4 =
|
|
881
|
+
T.let(:"gpt-5.4", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
882
|
+
GPT_5_4_MINI =
|
|
883
|
+
T.let(
|
|
884
|
+
:"gpt-5.4-mini",
|
|
885
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
886
|
+
)
|
|
887
|
+
GPT_5_4_NANO =
|
|
888
|
+
T.let(
|
|
889
|
+
:"gpt-5.4-nano",
|
|
890
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
891
|
+
)
|
|
892
|
+
GPT_5_4_MINI_2026_03_17 =
|
|
893
|
+
T.let(
|
|
894
|
+
:"gpt-5.4-mini-2026-03-17",
|
|
895
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
896
|
+
)
|
|
897
|
+
GPT_5_4_NANO_2026_03_17 =
|
|
898
|
+
T.let(
|
|
899
|
+
:"gpt-5.4-nano-2026-03-17",
|
|
900
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
901
|
+
)
|
|
902
|
+
GPT_5_3_CHAT_LATEST =
|
|
903
|
+
T.let(
|
|
904
|
+
:"gpt-5.3-chat-latest",
|
|
905
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
906
|
+
)
|
|
907
|
+
GPT_5_2 =
|
|
908
|
+
T.let(:"gpt-5.2", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
909
|
+
GPT_5_2_2025_12_11 =
|
|
910
|
+
T.let(
|
|
911
|
+
:"gpt-5.2-2025-12-11",
|
|
912
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
913
|
+
)
|
|
914
|
+
GPT_5_2_CHAT_LATEST =
|
|
915
|
+
T.let(
|
|
916
|
+
:"gpt-5.2-chat-latest",
|
|
917
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
918
|
+
)
|
|
919
|
+
GPT_5_2_PRO =
|
|
920
|
+
T.let(
|
|
921
|
+
:"gpt-5.2-pro",
|
|
922
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
923
|
+
)
|
|
924
|
+
GPT_5_2_PRO_2025_12_11 =
|
|
925
|
+
T.let(
|
|
926
|
+
:"gpt-5.2-pro-2025-12-11",
|
|
927
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
928
|
+
)
|
|
929
|
+
GPT_5_1 =
|
|
930
|
+
T.let(:"gpt-5.1", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
931
|
+
GPT_5_1_2025_11_13 =
|
|
932
|
+
T.let(
|
|
933
|
+
:"gpt-5.1-2025-11-13",
|
|
934
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
935
|
+
)
|
|
936
|
+
GPT_5_1_CODEX =
|
|
937
|
+
T.let(
|
|
938
|
+
:"gpt-5.1-codex",
|
|
939
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
940
|
+
)
|
|
941
|
+
GPT_5_1_MINI =
|
|
942
|
+
T.let(
|
|
943
|
+
:"gpt-5.1-mini",
|
|
944
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
945
|
+
)
|
|
946
|
+
GPT_5_1_CHAT_LATEST =
|
|
947
|
+
T.let(
|
|
948
|
+
:"gpt-5.1-chat-latest",
|
|
949
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
950
|
+
)
|
|
951
|
+
GPT_5 =
|
|
952
|
+
T.let(:"gpt-5", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
953
|
+
GPT_5_MINI =
|
|
954
|
+
T.let(
|
|
955
|
+
:"gpt-5-mini",
|
|
956
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
957
|
+
)
|
|
958
|
+
GPT_5_NANO =
|
|
959
|
+
T.let(
|
|
960
|
+
:"gpt-5-nano",
|
|
961
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
962
|
+
)
|
|
963
|
+
GPT_5_2025_08_07 =
|
|
964
|
+
T.let(
|
|
965
|
+
:"gpt-5-2025-08-07",
|
|
966
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
967
|
+
)
|
|
968
|
+
GPT_5_MINI_2025_08_07 =
|
|
969
|
+
T.let(
|
|
970
|
+
:"gpt-5-mini-2025-08-07",
|
|
971
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
972
|
+
)
|
|
973
|
+
GPT_5_NANO_2025_08_07 =
|
|
974
|
+
T.let(
|
|
975
|
+
:"gpt-5-nano-2025-08-07",
|
|
976
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
977
|
+
)
|
|
978
|
+
GPT_5_CHAT_LATEST =
|
|
979
|
+
T.let(
|
|
980
|
+
:"gpt-5-chat-latest",
|
|
981
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
982
|
+
)
|
|
983
|
+
GPT_4_1 =
|
|
984
|
+
T.let(:"gpt-4.1", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
985
|
+
GPT_4_1_MINI =
|
|
986
|
+
T.let(
|
|
987
|
+
:"gpt-4.1-mini",
|
|
988
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
989
|
+
)
|
|
990
|
+
GPT_4_1_NANO =
|
|
991
|
+
T.let(
|
|
992
|
+
:"gpt-4.1-nano",
|
|
993
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
994
|
+
)
|
|
995
|
+
GPT_4_1_2025_04_14 =
|
|
996
|
+
T.let(
|
|
997
|
+
:"gpt-4.1-2025-04-14",
|
|
998
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
999
|
+
)
|
|
1000
|
+
GPT_4_1_MINI_2025_04_14 =
|
|
1001
|
+
T.let(
|
|
1002
|
+
:"gpt-4.1-mini-2025-04-14",
|
|
1003
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1004
|
+
)
|
|
1005
|
+
GPT_4_1_NANO_2025_04_14 =
|
|
1006
|
+
T.let(
|
|
1007
|
+
:"gpt-4.1-nano-2025-04-14",
|
|
1008
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1009
|
+
)
|
|
1010
|
+
O4_MINI =
|
|
1011
|
+
T.let(:"o4-mini", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1012
|
+
O4_MINI_2025_04_16 =
|
|
1013
|
+
T.let(
|
|
1014
|
+
:"o4-mini-2025-04-16",
|
|
1015
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1016
|
+
)
|
|
1017
|
+
O3 = T.let(:o3, OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1018
|
+
O3_2025_04_16 =
|
|
1019
|
+
T.let(
|
|
1020
|
+
:"o3-2025-04-16",
|
|
1021
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1022
|
+
)
|
|
1023
|
+
O3_MINI =
|
|
1024
|
+
T.let(:"o3-mini", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1025
|
+
O3_MINI_2025_01_31 =
|
|
1026
|
+
T.let(
|
|
1027
|
+
:"o3-mini-2025-01-31",
|
|
1028
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1029
|
+
)
|
|
1030
|
+
O1 = T.let(:o1, OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1031
|
+
O1_2024_12_17 =
|
|
1032
|
+
T.let(
|
|
1033
|
+
:"o1-2024-12-17",
|
|
1034
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1035
|
+
)
|
|
1036
|
+
O1_PREVIEW =
|
|
1037
|
+
T.let(
|
|
1038
|
+
:"o1-preview",
|
|
1039
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1040
|
+
)
|
|
1041
|
+
O1_PREVIEW_2024_09_12 =
|
|
1042
|
+
T.let(
|
|
1043
|
+
:"o1-preview-2024-09-12",
|
|
1044
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1045
|
+
)
|
|
1046
|
+
O1_MINI =
|
|
1047
|
+
T.let(:"o1-mini", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1048
|
+
O1_MINI_2024_09_12 =
|
|
1049
|
+
T.let(
|
|
1050
|
+
:"o1-mini-2024-09-12",
|
|
1051
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1052
|
+
)
|
|
1053
|
+
GPT_4O =
|
|
1054
|
+
T.let(:"gpt-4o", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1055
|
+
GPT_4O_2024_11_20 =
|
|
1056
|
+
T.let(
|
|
1057
|
+
:"gpt-4o-2024-11-20",
|
|
1058
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1059
|
+
)
|
|
1060
|
+
GPT_4O_2024_08_06 =
|
|
1061
|
+
T.let(
|
|
1062
|
+
:"gpt-4o-2024-08-06",
|
|
1063
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1064
|
+
)
|
|
1065
|
+
GPT_4O_2024_05_13 =
|
|
1066
|
+
T.let(
|
|
1067
|
+
:"gpt-4o-2024-05-13",
|
|
1068
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1069
|
+
)
|
|
1070
|
+
GPT_4O_AUDIO_PREVIEW =
|
|
1071
|
+
T.let(
|
|
1072
|
+
:"gpt-4o-audio-preview",
|
|
1073
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1074
|
+
)
|
|
1075
|
+
GPT_4O_AUDIO_PREVIEW_2024_10_01 =
|
|
1076
|
+
T.let(
|
|
1077
|
+
:"gpt-4o-audio-preview-2024-10-01",
|
|
1078
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1079
|
+
)
|
|
1080
|
+
GPT_4O_AUDIO_PREVIEW_2024_12_17 =
|
|
1081
|
+
T.let(
|
|
1082
|
+
:"gpt-4o-audio-preview-2024-12-17",
|
|
1083
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1084
|
+
)
|
|
1085
|
+
GPT_4O_AUDIO_PREVIEW_2025_06_03 =
|
|
1086
|
+
T.let(
|
|
1087
|
+
:"gpt-4o-audio-preview-2025-06-03",
|
|
1088
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1089
|
+
)
|
|
1090
|
+
GPT_4O_MINI_AUDIO_PREVIEW =
|
|
1091
|
+
T.let(
|
|
1092
|
+
:"gpt-4o-mini-audio-preview",
|
|
1093
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1094
|
+
)
|
|
1095
|
+
GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17 =
|
|
1096
|
+
T.let(
|
|
1097
|
+
:"gpt-4o-mini-audio-preview-2024-12-17",
|
|
1098
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1099
|
+
)
|
|
1100
|
+
GPT_4O_SEARCH_PREVIEW =
|
|
1101
|
+
T.let(
|
|
1102
|
+
:"gpt-4o-search-preview",
|
|
1103
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1104
|
+
)
|
|
1105
|
+
GPT_4O_MINI_SEARCH_PREVIEW =
|
|
1106
|
+
T.let(
|
|
1107
|
+
:"gpt-4o-mini-search-preview",
|
|
1108
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1109
|
+
)
|
|
1110
|
+
GPT_4O_SEARCH_PREVIEW_2025_03_11 =
|
|
1111
|
+
T.let(
|
|
1112
|
+
:"gpt-4o-search-preview-2025-03-11",
|
|
1113
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1114
|
+
)
|
|
1115
|
+
GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11 =
|
|
1116
|
+
T.let(
|
|
1117
|
+
:"gpt-4o-mini-search-preview-2025-03-11",
|
|
1118
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1119
|
+
)
|
|
1120
|
+
CHATGPT_4O_LATEST =
|
|
1121
|
+
T.let(
|
|
1122
|
+
:"chatgpt-4o-latest",
|
|
1123
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1124
|
+
)
|
|
1125
|
+
CODEX_MINI_LATEST =
|
|
1126
|
+
T.let(
|
|
1127
|
+
:"codex-mini-latest",
|
|
1128
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1129
|
+
)
|
|
1130
|
+
GPT_4O_MINI =
|
|
1131
|
+
T.let(
|
|
1132
|
+
:"gpt-4o-mini",
|
|
1133
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1134
|
+
)
|
|
1135
|
+
GPT_4O_MINI_2024_07_18 =
|
|
1136
|
+
T.let(
|
|
1137
|
+
:"gpt-4o-mini-2024-07-18",
|
|
1138
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1139
|
+
)
|
|
1140
|
+
GPT_4_TURBO =
|
|
1141
|
+
T.let(
|
|
1142
|
+
:"gpt-4-turbo",
|
|
1143
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1144
|
+
)
|
|
1145
|
+
GPT_4_TURBO_2024_04_09 =
|
|
1146
|
+
T.let(
|
|
1147
|
+
:"gpt-4-turbo-2024-04-09",
|
|
1148
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1149
|
+
)
|
|
1150
|
+
GPT_4_0125_PREVIEW =
|
|
1151
|
+
T.let(
|
|
1152
|
+
:"gpt-4-0125-preview",
|
|
1153
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1154
|
+
)
|
|
1155
|
+
GPT_4_TURBO_PREVIEW =
|
|
1156
|
+
T.let(
|
|
1157
|
+
:"gpt-4-turbo-preview",
|
|
1158
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1159
|
+
)
|
|
1160
|
+
GPT_4_1106_PREVIEW =
|
|
1161
|
+
T.let(
|
|
1162
|
+
:"gpt-4-1106-preview",
|
|
1163
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1164
|
+
)
|
|
1165
|
+
GPT_4_VISION_PREVIEW =
|
|
1166
|
+
T.let(
|
|
1167
|
+
:"gpt-4-vision-preview",
|
|
1168
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1169
|
+
)
|
|
1170
|
+
GPT_4 =
|
|
1171
|
+
T.let(:"gpt-4", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1172
|
+
GPT_4_0314 =
|
|
1173
|
+
T.let(
|
|
1174
|
+
:"gpt-4-0314",
|
|
1175
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1176
|
+
)
|
|
1177
|
+
GPT_4_0613 =
|
|
1178
|
+
T.let(
|
|
1179
|
+
:"gpt-4-0613",
|
|
1180
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1181
|
+
)
|
|
1182
|
+
GPT_4_32K =
|
|
1183
|
+
T.let(:"gpt-4-32k", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1184
|
+
GPT_4_32K_0314 =
|
|
1185
|
+
T.let(
|
|
1186
|
+
:"gpt-4-32k-0314",
|
|
1187
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1188
|
+
)
|
|
1189
|
+
GPT_4_32K_0613 =
|
|
1190
|
+
T.let(
|
|
1191
|
+
:"gpt-4-32k-0613",
|
|
1192
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1193
|
+
)
|
|
1194
|
+
GPT_3_5_TURBO =
|
|
1195
|
+
T.let(
|
|
1196
|
+
:"gpt-3.5-turbo",
|
|
1197
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1198
|
+
)
|
|
1199
|
+
GPT_3_5_TURBO_16K =
|
|
1200
|
+
T.let(
|
|
1201
|
+
:"gpt-3.5-turbo-16k",
|
|
1202
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1203
|
+
)
|
|
1204
|
+
GPT_3_5_TURBO_0301 =
|
|
1205
|
+
T.let(
|
|
1206
|
+
:"gpt-3.5-turbo-0301",
|
|
1207
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1208
|
+
)
|
|
1209
|
+
GPT_3_5_TURBO_0613 =
|
|
1210
|
+
T.let(
|
|
1211
|
+
:"gpt-3.5-turbo-0613",
|
|
1212
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1213
|
+
)
|
|
1214
|
+
GPT_3_5_TURBO_1106 =
|
|
1215
|
+
T.let(
|
|
1216
|
+
:"gpt-3.5-turbo-1106",
|
|
1217
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1218
|
+
)
|
|
1219
|
+
GPT_3_5_TURBO_0125 =
|
|
1220
|
+
T.let(
|
|
1221
|
+
:"gpt-3.5-turbo-0125",
|
|
1222
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1223
|
+
)
|
|
1224
|
+
GPT_3_5_TURBO_16K_0613 =
|
|
1225
|
+
T.let(
|
|
1226
|
+
:"gpt-3.5-turbo-16k-0613",
|
|
1227
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1228
|
+
)
|
|
1229
|
+
O1_PRO =
|
|
1230
|
+
T.let(:"o1-pro", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1231
|
+
O1_PRO_2025_03_19 =
|
|
1232
|
+
T.let(
|
|
1233
|
+
:"o1-pro-2025-03-19",
|
|
1234
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1235
|
+
)
|
|
1236
|
+
O3_PRO =
|
|
1237
|
+
T.let(:"o3-pro", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1238
|
+
O3_PRO_2025_06_10 =
|
|
1239
|
+
T.let(
|
|
1240
|
+
:"o3-pro-2025-06-10",
|
|
1241
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1242
|
+
)
|
|
1243
|
+
O3_DEEP_RESEARCH =
|
|
1244
|
+
T.let(
|
|
1245
|
+
:"o3-deep-research",
|
|
1246
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1247
|
+
)
|
|
1248
|
+
O3_DEEP_RESEARCH_2025_06_26 =
|
|
1249
|
+
T.let(
|
|
1250
|
+
:"o3-deep-research-2025-06-26",
|
|
1251
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1252
|
+
)
|
|
1253
|
+
O4_MINI_DEEP_RESEARCH =
|
|
1254
|
+
T.let(
|
|
1255
|
+
:"o4-mini-deep-research",
|
|
1256
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1257
|
+
)
|
|
1258
|
+
O4_MINI_DEEP_RESEARCH_2025_06_26 =
|
|
1259
|
+
T.let(
|
|
1260
|
+
:"o4-mini-deep-research-2025-06-26",
|
|
1261
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1262
|
+
)
|
|
1263
|
+
COMPUTER_USE_PREVIEW =
|
|
1264
|
+
T.let(
|
|
1265
|
+
:"computer-use-preview",
|
|
1266
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1267
|
+
)
|
|
1268
|
+
COMPUTER_USE_PREVIEW_2025_03_11 =
|
|
1269
|
+
T.let(
|
|
1270
|
+
:"computer-use-preview-2025-03-11",
|
|
1271
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1272
|
+
)
|
|
1273
|
+
GPT_5_CODEX =
|
|
1274
|
+
T.let(
|
|
1275
|
+
:"gpt-5-codex",
|
|
1276
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1277
|
+
)
|
|
1278
|
+
GPT_5_PRO =
|
|
1279
|
+
T.let(:"gpt-5-pro", OpenAI::Beta::BetaResponse::Model::TaggedSymbol)
|
|
1280
|
+
GPT_5_PRO_2025_10_06 =
|
|
1281
|
+
T.let(
|
|
1282
|
+
:"gpt-5-pro-2025-10-06",
|
|
1283
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1284
|
+
)
|
|
1285
|
+
GPT_5_1_CODEX_MAX =
|
|
1286
|
+
T.let(
|
|
1287
|
+
:"gpt-5.1-codex-max",
|
|
1288
|
+
OpenAI::Beta::BetaResponse::Model::TaggedSymbol
|
|
1289
|
+
)
|
|
1290
|
+
end
|
|
1291
|
+
|
|
1292
|
+
# How the model should select which tool (or tools) to use when generating a
|
|
1293
|
+
# response. See the `tools` parameter to see how to specify which tools the model
|
|
1294
|
+
# can call.
|
|
1295
|
+
module ToolChoice
|
|
1296
|
+
extend OpenAI::Internal::Type::Union
|
|
1297
|
+
|
|
1298
|
+
Variants =
|
|
1299
|
+
T.type_alias do
|
|
1300
|
+
T.any(
|
|
1301
|
+
OpenAI::Beta::BetaToolChoiceOptions::TaggedSymbol,
|
|
1302
|
+
OpenAI::Beta::BetaToolChoiceAllowed,
|
|
1303
|
+
OpenAI::Beta::BetaToolChoiceTypes,
|
|
1304
|
+
OpenAI::Beta::BetaToolChoiceFunction,
|
|
1305
|
+
OpenAI::Beta::BetaToolChoiceMcp,
|
|
1306
|
+
OpenAI::Beta::BetaToolChoiceCustom,
|
|
1307
|
+
OpenAI::Beta::BetaResponse::ToolChoice::BetaSpecificProgrammaticToolCallingParam,
|
|
1308
|
+
OpenAI::Beta::BetaToolChoiceApplyPatch,
|
|
1309
|
+
OpenAI::Beta::BetaToolChoiceShell
|
|
1310
|
+
)
|
|
1311
|
+
end
|
|
1312
|
+
|
|
1313
|
+
class BetaSpecificProgrammaticToolCallingParam < OpenAI::Internal::Type::BaseModel
|
|
1314
|
+
OrHash =
|
|
1315
|
+
T.type_alias do
|
|
1316
|
+
T.any(
|
|
1317
|
+
OpenAI::Beta::BetaResponse::ToolChoice::BetaSpecificProgrammaticToolCallingParam,
|
|
1318
|
+
OpenAI::Internal::AnyHash
|
|
1319
|
+
)
|
|
1320
|
+
end
|
|
1321
|
+
|
|
1322
|
+
# The tool to call. Always `programmatic_tool_calling`.
|
|
1323
|
+
sig { returns(Symbol) }
|
|
1324
|
+
attr_accessor :type
|
|
1325
|
+
|
|
1326
|
+
sig { params(type: Symbol).returns(T.attached_class) }
|
|
1327
|
+
def self.new(
|
|
1328
|
+
# The tool to call. Always `programmatic_tool_calling`.
|
|
1329
|
+
type: :programmatic_tool_calling
|
|
1330
|
+
)
|
|
1331
|
+
end
|
|
1332
|
+
|
|
1333
|
+
sig { override.returns({ type: Symbol }) }
|
|
1334
|
+
def to_hash
|
|
1335
|
+
end
|
|
1336
|
+
end
|
|
1337
|
+
|
|
1338
|
+
sig do
|
|
1339
|
+
override.returns(
|
|
1340
|
+
T::Array[OpenAI::Beta::BetaResponse::ToolChoice::Variants]
|
|
1341
|
+
)
|
|
1342
|
+
end
|
|
1343
|
+
def self.variants
|
|
1344
|
+
end
|
|
1345
|
+
end
|
|
1346
|
+
|
|
1347
|
+
class Conversation < OpenAI::Internal::Type::BaseModel
|
|
1348
|
+
OrHash =
|
|
1349
|
+
T.type_alias do
|
|
1350
|
+
T.any(
|
|
1351
|
+
OpenAI::Beta::BetaResponse::Conversation,
|
|
1352
|
+
OpenAI::Internal::AnyHash
|
|
1353
|
+
)
|
|
1354
|
+
end
|
|
1355
|
+
|
|
1356
|
+
# The unique ID of the conversation that this response was associated with.
|
|
1357
|
+
sig { returns(String) }
|
|
1358
|
+
attr_accessor :id
|
|
1359
|
+
|
|
1360
|
+
# The conversation that this response belonged to. Input items and output items
|
|
1361
|
+
# from this response were automatically added to this conversation.
|
|
1362
|
+
sig { params(id: String).returns(T.attached_class) }
|
|
1363
|
+
def self.new(
|
|
1364
|
+
# The unique ID of the conversation that this response was associated with.
|
|
1365
|
+
id:
|
|
1366
|
+
)
|
|
1367
|
+
end
|
|
1368
|
+
|
|
1369
|
+
sig { override.returns({ id: String }) }
|
|
1370
|
+
def to_hash
|
|
1371
|
+
end
|
|
1372
|
+
end
|
|
1373
|
+
|
|
1374
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
1375
|
+
OrHash =
|
|
1376
|
+
T.type_alias do
|
|
1377
|
+
T.any(
|
|
1378
|
+
OpenAI::Beta::BetaResponse::Moderation,
|
|
1379
|
+
OpenAI::Internal::AnyHash
|
|
1380
|
+
)
|
|
1381
|
+
end
|
|
1382
|
+
|
|
1383
|
+
# Moderation for the response input.
|
|
1384
|
+
sig do
|
|
1385
|
+
returns(OpenAI::Beta::BetaResponse::Moderation::Input::Variants)
|
|
1386
|
+
end
|
|
1387
|
+
attr_accessor :input
|
|
1388
|
+
|
|
1389
|
+
# Moderation for the response output.
|
|
1390
|
+
sig do
|
|
1391
|
+
returns(OpenAI::Beta::BetaResponse::Moderation::Output::Variants)
|
|
1392
|
+
end
|
|
1393
|
+
attr_accessor :output
|
|
1394
|
+
|
|
1395
|
+
# Moderation results for the response input and output, if moderated completions
|
|
1396
|
+
# were requested.
|
|
1397
|
+
sig do
|
|
1398
|
+
params(
|
|
1399
|
+
input:
|
|
1400
|
+
T.any(
|
|
1401
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::OrHash,
|
|
1402
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::Error::OrHash
|
|
1403
|
+
),
|
|
1404
|
+
output:
|
|
1405
|
+
T.any(
|
|
1406
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::OrHash,
|
|
1407
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::Error::OrHash
|
|
1408
|
+
)
|
|
1409
|
+
).returns(T.attached_class)
|
|
1410
|
+
end
|
|
1411
|
+
def self.new(
|
|
1412
|
+
# Moderation for the response input.
|
|
1413
|
+
input:,
|
|
1414
|
+
# Moderation for the response output.
|
|
1415
|
+
output:
|
|
1416
|
+
)
|
|
1417
|
+
end
|
|
1418
|
+
|
|
1419
|
+
sig do
|
|
1420
|
+
override.returns(
|
|
1421
|
+
{
|
|
1422
|
+
input: OpenAI::Beta::BetaResponse::Moderation::Input::Variants,
|
|
1423
|
+
output: OpenAI::Beta::BetaResponse::Moderation::Output::Variants
|
|
1424
|
+
}
|
|
1425
|
+
)
|
|
1426
|
+
end
|
|
1427
|
+
def to_hash
|
|
1428
|
+
end
|
|
1429
|
+
|
|
1430
|
+
# Moderation for the response input.
|
|
1431
|
+
module Input
|
|
1432
|
+
extend OpenAI::Internal::Type::Union
|
|
1433
|
+
|
|
1434
|
+
Variants =
|
|
1435
|
+
T.type_alias do
|
|
1436
|
+
T.any(
|
|
1437
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult,
|
|
1438
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::Error
|
|
1439
|
+
)
|
|
1440
|
+
end
|
|
1441
|
+
|
|
1442
|
+
class ModerationResult < OpenAI::Internal::Type::BaseModel
|
|
1443
|
+
OrHash =
|
|
1444
|
+
T.type_alias do
|
|
1445
|
+
T.any(
|
|
1446
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult,
|
|
1447
|
+
OpenAI::Internal::AnyHash
|
|
1448
|
+
)
|
|
1449
|
+
end
|
|
1450
|
+
|
|
1451
|
+
# A dictionary of moderation categories to booleans, True if the input is flagged
|
|
1452
|
+
# under this category.
|
|
1453
|
+
sig { returns(T::Hash[Symbol, T::Boolean]) }
|
|
1454
|
+
attr_accessor :categories
|
|
1455
|
+
|
|
1456
|
+
# Which modalities of input are reflected by the score for each category.
|
|
1457
|
+
sig do
|
|
1458
|
+
returns(
|
|
1459
|
+
T::Hash[
|
|
1460
|
+
Symbol,
|
|
1461
|
+
T::Array[
|
|
1462
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1463
|
+
]
|
|
1464
|
+
]
|
|
1465
|
+
)
|
|
1466
|
+
end
|
|
1467
|
+
attr_accessor :category_applied_input_types
|
|
1468
|
+
|
|
1469
|
+
# A dictionary of moderation categories to scores.
|
|
1470
|
+
sig { returns(T::Hash[Symbol, Float]) }
|
|
1471
|
+
attr_accessor :category_scores
|
|
1472
|
+
|
|
1473
|
+
# A boolean indicating whether the content was flagged by any category.
|
|
1474
|
+
sig { returns(T::Boolean) }
|
|
1475
|
+
attr_accessor :flagged
|
|
1476
|
+
|
|
1477
|
+
# The moderation model that produced this result.
|
|
1478
|
+
sig { returns(String) }
|
|
1479
|
+
attr_accessor :model
|
|
1480
|
+
|
|
1481
|
+
# The object type, which was always `moderation_result` for successful moderation
|
|
1482
|
+
# results.
|
|
1483
|
+
sig { returns(Symbol) }
|
|
1484
|
+
attr_accessor :type
|
|
1485
|
+
|
|
1486
|
+
# A moderation result produced for the response input or output.
|
|
1487
|
+
sig do
|
|
1488
|
+
params(
|
|
1489
|
+
categories: T::Hash[Symbol, T::Boolean],
|
|
1490
|
+
category_applied_input_types:
|
|
1491
|
+
T::Hash[
|
|
1492
|
+
Symbol,
|
|
1493
|
+
T::Array[
|
|
1494
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType::OrSymbol
|
|
1495
|
+
]
|
|
1496
|
+
],
|
|
1497
|
+
category_scores: T::Hash[Symbol, Float],
|
|
1498
|
+
flagged: T::Boolean,
|
|
1499
|
+
model: String,
|
|
1500
|
+
type: Symbol
|
|
1501
|
+
).returns(T.attached_class)
|
|
1502
|
+
end
|
|
1503
|
+
def self.new(
|
|
1504
|
+
# A dictionary of moderation categories to booleans, True if the input is flagged
|
|
1505
|
+
# under this category.
|
|
1506
|
+
categories:,
|
|
1507
|
+
# Which modalities of input are reflected by the score for each category.
|
|
1508
|
+
category_applied_input_types:,
|
|
1509
|
+
# A dictionary of moderation categories to scores.
|
|
1510
|
+
category_scores:,
|
|
1511
|
+
# A boolean indicating whether the content was flagged by any category.
|
|
1512
|
+
flagged:,
|
|
1513
|
+
# The moderation model that produced this result.
|
|
1514
|
+
model:,
|
|
1515
|
+
# The object type, which was always `moderation_result` for successful moderation
|
|
1516
|
+
# results.
|
|
1517
|
+
type: :moderation_result
|
|
1518
|
+
)
|
|
1519
|
+
end
|
|
1520
|
+
|
|
1521
|
+
sig do
|
|
1522
|
+
override.returns(
|
|
1523
|
+
{
|
|
1524
|
+
categories: T::Hash[Symbol, T::Boolean],
|
|
1525
|
+
category_applied_input_types:
|
|
1526
|
+
T::Hash[
|
|
1527
|
+
Symbol,
|
|
1528
|
+
T::Array[
|
|
1529
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1530
|
+
]
|
|
1531
|
+
],
|
|
1532
|
+
category_scores: T::Hash[Symbol, Float],
|
|
1533
|
+
flagged: T::Boolean,
|
|
1534
|
+
model: String,
|
|
1535
|
+
type: Symbol
|
|
1536
|
+
}
|
|
1537
|
+
)
|
|
1538
|
+
end
|
|
1539
|
+
def to_hash
|
|
1540
|
+
end
|
|
1541
|
+
|
|
1542
|
+
module CategoryAppliedInputType
|
|
1543
|
+
extend OpenAI::Internal::Type::Enum
|
|
1544
|
+
|
|
1545
|
+
TaggedSymbol =
|
|
1546
|
+
T.type_alias do
|
|
1547
|
+
T.all(
|
|
1548
|
+
Symbol,
|
|
1549
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType
|
|
1550
|
+
)
|
|
1551
|
+
end
|
|
1552
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1553
|
+
|
|
1554
|
+
TEXT =
|
|
1555
|
+
T.let(
|
|
1556
|
+
:text,
|
|
1557
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1558
|
+
)
|
|
1559
|
+
IMAGE =
|
|
1560
|
+
T.let(
|
|
1561
|
+
:image,
|
|
1562
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1563
|
+
)
|
|
1564
|
+
|
|
1565
|
+
sig do
|
|
1566
|
+
override.returns(
|
|
1567
|
+
T::Array[
|
|
1568
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1569
|
+
]
|
|
1570
|
+
)
|
|
1571
|
+
end
|
|
1572
|
+
def self.values
|
|
1573
|
+
end
|
|
1574
|
+
end
|
|
1575
|
+
end
|
|
1576
|
+
|
|
1577
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
1578
|
+
OrHash =
|
|
1579
|
+
T.type_alias do
|
|
1580
|
+
T.any(
|
|
1581
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::Error,
|
|
1582
|
+
OpenAI::Internal::AnyHash
|
|
1583
|
+
)
|
|
1584
|
+
end
|
|
1585
|
+
|
|
1586
|
+
# The error code.
|
|
1587
|
+
sig { returns(String) }
|
|
1588
|
+
attr_accessor :code
|
|
1589
|
+
|
|
1590
|
+
# The error message.
|
|
1591
|
+
sig { returns(String) }
|
|
1592
|
+
attr_accessor :message
|
|
1593
|
+
|
|
1594
|
+
# The object type, which was always `error` for moderation failures.
|
|
1595
|
+
sig { returns(Symbol) }
|
|
1596
|
+
attr_accessor :type
|
|
1597
|
+
|
|
1598
|
+
# An error produced while attempting moderation for the response input or output.
|
|
1599
|
+
sig do
|
|
1600
|
+
params(code: String, message: String, type: Symbol).returns(
|
|
1601
|
+
T.attached_class
|
|
1602
|
+
)
|
|
1603
|
+
end
|
|
1604
|
+
def self.new(
|
|
1605
|
+
# The error code.
|
|
1606
|
+
code:,
|
|
1607
|
+
# The error message.
|
|
1608
|
+
message:,
|
|
1609
|
+
# The object type, which was always `error` for moderation failures.
|
|
1610
|
+
type: :error
|
|
1611
|
+
)
|
|
1612
|
+
end
|
|
1613
|
+
|
|
1614
|
+
sig do
|
|
1615
|
+
override.returns(
|
|
1616
|
+
{ code: String, message: String, type: Symbol }
|
|
1617
|
+
)
|
|
1618
|
+
end
|
|
1619
|
+
def to_hash
|
|
1620
|
+
end
|
|
1621
|
+
end
|
|
1622
|
+
|
|
1623
|
+
sig do
|
|
1624
|
+
override.returns(
|
|
1625
|
+
T::Array[
|
|
1626
|
+
OpenAI::Beta::BetaResponse::Moderation::Input::Variants
|
|
1627
|
+
]
|
|
1628
|
+
)
|
|
1629
|
+
end
|
|
1630
|
+
def self.variants
|
|
1631
|
+
end
|
|
1632
|
+
end
|
|
1633
|
+
|
|
1634
|
+
# Moderation for the response output.
|
|
1635
|
+
module Output
|
|
1636
|
+
extend OpenAI::Internal::Type::Union
|
|
1637
|
+
|
|
1638
|
+
Variants =
|
|
1639
|
+
T.type_alias do
|
|
1640
|
+
T.any(
|
|
1641
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult,
|
|
1642
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::Error
|
|
1643
|
+
)
|
|
1644
|
+
end
|
|
1645
|
+
|
|
1646
|
+
class ModerationResult < OpenAI::Internal::Type::BaseModel
|
|
1647
|
+
OrHash =
|
|
1648
|
+
T.type_alias do
|
|
1649
|
+
T.any(
|
|
1650
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult,
|
|
1651
|
+
OpenAI::Internal::AnyHash
|
|
1652
|
+
)
|
|
1653
|
+
end
|
|
1654
|
+
|
|
1655
|
+
# A dictionary of moderation categories to booleans, True if the input is flagged
|
|
1656
|
+
# under this category.
|
|
1657
|
+
sig { returns(T::Hash[Symbol, T::Boolean]) }
|
|
1658
|
+
attr_accessor :categories
|
|
1659
|
+
|
|
1660
|
+
# Which modalities of input are reflected by the score for each category.
|
|
1661
|
+
sig do
|
|
1662
|
+
returns(
|
|
1663
|
+
T::Hash[
|
|
1664
|
+
Symbol,
|
|
1665
|
+
T::Array[
|
|
1666
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1667
|
+
]
|
|
1668
|
+
]
|
|
1669
|
+
)
|
|
1670
|
+
end
|
|
1671
|
+
attr_accessor :category_applied_input_types
|
|
1672
|
+
|
|
1673
|
+
# A dictionary of moderation categories to scores.
|
|
1674
|
+
sig { returns(T::Hash[Symbol, Float]) }
|
|
1675
|
+
attr_accessor :category_scores
|
|
1676
|
+
|
|
1677
|
+
# A boolean indicating whether the content was flagged by any category.
|
|
1678
|
+
sig { returns(T::Boolean) }
|
|
1679
|
+
attr_accessor :flagged
|
|
1680
|
+
|
|
1681
|
+
# The moderation model that produced this result.
|
|
1682
|
+
sig { returns(String) }
|
|
1683
|
+
attr_accessor :model
|
|
1684
|
+
|
|
1685
|
+
# The object type, which was always `moderation_result` for successful moderation
|
|
1686
|
+
# results.
|
|
1687
|
+
sig { returns(Symbol) }
|
|
1688
|
+
attr_accessor :type
|
|
1689
|
+
|
|
1690
|
+
# A moderation result produced for the response input or output.
|
|
1691
|
+
sig do
|
|
1692
|
+
params(
|
|
1693
|
+
categories: T::Hash[Symbol, T::Boolean],
|
|
1694
|
+
category_applied_input_types:
|
|
1695
|
+
T::Hash[
|
|
1696
|
+
Symbol,
|
|
1697
|
+
T::Array[
|
|
1698
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType::OrSymbol
|
|
1699
|
+
]
|
|
1700
|
+
],
|
|
1701
|
+
category_scores: T::Hash[Symbol, Float],
|
|
1702
|
+
flagged: T::Boolean,
|
|
1703
|
+
model: String,
|
|
1704
|
+
type: Symbol
|
|
1705
|
+
).returns(T.attached_class)
|
|
1706
|
+
end
|
|
1707
|
+
def self.new(
|
|
1708
|
+
# A dictionary of moderation categories to booleans, True if the input is flagged
|
|
1709
|
+
# under this category.
|
|
1710
|
+
categories:,
|
|
1711
|
+
# Which modalities of input are reflected by the score for each category.
|
|
1712
|
+
category_applied_input_types:,
|
|
1713
|
+
# A dictionary of moderation categories to scores.
|
|
1714
|
+
category_scores:,
|
|
1715
|
+
# A boolean indicating whether the content was flagged by any category.
|
|
1716
|
+
flagged:,
|
|
1717
|
+
# The moderation model that produced this result.
|
|
1718
|
+
model:,
|
|
1719
|
+
# The object type, which was always `moderation_result` for successful moderation
|
|
1720
|
+
# results.
|
|
1721
|
+
type: :moderation_result
|
|
1722
|
+
)
|
|
1723
|
+
end
|
|
1724
|
+
|
|
1725
|
+
sig do
|
|
1726
|
+
override.returns(
|
|
1727
|
+
{
|
|
1728
|
+
categories: T::Hash[Symbol, T::Boolean],
|
|
1729
|
+
category_applied_input_types:
|
|
1730
|
+
T::Hash[
|
|
1731
|
+
Symbol,
|
|
1732
|
+
T::Array[
|
|
1733
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1734
|
+
]
|
|
1735
|
+
],
|
|
1736
|
+
category_scores: T::Hash[Symbol, Float],
|
|
1737
|
+
flagged: T::Boolean,
|
|
1738
|
+
model: String,
|
|
1739
|
+
type: Symbol
|
|
1740
|
+
}
|
|
1741
|
+
)
|
|
1742
|
+
end
|
|
1743
|
+
def to_hash
|
|
1744
|
+
end
|
|
1745
|
+
|
|
1746
|
+
module CategoryAppliedInputType
|
|
1747
|
+
extend OpenAI::Internal::Type::Enum
|
|
1748
|
+
|
|
1749
|
+
TaggedSymbol =
|
|
1750
|
+
T.type_alias do
|
|
1751
|
+
T.all(
|
|
1752
|
+
Symbol,
|
|
1753
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType
|
|
1754
|
+
)
|
|
1755
|
+
end
|
|
1756
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1757
|
+
|
|
1758
|
+
TEXT =
|
|
1759
|
+
T.let(
|
|
1760
|
+
:text,
|
|
1761
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1762
|
+
)
|
|
1763
|
+
IMAGE =
|
|
1764
|
+
T.let(
|
|
1765
|
+
:image,
|
|
1766
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1767
|
+
)
|
|
1768
|
+
|
|
1769
|
+
sig do
|
|
1770
|
+
override.returns(
|
|
1771
|
+
T::Array[
|
|
1772
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::ModerationResult::CategoryAppliedInputType::TaggedSymbol
|
|
1773
|
+
]
|
|
1774
|
+
)
|
|
1775
|
+
end
|
|
1776
|
+
def self.values
|
|
1777
|
+
end
|
|
1778
|
+
end
|
|
1779
|
+
end
|
|
1780
|
+
|
|
1781
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
1782
|
+
OrHash =
|
|
1783
|
+
T.type_alias do
|
|
1784
|
+
T.any(
|
|
1785
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::Error,
|
|
1786
|
+
OpenAI::Internal::AnyHash
|
|
1787
|
+
)
|
|
1788
|
+
end
|
|
1789
|
+
|
|
1790
|
+
# The error code.
|
|
1791
|
+
sig { returns(String) }
|
|
1792
|
+
attr_accessor :code
|
|
1793
|
+
|
|
1794
|
+
# The error message.
|
|
1795
|
+
sig { returns(String) }
|
|
1796
|
+
attr_accessor :message
|
|
1797
|
+
|
|
1798
|
+
# The object type, which was always `error` for moderation failures.
|
|
1799
|
+
sig { returns(Symbol) }
|
|
1800
|
+
attr_accessor :type
|
|
1801
|
+
|
|
1802
|
+
# An error produced while attempting moderation for the response input or output.
|
|
1803
|
+
sig do
|
|
1804
|
+
params(code: String, message: String, type: Symbol).returns(
|
|
1805
|
+
T.attached_class
|
|
1806
|
+
)
|
|
1807
|
+
end
|
|
1808
|
+
def self.new(
|
|
1809
|
+
# The error code.
|
|
1810
|
+
code:,
|
|
1811
|
+
# The error message.
|
|
1812
|
+
message:,
|
|
1813
|
+
# The object type, which was always `error` for moderation failures.
|
|
1814
|
+
type: :error
|
|
1815
|
+
)
|
|
1816
|
+
end
|
|
1817
|
+
|
|
1818
|
+
sig do
|
|
1819
|
+
override.returns(
|
|
1820
|
+
{ code: String, message: String, type: Symbol }
|
|
1821
|
+
)
|
|
1822
|
+
end
|
|
1823
|
+
def to_hash
|
|
1824
|
+
end
|
|
1825
|
+
end
|
|
1826
|
+
|
|
1827
|
+
sig do
|
|
1828
|
+
override.returns(
|
|
1829
|
+
T::Array[
|
|
1830
|
+
OpenAI::Beta::BetaResponse::Moderation::Output::Variants
|
|
1831
|
+
]
|
|
1832
|
+
)
|
|
1833
|
+
end
|
|
1834
|
+
def self.variants
|
|
1835
|
+
end
|
|
1836
|
+
end
|
|
1837
|
+
end
|
|
1838
|
+
|
|
1839
|
+
class PromptCacheOptions < OpenAI::Internal::Type::BaseModel
|
|
1840
|
+
OrHash =
|
|
1841
|
+
T.type_alias do
|
|
1842
|
+
T.any(
|
|
1843
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions,
|
|
1844
|
+
OpenAI::Internal::AnyHash
|
|
1845
|
+
)
|
|
1846
|
+
end
|
|
1847
|
+
|
|
1848
|
+
# Whether implicit prompt-cache breakpoints were enabled.
|
|
1849
|
+
sig do
|
|
1850
|
+
returns(
|
|
1851
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode::TaggedSymbol
|
|
1852
|
+
)
|
|
1853
|
+
end
|
|
1854
|
+
attr_accessor :mode
|
|
1855
|
+
|
|
1856
|
+
# The minimum lifetime applied to each cache breakpoint.
|
|
1857
|
+
sig do
|
|
1858
|
+
returns(
|
|
1859
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Ttl::TaggedSymbol
|
|
1860
|
+
)
|
|
1861
|
+
end
|
|
1862
|
+
attr_accessor :ttl
|
|
1863
|
+
|
|
1864
|
+
# The prompt-caching options that were applied to the response. Supported for
|
|
1865
|
+
# `gpt-5.6` and later models.
|
|
1866
|
+
sig do
|
|
1867
|
+
params(
|
|
1868
|
+
mode:
|
|
1869
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode::OrSymbol,
|
|
1870
|
+
ttl: OpenAI::Beta::BetaResponse::PromptCacheOptions::Ttl::OrSymbol
|
|
1871
|
+
).returns(T.attached_class)
|
|
1872
|
+
end
|
|
1873
|
+
def self.new(
|
|
1874
|
+
# Whether implicit prompt-cache breakpoints were enabled.
|
|
1875
|
+
mode:,
|
|
1876
|
+
# The minimum lifetime applied to each cache breakpoint.
|
|
1877
|
+
ttl:
|
|
1878
|
+
)
|
|
1879
|
+
end
|
|
1880
|
+
|
|
1881
|
+
sig do
|
|
1882
|
+
override.returns(
|
|
1883
|
+
{
|
|
1884
|
+
mode:
|
|
1885
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode::TaggedSymbol,
|
|
1886
|
+
ttl:
|
|
1887
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Ttl::TaggedSymbol
|
|
1888
|
+
}
|
|
1889
|
+
)
|
|
1890
|
+
end
|
|
1891
|
+
def to_hash
|
|
1892
|
+
end
|
|
1893
|
+
|
|
1894
|
+
# Whether implicit prompt-cache breakpoints were enabled.
|
|
1895
|
+
module Mode
|
|
1896
|
+
extend OpenAI::Internal::Type::Enum
|
|
1897
|
+
|
|
1898
|
+
TaggedSymbol =
|
|
1899
|
+
T.type_alias do
|
|
1900
|
+
T.all(
|
|
1901
|
+
Symbol,
|
|
1902
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode
|
|
1903
|
+
)
|
|
1904
|
+
end
|
|
1905
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1906
|
+
|
|
1907
|
+
IMPLICIT =
|
|
1908
|
+
T.let(
|
|
1909
|
+
:implicit,
|
|
1910
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode::TaggedSymbol
|
|
1911
|
+
)
|
|
1912
|
+
EXPLICIT =
|
|
1913
|
+
T.let(
|
|
1914
|
+
:explicit,
|
|
1915
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode::TaggedSymbol
|
|
1916
|
+
)
|
|
1917
|
+
|
|
1918
|
+
sig do
|
|
1919
|
+
override.returns(
|
|
1920
|
+
T::Array[
|
|
1921
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Mode::TaggedSymbol
|
|
1922
|
+
]
|
|
1923
|
+
)
|
|
1924
|
+
end
|
|
1925
|
+
def self.values
|
|
1926
|
+
end
|
|
1927
|
+
end
|
|
1928
|
+
|
|
1929
|
+
# The minimum lifetime applied to each cache breakpoint.
|
|
1930
|
+
module Ttl
|
|
1931
|
+
extend OpenAI::Internal::Type::Enum
|
|
1932
|
+
|
|
1933
|
+
TaggedSymbol =
|
|
1934
|
+
T.type_alias do
|
|
1935
|
+
T.all(
|
|
1936
|
+
Symbol,
|
|
1937
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Ttl
|
|
1938
|
+
)
|
|
1939
|
+
end
|
|
1940
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1941
|
+
|
|
1942
|
+
TTL_30M =
|
|
1943
|
+
T.let(
|
|
1944
|
+
:"30m",
|
|
1945
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Ttl::TaggedSymbol
|
|
1946
|
+
)
|
|
1947
|
+
|
|
1948
|
+
sig do
|
|
1949
|
+
override.returns(
|
|
1950
|
+
T::Array[
|
|
1951
|
+
OpenAI::Beta::BetaResponse::PromptCacheOptions::Ttl::TaggedSymbol
|
|
1952
|
+
]
|
|
1953
|
+
)
|
|
1954
|
+
end
|
|
1955
|
+
def self.values
|
|
1956
|
+
end
|
|
1957
|
+
end
|
|
1958
|
+
end
|
|
1959
|
+
|
|
1960
|
+
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
1961
|
+
#
|
|
1962
|
+
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
1963
|
+
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
1964
|
+
# of 24 hours.
|
|
1965
|
+
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
|
|
1966
|
+
# This field expresses a maximum retention policy, while
|
|
1967
|
+
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
1968
|
+
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
1969
|
+
# models, only `24h` is supported.
|
|
1970
|
+
#
|
|
1971
|
+
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
1972
|
+
# your organization's data retention policy:
|
|
1973
|
+
#
|
|
1974
|
+
# - Organizations without ZDR enabled default to `24h`.
|
|
1975
|
+
# - Organizations with ZDR enabled default to `in_memory` when
|
|
1976
|
+
# `prompt_cache_retention` is not specified.
|
|
1977
|
+
module PromptCacheRetention
|
|
1978
|
+
extend OpenAI::Internal::Type::Enum
|
|
1979
|
+
|
|
1980
|
+
TaggedSymbol =
|
|
1981
|
+
T.type_alias do
|
|
1982
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::PromptCacheRetention)
|
|
1983
|
+
end
|
|
1984
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1985
|
+
|
|
1986
|
+
IN_MEMORY =
|
|
1987
|
+
T.let(
|
|
1988
|
+
:in_memory,
|
|
1989
|
+
OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol
|
|
1990
|
+
)
|
|
1991
|
+
PROMPT_CACHE_RETENTION_24H =
|
|
1992
|
+
T.let(
|
|
1993
|
+
:"24h",
|
|
1994
|
+
OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol
|
|
1995
|
+
)
|
|
1996
|
+
|
|
1997
|
+
sig do
|
|
1998
|
+
override.returns(
|
|
1999
|
+
T::Array[
|
|
2000
|
+
OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol
|
|
2001
|
+
]
|
|
2002
|
+
)
|
|
2003
|
+
end
|
|
2004
|
+
def self.values
|
|
2005
|
+
end
|
|
2006
|
+
end
|
|
2007
|
+
|
|
2008
|
+
class Reasoning < OpenAI::Internal::Type::BaseModel
|
|
2009
|
+
OrHash =
|
|
2010
|
+
T.type_alias do
|
|
2011
|
+
T.any(
|
|
2012
|
+
OpenAI::Beta::BetaResponse::Reasoning,
|
|
2013
|
+
OpenAI::Internal::AnyHash
|
|
2014
|
+
)
|
|
2015
|
+
end
|
|
2016
|
+
|
|
2017
|
+
# Controls which reasoning items are rendered back to the model on later turns.
|
|
2018
|
+
# When returned on a response, this is the effective reasoning context mode used
|
|
2019
|
+
# for the response.
|
|
2020
|
+
sig do
|
|
2021
|
+
returns(
|
|
2022
|
+
T.nilable(
|
|
2023
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::TaggedSymbol
|
|
2024
|
+
)
|
|
2025
|
+
)
|
|
2026
|
+
end
|
|
2027
|
+
attr_accessor :context
|
|
2028
|
+
|
|
2029
|
+
# Constrains effort on reasoning for reasoning models. Currently supported values
|
|
2030
|
+
# are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
2031
|
+
# reasoning effort can result in faster responses and fewer tokens used on
|
|
2032
|
+
# reasoning in a response. Not all reasoning models support every value. See the
|
|
2033
|
+
# [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
|
|
2034
|
+
# model-specific support.
|
|
2035
|
+
sig do
|
|
2036
|
+
returns(
|
|
2037
|
+
T.nilable(
|
|
2038
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2039
|
+
)
|
|
2040
|
+
)
|
|
2041
|
+
end
|
|
2042
|
+
attr_accessor :effort
|
|
2043
|
+
|
|
2044
|
+
# **Deprecated:** use `summary` instead.
|
|
2045
|
+
#
|
|
2046
|
+
# A summary of the reasoning performed by the model. This can be useful for
|
|
2047
|
+
# debugging and understanding the model's reasoning process. One of `auto`,
|
|
2048
|
+
# `concise`, or `detailed`.
|
|
2049
|
+
sig do
|
|
2050
|
+
returns(
|
|
2051
|
+
T.nilable(
|
|
2052
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::TaggedSymbol
|
|
2053
|
+
)
|
|
2054
|
+
)
|
|
2055
|
+
end
|
|
2056
|
+
attr_accessor :generate_summary
|
|
2057
|
+
|
|
2058
|
+
# Controls the reasoning execution mode for the request.
|
|
2059
|
+
#
|
|
2060
|
+
# When returned on a response, this is the effective execution mode.
|
|
2061
|
+
sig do
|
|
2062
|
+
returns(
|
|
2063
|
+
T.nilable(OpenAI::Beta::BetaResponse::Reasoning::Mode::Variants)
|
|
2064
|
+
)
|
|
2065
|
+
end
|
|
2066
|
+
attr_reader :mode
|
|
2067
|
+
|
|
2068
|
+
sig do
|
|
2069
|
+
params(
|
|
2070
|
+
mode:
|
|
2071
|
+
T.any(
|
|
2072
|
+
String,
|
|
2073
|
+
OpenAI::Beta::BetaResponse::Reasoning::Mode::OrSymbol
|
|
2074
|
+
)
|
|
2075
|
+
).void
|
|
2076
|
+
end
|
|
2077
|
+
attr_writer :mode
|
|
2078
|
+
|
|
2079
|
+
# A summary of the reasoning performed by the model. This can be useful for
|
|
2080
|
+
# debugging and understanding the model's reasoning process. One of `auto`,
|
|
2081
|
+
# `concise`, or `detailed`.
|
|
2082
|
+
#
|
|
2083
|
+
# `concise` is supported for `computer-use-preview` models and all reasoning
|
|
2084
|
+
# models after `gpt-5`.
|
|
2085
|
+
sig do
|
|
2086
|
+
returns(
|
|
2087
|
+
T.nilable(
|
|
2088
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol
|
|
2089
|
+
)
|
|
2090
|
+
)
|
|
2091
|
+
end
|
|
2092
|
+
attr_accessor :summary
|
|
2093
|
+
|
|
2094
|
+
# **gpt-5 and o-series models only**
|
|
2095
|
+
#
|
|
2096
|
+
# Configuration options for
|
|
2097
|
+
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
2098
|
+
sig do
|
|
2099
|
+
params(
|
|
2100
|
+
context:
|
|
2101
|
+
T.nilable(
|
|
2102
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::OrSymbol
|
|
2103
|
+
),
|
|
2104
|
+
effort:
|
|
2105
|
+
T.nilable(
|
|
2106
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::OrSymbol
|
|
2107
|
+
),
|
|
2108
|
+
generate_summary:
|
|
2109
|
+
T.nilable(
|
|
2110
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::OrSymbol
|
|
2111
|
+
),
|
|
2112
|
+
mode:
|
|
2113
|
+
T.any(
|
|
2114
|
+
String,
|
|
2115
|
+
OpenAI::Beta::BetaResponse::Reasoning::Mode::OrSymbol
|
|
2116
|
+
),
|
|
2117
|
+
summary:
|
|
2118
|
+
T.nilable(
|
|
2119
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::OrSymbol
|
|
2120
|
+
)
|
|
2121
|
+
).returns(T.attached_class)
|
|
2122
|
+
end
|
|
2123
|
+
def self.new(
|
|
2124
|
+
# Controls which reasoning items are rendered back to the model on later turns.
|
|
2125
|
+
# When returned on a response, this is the effective reasoning context mode used
|
|
2126
|
+
# for the response.
|
|
2127
|
+
context: nil,
|
|
2128
|
+
# Constrains effort on reasoning for reasoning models. Currently supported values
|
|
2129
|
+
# are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
2130
|
+
# reasoning effort can result in faster responses and fewer tokens used on
|
|
2131
|
+
# reasoning in a response. Not all reasoning models support every value. See the
|
|
2132
|
+
# [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
|
|
2133
|
+
# model-specific support.
|
|
2134
|
+
effort: nil,
|
|
2135
|
+
# **Deprecated:** use `summary` instead.
|
|
2136
|
+
#
|
|
2137
|
+
# A summary of the reasoning performed by the model. This can be useful for
|
|
2138
|
+
# debugging and understanding the model's reasoning process. One of `auto`,
|
|
2139
|
+
# `concise`, or `detailed`.
|
|
2140
|
+
generate_summary: nil,
|
|
2141
|
+
# Controls the reasoning execution mode for the request.
|
|
2142
|
+
#
|
|
2143
|
+
# When returned on a response, this is the effective execution mode.
|
|
2144
|
+
mode: nil,
|
|
2145
|
+
# A summary of the reasoning performed by the model. This can be useful for
|
|
2146
|
+
# debugging and understanding the model's reasoning process. One of `auto`,
|
|
2147
|
+
# `concise`, or `detailed`.
|
|
2148
|
+
#
|
|
2149
|
+
# `concise` is supported for `computer-use-preview` models and all reasoning
|
|
2150
|
+
# models after `gpt-5`.
|
|
2151
|
+
summary: nil
|
|
2152
|
+
)
|
|
2153
|
+
end
|
|
2154
|
+
|
|
2155
|
+
sig do
|
|
2156
|
+
override.returns(
|
|
2157
|
+
{
|
|
2158
|
+
context:
|
|
2159
|
+
T.nilable(
|
|
2160
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::TaggedSymbol
|
|
2161
|
+
),
|
|
2162
|
+
effort:
|
|
2163
|
+
T.nilable(
|
|
2164
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2165
|
+
),
|
|
2166
|
+
generate_summary:
|
|
2167
|
+
T.nilable(
|
|
2168
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::TaggedSymbol
|
|
2169
|
+
),
|
|
2170
|
+
mode: OpenAI::Beta::BetaResponse::Reasoning::Mode::Variants,
|
|
2171
|
+
summary:
|
|
2172
|
+
T.nilable(
|
|
2173
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol
|
|
2174
|
+
)
|
|
2175
|
+
}
|
|
2176
|
+
)
|
|
2177
|
+
end
|
|
2178
|
+
def to_hash
|
|
2179
|
+
end
|
|
2180
|
+
|
|
2181
|
+
# Controls which reasoning items are rendered back to the model on later turns.
|
|
2182
|
+
# When returned on a response, this is the effective reasoning context mode used
|
|
2183
|
+
# for the response.
|
|
2184
|
+
module Context
|
|
2185
|
+
extend OpenAI::Internal::Type::Enum
|
|
2186
|
+
|
|
2187
|
+
TaggedSymbol =
|
|
2188
|
+
T.type_alias do
|
|
2189
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::Reasoning::Context)
|
|
2190
|
+
end
|
|
2191
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2192
|
+
|
|
2193
|
+
AUTO =
|
|
2194
|
+
T.let(
|
|
2195
|
+
:auto,
|
|
2196
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::TaggedSymbol
|
|
2197
|
+
)
|
|
2198
|
+
CURRENT_TURN =
|
|
2199
|
+
T.let(
|
|
2200
|
+
:current_turn,
|
|
2201
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::TaggedSymbol
|
|
2202
|
+
)
|
|
2203
|
+
ALL_TURNS =
|
|
2204
|
+
T.let(
|
|
2205
|
+
:all_turns,
|
|
2206
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::TaggedSymbol
|
|
2207
|
+
)
|
|
2208
|
+
|
|
2209
|
+
sig do
|
|
2210
|
+
override.returns(
|
|
2211
|
+
T::Array[
|
|
2212
|
+
OpenAI::Beta::BetaResponse::Reasoning::Context::TaggedSymbol
|
|
2213
|
+
]
|
|
2214
|
+
)
|
|
2215
|
+
end
|
|
2216
|
+
def self.values
|
|
2217
|
+
end
|
|
2218
|
+
end
|
|
2219
|
+
|
|
2220
|
+
# Constrains effort on reasoning for reasoning models. Currently supported values
|
|
2221
|
+
# are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
2222
|
+
# reasoning effort can result in faster responses and fewer tokens used on
|
|
2223
|
+
# reasoning in a response. Not all reasoning models support every value. See the
|
|
2224
|
+
# [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for
|
|
2225
|
+
# model-specific support.
|
|
2226
|
+
module Effort
|
|
2227
|
+
extend OpenAI::Internal::Type::Enum
|
|
2228
|
+
|
|
2229
|
+
TaggedSymbol =
|
|
2230
|
+
T.type_alias do
|
|
2231
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::Reasoning::Effort)
|
|
2232
|
+
end
|
|
2233
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2234
|
+
|
|
2235
|
+
NONE =
|
|
2236
|
+
T.let(
|
|
2237
|
+
:none,
|
|
2238
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2239
|
+
)
|
|
2240
|
+
MINIMAL =
|
|
2241
|
+
T.let(
|
|
2242
|
+
:minimal,
|
|
2243
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2244
|
+
)
|
|
2245
|
+
LOW =
|
|
2246
|
+
T.let(
|
|
2247
|
+
:low,
|
|
2248
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2249
|
+
)
|
|
2250
|
+
MEDIUM =
|
|
2251
|
+
T.let(
|
|
2252
|
+
:medium,
|
|
2253
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2254
|
+
)
|
|
2255
|
+
HIGH =
|
|
2256
|
+
T.let(
|
|
2257
|
+
:high,
|
|
2258
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2259
|
+
)
|
|
2260
|
+
XHIGH =
|
|
2261
|
+
T.let(
|
|
2262
|
+
:xhigh,
|
|
2263
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2264
|
+
)
|
|
2265
|
+
MAX =
|
|
2266
|
+
T.let(
|
|
2267
|
+
:max,
|
|
2268
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2269
|
+
)
|
|
2270
|
+
|
|
2271
|
+
sig do
|
|
2272
|
+
override.returns(
|
|
2273
|
+
T::Array[
|
|
2274
|
+
OpenAI::Beta::BetaResponse::Reasoning::Effort::TaggedSymbol
|
|
2275
|
+
]
|
|
2276
|
+
)
|
|
2277
|
+
end
|
|
2278
|
+
def self.values
|
|
2279
|
+
end
|
|
2280
|
+
end
|
|
2281
|
+
|
|
2282
|
+
# **Deprecated:** use `summary` instead.
|
|
2283
|
+
#
|
|
2284
|
+
# A summary of the reasoning performed by the model. This can be useful for
|
|
2285
|
+
# debugging and understanding the model's reasoning process. One of `auto`,
|
|
2286
|
+
# `concise`, or `detailed`.
|
|
2287
|
+
module GenerateSummary
|
|
2288
|
+
extend OpenAI::Internal::Type::Enum
|
|
2289
|
+
|
|
2290
|
+
TaggedSymbol =
|
|
2291
|
+
T.type_alias do
|
|
2292
|
+
T.all(
|
|
2293
|
+
Symbol,
|
|
2294
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary
|
|
2295
|
+
)
|
|
2296
|
+
end
|
|
2297
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2298
|
+
|
|
2299
|
+
AUTO =
|
|
2300
|
+
T.let(
|
|
2301
|
+
:auto,
|
|
2302
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::TaggedSymbol
|
|
2303
|
+
)
|
|
2304
|
+
CONCISE =
|
|
2305
|
+
T.let(
|
|
2306
|
+
:concise,
|
|
2307
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::TaggedSymbol
|
|
2308
|
+
)
|
|
2309
|
+
DETAILED =
|
|
2310
|
+
T.let(
|
|
2311
|
+
:detailed,
|
|
2312
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::TaggedSymbol
|
|
2313
|
+
)
|
|
2314
|
+
|
|
2315
|
+
sig do
|
|
2316
|
+
override.returns(
|
|
2317
|
+
T::Array[
|
|
2318
|
+
OpenAI::Beta::BetaResponse::Reasoning::GenerateSummary::TaggedSymbol
|
|
2319
|
+
]
|
|
2320
|
+
)
|
|
2321
|
+
end
|
|
2322
|
+
def self.values
|
|
2323
|
+
end
|
|
2324
|
+
end
|
|
2325
|
+
|
|
2326
|
+
# Controls the reasoning execution mode for the request.
|
|
2327
|
+
#
|
|
2328
|
+
# When returned on a response, this is the effective execution mode.
|
|
2329
|
+
module Mode
|
|
2330
|
+
extend OpenAI::Internal::Type::Union
|
|
2331
|
+
|
|
2332
|
+
Variants =
|
|
2333
|
+
T.type_alias do
|
|
2334
|
+
T.any(
|
|
2335
|
+
String,
|
|
2336
|
+
OpenAI::Beta::BetaResponse::Reasoning::Mode::TaggedSymbol
|
|
2337
|
+
)
|
|
2338
|
+
end
|
|
2339
|
+
|
|
2340
|
+
sig do
|
|
2341
|
+
override.returns(
|
|
2342
|
+
T::Array[OpenAI::Beta::BetaResponse::Reasoning::Mode::Variants]
|
|
2343
|
+
)
|
|
2344
|
+
end
|
|
2345
|
+
def self.variants
|
|
2346
|
+
end
|
|
2347
|
+
|
|
2348
|
+
TaggedSymbol =
|
|
2349
|
+
T.type_alias do
|
|
2350
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::Reasoning::Mode)
|
|
2351
|
+
end
|
|
2352
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2353
|
+
|
|
2354
|
+
STANDARD =
|
|
2355
|
+
T.let(
|
|
2356
|
+
:standard,
|
|
2357
|
+
OpenAI::Beta::BetaResponse::Reasoning::Mode::TaggedSymbol
|
|
2358
|
+
)
|
|
2359
|
+
PRO =
|
|
2360
|
+
T.let(
|
|
2361
|
+
:pro,
|
|
2362
|
+
OpenAI::Beta::BetaResponse::Reasoning::Mode::TaggedSymbol
|
|
2363
|
+
)
|
|
2364
|
+
end
|
|
2365
|
+
|
|
2366
|
+
# A summary of the reasoning performed by the model. This can be useful for
|
|
2367
|
+
# debugging and understanding the model's reasoning process. One of `auto`,
|
|
2368
|
+
# `concise`, or `detailed`.
|
|
2369
|
+
#
|
|
2370
|
+
# `concise` is supported for `computer-use-preview` models and all reasoning
|
|
2371
|
+
# models after `gpt-5`.
|
|
2372
|
+
module Summary
|
|
2373
|
+
extend OpenAI::Internal::Type::Enum
|
|
2374
|
+
|
|
2375
|
+
TaggedSymbol =
|
|
2376
|
+
T.type_alias do
|
|
2377
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::Reasoning::Summary)
|
|
2378
|
+
end
|
|
2379
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2380
|
+
|
|
2381
|
+
AUTO =
|
|
2382
|
+
T.let(
|
|
2383
|
+
:auto,
|
|
2384
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol
|
|
2385
|
+
)
|
|
2386
|
+
CONCISE =
|
|
2387
|
+
T.let(
|
|
2388
|
+
:concise,
|
|
2389
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol
|
|
2390
|
+
)
|
|
2391
|
+
DETAILED =
|
|
2392
|
+
T.let(
|
|
2393
|
+
:detailed,
|
|
2394
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol
|
|
2395
|
+
)
|
|
2396
|
+
|
|
2397
|
+
sig do
|
|
2398
|
+
override.returns(
|
|
2399
|
+
T::Array[
|
|
2400
|
+
OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol
|
|
2401
|
+
]
|
|
2402
|
+
)
|
|
2403
|
+
end
|
|
2404
|
+
def self.values
|
|
2405
|
+
end
|
|
2406
|
+
end
|
|
2407
|
+
end
|
|
2408
|
+
|
|
2409
|
+
# Specifies the processing type used for serving the request.
|
|
2410
|
+
#
|
|
2411
|
+
# - If set to 'auto', then the request will be processed with the service tier
|
|
2412
|
+
# configured in the Project settings. Unless otherwise configured, the Project
|
|
2413
|
+
# will use 'default'.
|
|
2414
|
+
# - If set to 'default', then the request will be processed with the standard
|
|
2415
|
+
# pricing and performance for the selected model.
|
|
2416
|
+
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
|
|
2417
|
+
# '[priority](https://openai.com/api-priority-processing/)', then the request
|
|
2418
|
+
# will be processed with the corresponding service tier.
|
|
2419
|
+
# - When not set, the default behavior is 'auto'.
|
|
2420
|
+
#
|
|
2421
|
+
# When the `service_tier` parameter is set, the response body will include the
|
|
2422
|
+
# `service_tier` value based on the processing mode actually used to serve the
|
|
2423
|
+
# request. This response value may be different from the value set in the
|
|
2424
|
+
# parameter.
|
|
2425
|
+
module ServiceTier
|
|
2426
|
+
extend OpenAI::Internal::Type::Enum
|
|
2427
|
+
|
|
2428
|
+
TaggedSymbol =
|
|
2429
|
+
T.type_alias do
|
|
2430
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::ServiceTier)
|
|
2431
|
+
end
|
|
2432
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2433
|
+
|
|
2434
|
+
AUTO =
|
|
2435
|
+
T.let(:auto, OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol)
|
|
2436
|
+
DEFAULT =
|
|
2437
|
+
T.let(
|
|
2438
|
+
:default,
|
|
2439
|
+
OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol
|
|
2440
|
+
)
|
|
2441
|
+
FLEX =
|
|
2442
|
+
T.let(:flex, OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol)
|
|
2443
|
+
SCALE =
|
|
2444
|
+
T.let(:scale, OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol)
|
|
2445
|
+
PRIORITY =
|
|
2446
|
+
T.let(
|
|
2447
|
+
:priority,
|
|
2448
|
+
OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol
|
|
2449
|
+
)
|
|
2450
|
+
|
|
2451
|
+
sig do
|
|
2452
|
+
override.returns(
|
|
2453
|
+
T::Array[OpenAI::Beta::BetaResponse::ServiceTier::TaggedSymbol]
|
|
2454
|
+
)
|
|
2455
|
+
end
|
|
2456
|
+
def self.values
|
|
2457
|
+
end
|
|
2458
|
+
end
|
|
2459
|
+
|
|
2460
|
+
# The truncation strategy to use for the model response.
|
|
2461
|
+
#
|
|
2462
|
+
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
2463
|
+
# the model will truncate the response to fit the context window by dropping
|
|
2464
|
+
# items from the beginning of the conversation.
|
|
2465
|
+
# - `disabled` (default): If the input size will exceed the context window size
|
|
2466
|
+
# for a model, the request will fail with a 400 error.
|
|
2467
|
+
module Truncation
|
|
2468
|
+
extend OpenAI::Internal::Type::Enum
|
|
2469
|
+
|
|
2470
|
+
TaggedSymbol =
|
|
2471
|
+
T.type_alias do
|
|
2472
|
+
T.all(Symbol, OpenAI::Beta::BetaResponse::Truncation)
|
|
2473
|
+
end
|
|
2474
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
2475
|
+
|
|
2476
|
+
AUTO =
|
|
2477
|
+
T.let(:auto, OpenAI::Beta::BetaResponse::Truncation::TaggedSymbol)
|
|
2478
|
+
DISABLED =
|
|
2479
|
+
T.let(
|
|
2480
|
+
:disabled,
|
|
2481
|
+
OpenAI::Beta::BetaResponse::Truncation::TaggedSymbol
|
|
2482
|
+
)
|
|
2483
|
+
|
|
2484
|
+
sig do
|
|
2485
|
+
override.returns(
|
|
2486
|
+
T::Array[OpenAI::Beta::BetaResponse::Truncation::TaggedSymbol]
|
|
2487
|
+
)
|
|
2488
|
+
end
|
|
2489
|
+
def self.values
|
|
2490
|
+
end
|
|
2491
|
+
end
|
|
2492
|
+
end
|
|
2493
|
+
end
|
|
2494
|
+
end
|
|
2495
|
+
end
|