openai 0.113.0 → 0.115.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 +54 -0
- data/README.md +17 -2
- data/docs/architecture/security-model.md +11 -16
- data/examples/responses/websocket_workflows.rb +78 -3
- data/lib/openai/auth/subject_token_providers/azure_managed_identity_token_provider.rb +10 -8
- data/lib/openai/auth/subject_token_providers/gcp_id_token_provider.rb +8 -7
- data/lib/openai/helpers/chat/tool_runner.rb +1 -1
- data/lib/openai/helpers/live/websocket.rb +31 -0
- data/lib/openai/helpers/realtime/connection.rb +33 -0
- data/lib/openai/helpers/realtime/connection_manager.rb +1 -0
- data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +5 -0
- data/lib/openai/helpers/realtime/recovery.rb +5 -1
- data/lib/openai/helpers/realtime/translation.rb +5 -0
- data/lib/openai/helpers/realtime/transports/async_websocket.rb +19 -0
- data/lib/openai/helpers/responses_websocket/connection.rb +53 -15
- data/lib/openai/helpers/responses_websocket/connection_manager.rb +1 -0
- data/lib/openai/helpers/responses_websocket/connection_resources.rb +1 -1
- data/lib/openai/helpers/structured_output/response_parser.rb +1 -0
- data/lib/openai/helpers/structured_output.rb +58 -0
- data/lib/openai/helpers/websocket/connection_manager.rb +11 -0
- data/lib/openai/helpers/websocket/resource.rb +1 -0
- data/lib/openai/helpers/websocket/typed_connection.rb +1 -0
- data/lib/openai/internal/type/array_of.rb +1 -1
- data/lib/openai/internal/type/hash_of.rb +1 -1
- data/lib/openai/internal/type/request_parameters.rb +2 -1
- data/lib/openai/internal/type/union.rb +18 -6
- data/lib/openai/models/admin/organization/external_key.rb +169 -0
- data/lib/openai/models/admin/organization/external_key_create_params.rb +311 -0
- data/lib/openai/models/admin/organization/external_key_delete_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_list_params.rb +69 -0
- data/lib/openai/models/admin/organization/external_key_retrieve_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_response.rb +20 -0
- data/lib/openai/models/audio/speech_model.rb +12 -0
- data/lib/openai/models/audio_model.rb +15 -0
- data/lib/openai/models/beta/agent.rb +49 -1
- data/lib/openai/models/beta/agent_create_params.rb +51 -1
- data/lib/openai/models/beta/agent_session.rb +75 -2
- data/lib/openai/models/beta/agent_update_params.rb +62 -1
- data/lib/openai/models/beta/agents/session_create_params.rb +94 -2
- data/lib/openai/models/beta/agents/session_list_params.rb +16 -1
- data/lib/openai/models/beta/agents/session_update_params.rb +50 -5
- data/lib/openai/models/beta/assistant_update_params.rb +18 -0
- data/lib/openai/models/beta/beta_response.rb +224 -1
- data/lib/openai/models/beta/beta_response_configuration_update_item.rb +64 -3
- data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +64 -4
- data/lib/openai/models/beta/beta_response_input_file.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_file_content.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_image.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_image_content.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_item.rb +2 -3
- data/lib/openai/models/beta/beta_response_input_text.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_text_content.rb +9 -9
- data/lib/openai/models/beta/beta_response_item.rb +11 -11
- data/lib/openai/models/beta/beta_response_output_item.rb +9 -9
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/beta/beta_responses_client_event.rb +20 -1
- data/lib/openai/models/beta/beta_tool.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +6 -0
- data/lib/openai/models/beta/response_create_params.rb +6 -0
- data/lib/openai/models/chat/chat_completion_content_part.rb +9 -9
- data/lib/openai/models/chat/chat_completion_content_part_image.rb +9 -9
- data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +9 -9
- data/lib/openai/models/chat/chat_completion_content_part_text.rb +9 -9
- data/lib/openai/models/chat_model.rb +6 -0
- data/lib/openai/models/conversations/computer_screenshot_content.rb +9 -9
- data/lib/openai/models/conversations/conversation_item.rb +2 -2
- data/lib/openai/models/image_edit_params.rb +46 -25
- data/lib/openai/models/live/fork_server_event.rb +43 -3
- data/lib/openai/models/live/server_event.rb +43 -3
- data/lib/openai/models/live/sideband_client_event.rb +40 -1
- data/lib/openai/models/live/sideband_server_event.rb +43 -3
- data/lib/openai/models/realtime/audio_transcription.rb +15 -0
- data/lib/openai/models/realtime/conversation_item_added.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_create_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_created_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_done.rb +2 -2
- data/lib/openai/models/realtime/realtime_response.rb +2 -2
- data/lib/openai/models/realtime/realtime_response_create_params.rb +2 -2
- data/lib/openai/models/realtime/realtime_server_event.rb +2 -2
- data/lib/openai/models/realtime/realtime_session.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +18 -0
- data/lib/openai/models/realtime/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/realtime/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/response.rb +221 -1
- data/lib/openai/models/responses/response_compact_params.rb +6 -0
- data/lib/openai/models/responses/response_configuration_update_item.rb +50 -3
- data/lib/openai/models/responses/response_configuration_update_item_param.rb +50 -4
- data/lib/openai/models/responses/response_input_file.rb +9 -9
- data/lib/openai/models/responses/response_input_file_content.rb +9 -9
- data/lib/openai/models/responses/response_input_image.rb +9 -9
- data/lib/openai/models/responses/response_input_image_content.rb +9 -9
- data/lib/openai/models/responses/response_input_item.rb +2 -3
- data/lib/openai/models/responses/response_input_text.rb +9 -9
- data/lib/openai/models/responses/response_input_text_content.rb +9 -9
- data/lib/openai/models/responses/response_item.rb +2 -2
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/responses/responses_client_event.rb +14 -1
- data/lib/openai/models/responses/tool.rb +6 -6
- data/lib/openai/net_http_client.rb +6 -0
- data/lib/openai/providers/vertex.rb +0 -10
- data/lib/openai/resources/admin/organization/external_keys.rb +132 -0
- data/lib/openai/resources/admin/organization.rb +4 -0
- data/lib/openai/resources/audio/speech.rb +8 -0
- data/lib/openai/resources/audio/translations.rb +8 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -6
- data/lib/openai/resources/beta/agents.rb +17 -2
- data/lib/openai/resources/images.rb +36 -18
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/helpers/live/websocket.rbi +1 -12
- data/rbi/openai/helpers/realtime/connection.rbi +5 -0
- data/rbi/openai/helpers/realtime/transports/async_websocket.rbi +5 -0
- data/rbi/openai/helpers/responses_websocket/connection.rbi +7 -2
- data/rbi/openai/helpers/structured_output.rbi +10 -0
- data/rbi/openai/internal/type/array_of.rbi +1 -1
- data/rbi/openai/internal/type/hash_of.rbi +1 -1
- data/rbi/openai/internal/type/union.rbi +5 -0
- data/rbi/openai/models/admin/organization/external_key.rbi +301 -0
- data/rbi/openai/models/admin/organization/external_key_create_params.rbi +532 -0
- data/rbi/openai/models/admin/organization/external_key_delete_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_list_params.rbi +129 -0
- data/rbi/openai/models/admin/organization/external_key_retrieve_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_response.rbi +50 -0
- data/rbi/openai/models/beta/agent.rbi +103 -1
- data/rbi/openai/models/beta/agent_create_params.rbi +109 -0
- data/rbi/openai/models/beta/agent_session.rbi +136 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +120 -0
- data/rbi/openai/models/beta/agents/session_create_params.rbi +153 -0
- data/rbi/openai/models/beta/agents/session_list_params.rbi +19 -0
- data/rbi/openai/models/beta/agents/session_update_params.rbi +94 -6
- data/rbi/openai/models/beta/beta_response.rbi +394 -0
- data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +113 -3
- data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +125 -4
- data/rbi/openai/models/beta/beta_response_input_file.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_file_content.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_image.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_image_content.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_text.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_text_content.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_item.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_output_item.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +17 -0
- data/rbi/openai/models/beta/beta_tool.rbi +6 -6
- data/rbi/openai/models/chat/chat_completion_content_part.rbi +9 -9
- data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +9 -9
- data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +9 -9
- data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +9 -9
- data/rbi/openai/models/conversations/computer_screenshot_content.rbi +9 -9
- data/rbi/openai/models/decision_create_params.rbi +4 -1
- data/rbi/openai/models/image_edit_params.rbi +49 -24
- data/rbi/openai/models/live/fork_server_event.rbi +65 -1
- data/rbi/openai/models/live/server_event.rbi +65 -1
- data/rbi/openai/models/live/sideband_client_event.rbi +60 -0
- data/rbi/openai/models/live/sideband_server_event.rbi +65 -1
- data/rbi/openai/models/realtime/conversation_item_added.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_created_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_done.rbi +6 -3
- data/rbi/openai/models/realtime/realtime_response.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_added_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_done_event.rbi +6 -3
- data/rbi/openai/models/responses/response.rbi +394 -0
- data/rbi/openai/models/responses/response_configuration_update_item.rbi +76 -3
- data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +74 -4
- data/rbi/openai/models/responses/response_input_file.rbi +9 -9
- data/rbi/openai/models/responses/response_input_file_content.rbi +9 -9
- data/rbi/openai/models/responses/response_input_image.rbi +9 -9
- data/rbi/openai/models/responses/response_input_image_content.rbi +9 -9
- data/rbi/openai/models/responses/response_input_text.rbi +9 -9
- data/rbi/openai/models/responses/response_input_text_content.rbi +9 -9
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/responses/responses_client_event.rbi +17 -0
- data/rbi/openai/models/responses/tool.rbi +6 -6
- data/rbi/openai/net_http_client.rbi +5 -0
- data/rbi/openai/resources/admin/organization/external_keys.rbi +86 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -0
- data/rbi/openai/resources/audio/speech.rbi +8 -0
- data/rbi/openai/resources/audio/translations.rbi +6 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +18 -2
- data/rbi/openai/resources/beta/agents.rbi +15 -0
- data/rbi/openai/resources/images.rbi +34 -16
- data/rbi/openai/resources/responses.rbi +2 -0
- data/realtime.md +6 -0
- data/responses-websocket.md +53 -0
- data/sig/openai/helpers/live/websocket.rbs +1 -9
- data/sig/openai/helpers/realtime/connection.rbs +3 -0
- data/sig/openai/helpers/realtime/transports/async_websocket.rbs +3 -0
- data/sig/openai/helpers/responses_websocket/connection.rbs +7 -1
- data/sig/openai/helpers/structured_output.rbs +9 -0
- data/sig/openai/internal/type/union.rbs +4 -0
- data/sig/openai/models/admin/organization/external_key.rbs +186 -0
- data/sig/openai/models/admin/organization/external_key_create_params.rbs +423 -0
- data/sig/openai/models/admin/organization/external_key_delete_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_list_params.rbs +81 -0
- data/sig/openai/models/admin/organization/external_key_retrieve_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_response.rbs +17 -0
- data/sig/openai/models/admin/organization/external_storage_create_params.rbs +72 -2
- data/sig/openai/models/audio/speech_create_params.rbs +15 -2
- data/sig/openai/models/audio/transcription_create_params.rbs +30 -2
- data/sig/openai/models/audio/voice_create_params.rbs +47 -2
- data/sig/openai/models/beta/agent.rbs +54 -2
- data/sig/openai/models/beta/agent_create_params.rbs +54 -0
- data/sig/openai/models/beta/agent_session.rbs +82 -3
- data/sig/openai/models/beta/agent_update_params.rbs +64 -0
- data/sig/openai/models/beta/agents/session_create_params.rbs +91 -0
- data/sig/openai/models/beta/agents/session_list_params.rbs +20 -0
- data/sig/openai/models/beta/agents/session_update_params.rbs +48 -6
- data/sig/openai/models/beta/assistant_create_params.rbs +5 -2
- data/sig/openai/models/beta/beta_response.rbs +223 -0
- data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +58 -2
- data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +58 -2
- data/sig/openai/models/beta/beta_response_input_file.rbs +9 -9
- data/sig/openai/models/beta/beta_response_input_file_content.rbs +6 -6
- data/sig/openai/models/beta/beta_response_input_image.rbs +9 -9
- data/sig/openai/models/beta/beta_response_input_image_content.rbs +6 -6
- data/sig/openai/models/beta/beta_response_input_text.rbs +9 -9
- data/sig/openai/models/beta/beta_response_input_text_content.rbs +6 -6
- data/sig/openai/models/beta/beta_response_item.rbs +9 -9
- data/sig/openai/models/beta/beta_response_output_item.rbs +9 -9
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/beta/beta_responses_client_event.rbs +17 -0
- data/sig/openai/models/beta/beta_tool.rbs +4 -4
- data/sig/openai/models/beta/response_create_params.rbs +5 -2
- data/sig/openai/models/beta/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/beta/thread_create_and_run_params.rbs +11 -5
- data/sig/openai/models/beta/thread_create_params.rbs +11 -5
- data/sig/openai/models/beta/threads/message_create_params.rbs +6 -3
- data/sig/openai/models/beta/threads/run_create_params.rbs +6 -3
- data/sig/openai/models/chat/chat_completion_content_part.rbs +9 -9
- data/sig/openai/models/chat/chat_completion_content_part_image.rbs +9 -9
- data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +9 -9
- data/sig/openai/models/chat/chat_completion_content_part_text.rbs +9 -9
- data/sig/openai/models/conversations/computer_screenshot_content.rbs +9 -9
- data/sig/openai/models/decision_create_params.rbs +27 -2
- data/sig/openai/models/eval_create_params.rbs +25 -4
- data/sig/openai/models/evals/run_create_params.rbs +52 -8
- data/sig/openai/models/image_edit_params.rbs +47 -16
- data/sig/openai/models/live/fork_server_event.rbs +39 -0
- data/sig/openai/models/live/server_event.rbs +39 -0
- data/sig/openai/models/live/session_accept_params.rbs +39 -2
- data/sig/openai/models/live/sideband_client_event.rbs +32 -0
- data/sig/openai/models/live/sideband_server_event.rbs +39 -0
- data/sig/openai/models/realtime/conversation_item.rbs +1 -0
- data/sig/openai/models/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/responses/response.rbs +223 -0
- data/sig/openai/models/responses/response_configuration_update_item.rbs +45 -2
- data/sig/openai/models/responses/response_configuration_update_item_param.rbs +45 -2
- data/sig/openai/models/responses/response_create_params.rbs +5 -2
- data/sig/openai/models/responses/response_input_file.rbs +9 -9
- data/sig/openai/models/responses/response_input_file_content.rbs +6 -6
- data/sig/openai/models/responses/response_input_image.rbs +9 -9
- data/sig/openai/models/responses/response_input_image_content.rbs +6 -6
- data/sig/openai/models/responses/response_input_text.rbs +9 -9
- data/sig/openai/models/responses/response_input_text_content.rbs +6 -6
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/responses/responses_client_event.rbs +17 -0
- data/sig/openai/models/responses/tool.rbs +4 -4
- data/sig/openai/models/video_edit_params.rbs +11 -2
- data/sig/openai/models/video_extend_params.rbs +11 -2
- data/sig/openai/net_http_client.rbs +3 -0
- data/sig/openai/resources/admin/organization/external_keys.rbs +70 -0
- data/sig/openai/resources/admin/organization/external_storage.rbs +23 -1
- data/sig/openai/resources/admin/organization.rbs +2 -0
- data/sig/openai/resources/audio/speech.rbs +2 -1
- data/sig/openai/resources/audio/transcriptions.rbs +14 -2
- data/sig/openai/resources/audio/voices.rbs +14 -1
- data/sig/openai/resources/beta/agents/sessions.rbs +4 -0
- data/sig/openai/resources/beta/agents.rbs +4 -0
- data/sig/openai/resources/beta/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/beta/responses.rbs +4 -2
- data/sig/openai/resources/decisions.rbs +7 -1
- data/sig/openai/resources/images.rbs +2 -0
- data/sig/openai/resources/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/responses.rbs +5 -2
- data/sig/openai/resources/videos.rbs +2 -2
- metadata +25 -1
|
@@ -319,6 +319,23 @@ module OpenAI
|
|
|
319
319
|
# @return [OpenAI::Models::Beta::BetaResponseTextConfig, nil]
|
|
320
320
|
optional :text, -> { OpenAI::Beta::BetaResponseTextConfig }
|
|
321
321
|
|
|
322
|
+
# @!attribute tool_usage
|
|
323
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
324
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
325
|
+
# recorded usage have zero counts.
|
|
326
|
+
#
|
|
327
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
328
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
329
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
330
|
+
# is unknown.
|
|
331
|
+
#
|
|
332
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
333
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
334
|
+
# final charges.
|
|
335
|
+
#
|
|
336
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage, nil]
|
|
337
|
+
optional :tool_usage, -> { OpenAI::Beta::BetaResponse::ToolUsage }
|
|
338
|
+
|
|
322
339
|
# @!attribute top_logprobs
|
|
323
340
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
324
341
|
# to return at each token position, each with an associated log probability. In
|
|
@@ -358,7 +375,7 @@ module OpenAI
|
|
|
358
375
|
# @return [String, nil]
|
|
359
376
|
optional :user, String
|
|
360
377
|
|
|
361
|
-
# @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
|
|
378
|
+
# @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, tool_usage: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
|
|
362
379
|
# @param id [String]
|
|
363
380
|
# Unique identifier for this Response.
|
|
364
381
|
#
|
|
@@ -566,6 +583,20 @@ module OpenAI
|
|
|
566
583
|
# - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
|
|
567
584
|
# - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
|
|
568
585
|
#
|
|
586
|
+
# @param tool_usage [OpenAI::Models::Beta::BetaResponse::ToolUsage]
|
|
587
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
588
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
589
|
+
# recorded usage have zero counts.
|
|
590
|
+
#
|
|
591
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
592
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
593
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
594
|
+
# is unknown.
|
|
595
|
+
#
|
|
596
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
597
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
598
|
+
# final charges.
|
|
599
|
+
#
|
|
569
600
|
# @param top_logprobs [Integer, nil]
|
|
570
601
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
571
602
|
# to return at each token position, each with an associated log probability. In
|
|
@@ -942,6 +973,9 @@ module OpenAI
|
|
|
942
973
|
# replacements.
|
|
943
974
|
GPT_5_4_NANO = :"gpt-5.4-nano"
|
|
944
975
|
GPT_5_4_MINI_2026_03_17 = :"gpt-5.4-mini-2026-03-17"
|
|
976
|
+
# @deprecated Announced shutdown date: 2027-04-01. See
|
|
977
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
978
|
+
# replacements.
|
|
945
979
|
GPT_5_4_NANO_2026_03_17 = :"gpt-5.4-nano-2026-03-17"
|
|
946
980
|
# @deprecated Announced shutdown date: 2026-08-10. See
|
|
947
981
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -959,6 +993,9 @@ module OpenAI
|
|
|
959
993
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
960
994
|
# replacements.
|
|
961
995
|
GPT_5_1 = :"gpt-5.1"
|
|
996
|
+
# @deprecated Announced shutdown date: 2027-04-01. See
|
|
997
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
998
|
+
# replacements.
|
|
962
999
|
GPT_5_1_2025_11_13 = :"gpt-5.1-2025-11-13"
|
|
963
1000
|
# @deprecated Announced shutdown date: 2026-07-23. See
|
|
964
1001
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -2108,6 +2145,192 @@ module OpenAI
|
|
|
2108
2145
|
# @return [Array<Symbol>]
|
|
2109
2146
|
end
|
|
2110
2147
|
|
|
2148
|
+
# @see OpenAI::Models::Beta::BetaResponse#tool_usage
|
|
2149
|
+
class ToolUsage < OpenAI::Internal::Type::BaseModel
|
|
2150
|
+
# @!attribute image_gen
|
|
2151
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
2152
|
+
#
|
|
2153
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen]
|
|
2154
|
+
required :image_gen, -> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen }
|
|
2155
|
+
|
|
2156
|
+
# @!attribute web_search
|
|
2157
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
2158
|
+
#
|
|
2159
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::WebSearch]
|
|
2160
|
+
required :web_search, -> { OpenAI::Beta::BetaResponse::ToolUsage::WebSearch }
|
|
2161
|
+
|
|
2162
|
+
# @!method initialize(image_gen:, web_search:)
|
|
2163
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
2164
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
2165
|
+
# recorded usage have zero counts.
|
|
2166
|
+
#
|
|
2167
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
2168
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
2169
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
2170
|
+
# is unknown.
|
|
2171
|
+
#
|
|
2172
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
2173
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
2174
|
+
# final charges.
|
|
2175
|
+
#
|
|
2176
|
+
# @param image_gen [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen]
|
|
2177
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
2178
|
+
#
|
|
2179
|
+
# @param web_search [OpenAI::Models::Beta::BetaResponse::ToolUsage::WebSearch]
|
|
2180
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
2181
|
+
|
|
2182
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage#image_gen
|
|
2183
|
+
class ImageGen < OpenAI::Internal::Type::BaseModel
|
|
2184
|
+
# @!attribute input_tokens
|
|
2185
|
+
# The number of tokens (images and text) in the input prompt.
|
|
2186
|
+
#
|
|
2187
|
+
# @return [Integer]
|
|
2188
|
+
required :input_tokens, Integer
|
|
2189
|
+
|
|
2190
|
+
# @!attribute input_tokens_details
|
|
2191
|
+
# The input tokens detailed information for the image generation.
|
|
2192
|
+
#
|
|
2193
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails]
|
|
2194
|
+
required :input_tokens_details, -> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails }
|
|
2195
|
+
|
|
2196
|
+
# @!attribute output_tokens
|
|
2197
|
+
# The number of output tokens generated by the model.
|
|
2198
|
+
#
|
|
2199
|
+
# @return [Integer]
|
|
2200
|
+
required :output_tokens, Integer
|
|
2201
|
+
|
|
2202
|
+
# @!attribute total_tokens
|
|
2203
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
2204
|
+
#
|
|
2205
|
+
# @return [Integer]
|
|
2206
|
+
required :total_tokens, Integer
|
|
2207
|
+
|
|
2208
|
+
# @!attribute cached_tokens
|
|
2209
|
+
#
|
|
2210
|
+
# @return [Integer, nil]
|
|
2211
|
+
optional :cached_tokens, Integer
|
|
2212
|
+
|
|
2213
|
+
# @!attribute cached_tokens_details
|
|
2214
|
+
#
|
|
2215
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails, nil]
|
|
2216
|
+
optional(
|
|
2217
|
+
:cached_tokens_details,
|
|
2218
|
+
-> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails }
|
|
2219
|
+
)
|
|
2220
|
+
|
|
2221
|
+
# @!attribute output_tokens_details
|
|
2222
|
+
# The output token details for the image generation.
|
|
2223
|
+
#
|
|
2224
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails, nil]
|
|
2225
|
+
optional(
|
|
2226
|
+
:output_tokens_details,
|
|
2227
|
+
-> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails }
|
|
2228
|
+
)
|
|
2229
|
+
|
|
2230
|
+
# @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:, cached_tokens: nil, cached_tokens_details: nil, output_tokens_details: nil)
|
|
2231
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
2232
|
+
#
|
|
2233
|
+
# @param input_tokens [Integer]
|
|
2234
|
+
# The number of tokens (images and text) in the input prompt.
|
|
2235
|
+
#
|
|
2236
|
+
# @param input_tokens_details [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails]
|
|
2237
|
+
# The input tokens detailed information for the image generation.
|
|
2238
|
+
#
|
|
2239
|
+
# @param output_tokens [Integer]
|
|
2240
|
+
# The number of output tokens generated by the model.
|
|
2241
|
+
#
|
|
2242
|
+
# @param total_tokens [Integer]
|
|
2243
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
2244
|
+
#
|
|
2245
|
+
# @param cached_tokens [Integer]
|
|
2246
|
+
#
|
|
2247
|
+
# @param cached_tokens_details [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails]
|
|
2248
|
+
#
|
|
2249
|
+
# @param output_tokens_details [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails]
|
|
2250
|
+
# The output token details for the image generation.
|
|
2251
|
+
|
|
2252
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen#input_tokens_details
|
|
2253
|
+
class InputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
2254
|
+
# @!attribute image_tokens
|
|
2255
|
+
# The number of image tokens in the input prompt.
|
|
2256
|
+
#
|
|
2257
|
+
# @return [Integer]
|
|
2258
|
+
required :image_tokens, Integer
|
|
2259
|
+
|
|
2260
|
+
# @!attribute text_tokens
|
|
2261
|
+
# The number of text tokens in the input prompt.
|
|
2262
|
+
#
|
|
2263
|
+
# @return [Integer]
|
|
2264
|
+
required :text_tokens, Integer
|
|
2265
|
+
|
|
2266
|
+
# @!method initialize(image_tokens:, text_tokens:)
|
|
2267
|
+
# The input tokens detailed information for the image generation.
|
|
2268
|
+
#
|
|
2269
|
+
# @param image_tokens [Integer]
|
|
2270
|
+
# The number of image tokens in the input prompt.
|
|
2271
|
+
#
|
|
2272
|
+
# @param text_tokens [Integer]
|
|
2273
|
+
# The number of text tokens in the input prompt.
|
|
2274
|
+
end
|
|
2275
|
+
|
|
2276
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen#cached_tokens_details
|
|
2277
|
+
class CachedTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
2278
|
+
# @!attribute cached_image_tokens
|
|
2279
|
+
#
|
|
2280
|
+
# @return [Integer]
|
|
2281
|
+
required :cached_image_tokens, Integer
|
|
2282
|
+
|
|
2283
|
+
# @!attribute cached_text_tokens
|
|
2284
|
+
#
|
|
2285
|
+
# @return [Integer]
|
|
2286
|
+
required :cached_text_tokens, Integer
|
|
2287
|
+
|
|
2288
|
+
# @!method initialize(cached_image_tokens:, cached_text_tokens:)
|
|
2289
|
+
# @param cached_image_tokens [Integer]
|
|
2290
|
+
# @param cached_text_tokens [Integer]
|
|
2291
|
+
end
|
|
2292
|
+
|
|
2293
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen#output_tokens_details
|
|
2294
|
+
class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
2295
|
+
# @!attribute image_tokens
|
|
2296
|
+
# The number of image output tokens generated by the model.
|
|
2297
|
+
#
|
|
2298
|
+
# @return [Integer]
|
|
2299
|
+
required :image_tokens, Integer
|
|
2300
|
+
|
|
2301
|
+
# @!attribute text_tokens
|
|
2302
|
+
# The number of text output tokens generated by the model.
|
|
2303
|
+
#
|
|
2304
|
+
# @return [Integer]
|
|
2305
|
+
required :text_tokens, Integer
|
|
2306
|
+
|
|
2307
|
+
# @!method initialize(image_tokens:, text_tokens:)
|
|
2308
|
+
# The output token details for the image generation.
|
|
2309
|
+
#
|
|
2310
|
+
# @param image_tokens [Integer]
|
|
2311
|
+
# The number of image output tokens generated by the model.
|
|
2312
|
+
#
|
|
2313
|
+
# @param text_tokens [Integer]
|
|
2314
|
+
# The number of text output tokens generated by the model.
|
|
2315
|
+
end
|
|
2316
|
+
end
|
|
2317
|
+
|
|
2318
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage#web_search
|
|
2319
|
+
class WebSearch < OpenAI::Internal::Type::BaseModel
|
|
2320
|
+
# @!attribute num_requests
|
|
2321
|
+
# The number of billable web search requests issued.
|
|
2322
|
+
#
|
|
2323
|
+
# @return [Integer]
|
|
2324
|
+
required :num_requests, Integer
|
|
2325
|
+
|
|
2326
|
+
# @!method initialize(num_requests:)
|
|
2327
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
2328
|
+
#
|
|
2329
|
+
# @param num_requests [Integer]
|
|
2330
|
+
# The number of billable web search requests issued.
|
|
2331
|
+
end
|
|
2332
|
+
end
|
|
2333
|
+
|
|
2111
2334
|
# The truncation strategy to use for the model response.
|
|
2112
2335
|
#
|
|
2113
2336
|
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
@@ -28,9 +28,15 @@ module OpenAI
|
|
|
28
28
|
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Reasoning, nil]
|
|
29
29
|
optional :reasoning, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning }
|
|
30
30
|
|
|
31
|
-
# @!
|
|
32
|
-
#
|
|
33
|
-
#
|
|
31
|
+
# @!attribute text
|
|
32
|
+
# The text output configuration for subsequent responses.
|
|
33
|
+
#
|
|
34
|
+
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text, nil]
|
|
35
|
+
optional :text, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text }
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, agent: nil, reasoning: nil, text: nil, type: :configuration_update)
|
|
38
|
+
# A configuration update for subsequent responses. Each setting stays in effect
|
|
39
|
+
# until a later update replaces that setting.
|
|
34
40
|
#
|
|
35
41
|
# @param id [String]
|
|
36
42
|
# The unique ID of the configuration update item.
|
|
@@ -41,6 +47,9 @@ module OpenAI
|
|
|
41
47
|
# @param reasoning [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Reasoning]
|
|
42
48
|
# The reasoning configuration applied by this update.
|
|
43
49
|
#
|
|
50
|
+
# @param text [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text]
|
|
51
|
+
# The text output configuration for subsequent responses.
|
|
52
|
+
#
|
|
44
53
|
# @param type [Symbol, :configuration_update]
|
|
45
54
|
# The item type. Always `configuration_update`.
|
|
46
55
|
|
|
@@ -98,6 +107,58 @@ module OpenAI
|
|
|
98
107
|
# @return [Array<Symbol>]
|
|
99
108
|
end
|
|
100
109
|
end
|
|
110
|
+
|
|
111
|
+
# @see OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem#text
|
|
112
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
113
|
+
# @!attribute format_
|
|
114
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
115
|
+
#
|
|
116
|
+
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig]
|
|
117
|
+
required(
|
|
118
|
+
:format_,
|
|
119
|
+
union: -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text::Format },
|
|
120
|
+
api_name: :format
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# @!method initialize(format_:)
|
|
124
|
+
# The text output configuration for subsequent responses.
|
|
125
|
+
#
|
|
126
|
+
# @param format_ [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig]
|
|
127
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
128
|
+
|
|
129
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
130
|
+
#
|
|
131
|
+
# @see OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text#format_
|
|
132
|
+
module Format
|
|
133
|
+
extend OpenAI::Internal::Type::Union
|
|
134
|
+
|
|
135
|
+
discriminator :type
|
|
136
|
+
|
|
137
|
+
# Default response format. Used to generate text responses.
|
|
138
|
+
variant :text, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text }
|
|
139
|
+
|
|
140
|
+
# JSON Schema response format. Used to generate structured JSON responses.
|
|
141
|
+
# Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
142
|
+
variant :json_schema, -> { OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig }
|
|
143
|
+
|
|
144
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
145
|
+
# @!attribute type
|
|
146
|
+
# The type of response format being defined. Always `text`.
|
|
147
|
+
#
|
|
148
|
+
# @return [Symbol, :text]
|
|
149
|
+
required :type, const: :text
|
|
150
|
+
|
|
151
|
+
# @!method initialize(type: :text)
|
|
152
|
+
# Default response format. Used to generate text responses.
|
|
153
|
+
#
|
|
154
|
+
# @param type [Symbol, :text]
|
|
155
|
+
# The type of response format being defined. Always `text`.
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @!method self.variants
|
|
159
|
+
# @return [Array(OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig)]
|
|
160
|
+
end
|
|
161
|
+
end
|
|
101
162
|
end
|
|
102
163
|
end
|
|
103
164
|
|
|
@@ -28,10 +28,15 @@ module OpenAI
|
|
|
28
28
|
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning, nil]
|
|
29
29
|
optional :reasoning, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning }
|
|
30
30
|
|
|
31
|
-
# @!
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
31
|
+
# @!attribute text
|
|
32
|
+
# The text output configuration for subsequent responses.
|
|
33
|
+
#
|
|
34
|
+
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text, nil]
|
|
35
|
+
optional :text, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text }
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id: nil, agent: nil, reasoning: nil, text: nil, type: :configuration_update)
|
|
38
|
+
# An update to the conversation's response configuration. Supply reasoning, text,
|
|
39
|
+
# or both. Each setting stays in effect until a later update replaces it.
|
|
35
40
|
#
|
|
36
41
|
# @param id [String, nil]
|
|
37
42
|
# The unique ID of the configuration update item.
|
|
@@ -42,6 +47,9 @@ module OpenAI
|
|
|
42
47
|
# @param reasoning [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning]
|
|
43
48
|
# Updates to reasoning configuration. Only effort is supported.
|
|
44
49
|
#
|
|
50
|
+
# @param text [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text]
|
|
51
|
+
# The text output configuration for subsequent responses.
|
|
52
|
+
#
|
|
45
53
|
# @param type [Symbol, :configuration_update]
|
|
46
54
|
# The item type. Always `configuration_update`.
|
|
47
55
|
|
|
@@ -99,6 +107,58 @@ module OpenAI
|
|
|
99
107
|
# @return [Array<Symbol>]
|
|
100
108
|
end
|
|
101
109
|
end
|
|
110
|
+
|
|
111
|
+
# @see OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam#text
|
|
112
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
113
|
+
# @!attribute format_
|
|
114
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
115
|
+
#
|
|
116
|
+
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig]
|
|
117
|
+
required(
|
|
118
|
+
:format_,
|
|
119
|
+
union: -> { OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format },
|
|
120
|
+
api_name: :format
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# @!method initialize(format_:)
|
|
124
|
+
# The text output configuration for subsequent responses.
|
|
125
|
+
#
|
|
126
|
+
# @param format_ [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig]
|
|
127
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
128
|
+
|
|
129
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
130
|
+
#
|
|
131
|
+
# @see OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text#format_
|
|
132
|
+
module Format
|
|
133
|
+
extend OpenAI::Internal::Type::Union
|
|
134
|
+
|
|
135
|
+
discriminator :type
|
|
136
|
+
|
|
137
|
+
# Default response format. Used to generate text responses.
|
|
138
|
+
variant :text, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format::Text }
|
|
139
|
+
|
|
140
|
+
# JSON Schema response format. Used to generate structured JSON responses.
|
|
141
|
+
# Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
142
|
+
variant :json_schema, -> { OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig }
|
|
143
|
+
|
|
144
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
145
|
+
# @!attribute type
|
|
146
|
+
# The type of response format being defined. Always `text`.
|
|
147
|
+
#
|
|
148
|
+
# @return [Symbol, :text]
|
|
149
|
+
required :type, const: :text
|
|
150
|
+
|
|
151
|
+
# @!method initialize(type: :text)
|
|
152
|
+
# Default response format. Used to generate text responses.
|
|
153
|
+
#
|
|
154
|
+
# @param type [Symbol, :text]
|
|
155
|
+
# The type of response format being defined. Always `text`.
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @!method self.variants
|
|
159
|
+
# @return [Array(OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig)]
|
|
160
|
+
end
|
|
161
|
+
end
|
|
102
162
|
end
|
|
103
163
|
end
|
|
104
164
|
|
|
@@ -45,9 +45,9 @@ module OpenAI
|
|
|
45
45
|
optional :filename, String
|
|
46
46
|
|
|
47
47
|
# @!attribute prompt_cache_breakpoint
|
|
48
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
49
|
-
#
|
|
50
|
-
# token block.
|
|
48
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
49
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
50
|
+
# not rounded to a token block.
|
|
51
51
|
#
|
|
52
52
|
# @return [OpenAI::Models::Beta::BetaResponseInputFile::PromptCacheBreakpoint, nil]
|
|
53
53
|
optional :prompt_cache_breakpoint, -> { OpenAI::Beta::BetaResponseInputFile::PromptCacheBreakpoint }
|
|
@@ -75,9 +75,9 @@ module OpenAI
|
|
|
75
75
|
# The name of the file to be sent to the model.
|
|
76
76
|
#
|
|
77
77
|
# @param prompt_cache_breakpoint [OpenAI::Models::Beta::BetaResponseInputFile::PromptCacheBreakpoint]
|
|
78
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
79
|
-
#
|
|
80
|
-
# token block.
|
|
78
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
79
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
80
|
+
# not rounded to a token block.
|
|
81
81
|
#
|
|
82
82
|
# @param type [Symbol, :input_file]
|
|
83
83
|
# The type of the input item. Always `input_file`.
|
|
@@ -115,9 +115,9 @@ module OpenAI
|
|
|
115
115
|
optional :ttl, enum: -> { OpenAI::Beta::BetaResponseInputFile::PromptCacheBreakpoint::Ttl }
|
|
116
116
|
|
|
117
117
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
118
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
119
|
-
#
|
|
120
|
-
# token block.
|
|
118
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
119
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
120
|
+
# not rounded to a token block.
|
|
121
121
|
#
|
|
122
122
|
# @param ttl [Symbol, OpenAI::Models::Beta::BetaResponseInputFile::PromptCacheBreakpoint::Ttl]
|
|
123
123
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -45,9 +45,9 @@ module OpenAI
|
|
|
45
45
|
optional :filename, String, nil?: true
|
|
46
46
|
|
|
47
47
|
# @!attribute prompt_cache_breakpoint
|
|
48
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
49
|
-
#
|
|
50
|
-
# token block.
|
|
48
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
49
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
50
|
+
# not rounded to a token block.
|
|
51
51
|
#
|
|
52
52
|
# @return [OpenAI::Models::Beta::BetaResponseInputFileContent::PromptCacheBreakpoint, nil]
|
|
53
53
|
optional(
|
|
@@ -79,9 +79,9 @@ module OpenAI
|
|
|
79
79
|
# The name of the file to be sent to the model.
|
|
80
80
|
#
|
|
81
81
|
# @param prompt_cache_breakpoint [OpenAI::Models::Beta::BetaResponseInputFileContent::PromptCacheBreakpoint, nil]
|
|
82
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
83
|
-
#
|
|
84
|
-
# token block.
|
|
82
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
83
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
84
|
+
# not rounded to a token block.
|
|
85
85
|
#
|
|
86
86
|
# @param type [Symbol, :input_file]
|
|
87
87
|
# The type of the input item. Always `input_file`.
|
|
@@ -119,9 +119,9 @@ module OpenAI
|
|
|
119
119
|
optional :ttl, enum: -> { OpenAI::Beta::BetaResponseInputFileContent::PromptCacheBreakpoint::Ttl }
|
|
120
120
|
|
|
121
121
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
122
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
123
|
-
#
|
|
124
|
-
# token block.
|
|
122
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
123
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
124
|
+
# not rounded to a token block.
|
|
125
125
|
#
|
|
126
126
|
# @param ttl [Symbol, OpenAI::Models::Beta::BetaResponseInputFileContent::PromptCacheBreakpoint::Ttl]
|
|
127
127
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -31,9 +31,9 @@ module OpenAI
|
|
|
31
31
|
optional :image_url, String, nil?: true
|
|
32
32
|
|
|
33
33
|
# @!attribute prompt_cache_breakpoint
|
|
34
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
35
|
-
#
|
|
36
|
-
# token block.
|
|
34
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
35
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
36
|
+
# not rounded to a token block.
|
|
37
37
|
#
|
|
38
38
|
# @return [OpenAI::Models::Beta::BetaResponseInputImage::PromptCacheBreakpoint, nil]
|
|
39
39
|
optional :prompt_cache_breakpoint, -> { OpenAI::Beta::BetaResponseInputImage::PromptCacheBreakpoint }
|
|
@@ -54,9 +54,9 @@ module OpenAI
|
|
|
54
54
|
# encoded image in a data URL.
|
|
55
55
|
#
|
|
56
56
|
# @param prompt_cache_breakpoint [OpenAI::Models::Beta::BetaResponseInputImage::PromptCacheBreakpoint]
|
|
57
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
58
|
-
#
|
|
59
|
-
# token block.
|
|
57
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
58
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
59
|
+
# not rounded to a token block.
|
|
60
60
|
#
|
|
61
61
|
# @param type [Symbol, :input_image]
|
|
62
62
|
# The type of the input item. Always `input_image`.
|
|
@@ -92,9 +92,9 @@ module OpenAI
|
|
|
92
92
|
optional :ttl, enum: -> { OpenAI::Beta::BetaResponseInputImage::PromptCacheBreakpoint::Ttl }
|
|
93
93
|
|
|
94
94
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
95
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
96
|
-
#
|
|
97
|
-
# token block.
|
|
95
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
96
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
97
|
+
# not rounded to a token block.
|
|
98
98
|
#
|
|
99
99
|
# @param ttl [Symbol, OpenAI::Models::Beta::BetaResponseInputImage::PromptCacheBreakpoint::Ttl]
|
|
100
100
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -31,9 +31,9 @@ module OpenAI
|
|
|
31
31
|
optional :image_url, String, nil?: true
|
|
32
32
|
|
|
33
33
|
# @!attribute prompt_cache_breakpoint
|
|
34
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
35
|
-
#
|
|
36
|
-
# token block.
|
|
34
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
35
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
36
|
+
# not rounded to a token block.
|
|
37
37
|
#
|
|
38
38
|
# @return [OpenAI::Models::Beta::BetaResponseInputImageContent::PromptCacheBreakpoint, nil]
|
|
39
39
|
optional(
|
|
@@ -58,9 +58,9 @@ module OpenAI
|
|
|
58
58
|
# encoded image in a data URL.
|
|
59
59
|
#
|
|
60
60
|
# @param prompt_cache_breakpoint [OpenAI::Models::Beta::BetaResponseInputImageContent::PromptCacheBreakpoint, nil]
|
|
61
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
62
|
-
#
|
|
63
|
-
# token block.
|
|
61
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
62
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
63
|
+
# not rounded to a token block.
|
|
64
64
|
#
|
|
65
65
|
# @param type [Symbol, :input_image]
|
|
66
66
|
# The type of the input item. Always `input_image`.
|
|
@@ -96,9 +96,9 @@ module OpenAI
|
|
|
96
96
|
optional :ttl, enum: -> { OpenAI::Beta::BetaResponseInputImageContent::PromptCacheBreakpoint::Ttl }
|
|
97
97
|
|
|
98
98
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
99
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
100
|
-
#
|
|
101
|
-
# token block.
|
|
99
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
100
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
101
|
+
# not rounded to a token block.
|
|
102
102
|
#
|
|
103
103
|
# @param ttl [Symbol, OpenAI::Models::Beta::BetaResponseInputImageContent::PromptCacheBreakpoint::Ttl]
|
|
104
104
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -63,9 +63,8 @@ module OpenAI
|
|
|
63
63
|
|
|
64
64
|
variant :additional_tools, -> { OpenAI::Beta::BetaResponseInputItem::AdditionalTools }
|
|
65
65
|
|
|
66
|
-
# An update to the conversation's response configuration.
|
|
67
|
-
#
|
|
68
|
-
# configuration update.
|
|
66
|
+
# An update to the conversation's response configuration. Supply reasoning,
|
|
67
|
+
# text, or both. Each setting stays in effect until a later update replaces it.
|
|
69
68
|
variant :configuration_update, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItemParam }
|
|
70
69
|
|
|
71
70
|
# A description of the chain of thought used by a reasoning model while generating
|
|
@@ -17,9 +17,9 @@ module OpenAI
|
|
|
17
17
|
required :type, const: :input_text
|
|
18
18
|
|
|
19
19
|
# @!attribute prompt_cache_breakpoint
|
|
20
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
21
|
-
#
|
|
22
|
-
# token block.
|
|
20
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
21
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
22
|
+
# not rounded to a token block.
|
|
23
23
|
#
|
|
24
24
|
# @return [OpenAI::Models::Beta::BetaResponseInputText::PromptCacheBreakpoint, nil]
|
|
25
25
|
optional :prompt_cache_breakpoint, -> { OpenAI::Beta::BetaResponseInputText::PromptCacheBreakpoint }
|
|
@@ -31,9 +31,9 @@ module OpenAI
|
|
|
31
31
|
# The text input to the model.
|
|
32
32
|
#
|
|
33
33
|
# @param prompt_cache_breakpoint [OpenAI::Models::Beta::BetaResponseInputText::PromptCacheBreakpoint]
|
|
34
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
35
|
-
#
|
|
36
|
-
# token block.
|
|
34
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
35
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
36
|
+
# not rounded to a token block.
|
|
37
37
|
#
|
|
38
38
|
# @param type [Symbol, :input_text]
|
|
39
39
|
# The type of the input item. Always `input_text`.
|
|
@@ -53,9 +53,9 @@ module OpenAI
|
|
|
53
53
|
optional :ttl, enum: -> { OpenAI::Beta::BetaResponseInputText::PromptCacheBreakpoint::Ttl }
|
|
54
54
|
|
|
55
55
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
56
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
57
|
-
#
|
|
58
|
-
# token block.
|
|
56
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
57
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
58
|
+
# not rounded to a token block.
|
|
59
59
|
#
|
|
60
60
|
# @param ttl [Symbol, OpenAI::Models::Beta::BetaResponseInputText::PromptCacheBreakpoint::Ttl]
|
|
61
61
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|