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
|
@@ -37,6 +37,7 @@ module OpenAI
|
|
|
37
37
|
?service_tier: OpenAI::Models::Beta::BetaResponse::service_tier?,
|
|
38
38
|
?status: OpenAI::Models::Beta::beta_response_status,
|
|
39
39
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
40
|
+
?tool_usage: OpenAI::Beta::BetaResponse::ToolUsage,
|
|
40
41
|
?top_logprobs: Integer?,
|
|
41
42
|
?truncation: OpenAI::Models::Beta::BetaResponse::truncation?,
|
|
42
43
|
?usage: OpenAI::Beta::BetaResponseUsage,
|
|
@@ -280,6 +281,36 @@ module OpenAI
|
|
|
280
281
|
OpenAI::Beta::BetaResponseTextConfig
|
|
281
282
|
) -> OpenAI::Beta::BetaResponseTextConfig
|
|
282
283
|
|
|
284
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
285
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
286
|
+
# recorded usage have zero counts.
|
|
287
|
+
#
|
|
288
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
289
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
290
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
291
|
+
# is unknown.
|
|
292
|
+
#
|
|
293
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
294
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
295
|
+
# final charges.
|
|
296
|
+
attr_reader tool_usage: OpenAI::Beta::BetaResponse::ToolUsage?
|
|
297
|
+
|
|
298
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
299
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
300
|
+
# recorded usage have zero counts.
|
|
301
|
+
#
|
|
302
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
303
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
304
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
305
|
+
# is unknown.
|
|
306
|
+
#
|
|
307
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
308
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
309
|
+
# final charges.
|
|
310
|
+
def tool_usage=: (
|
|
311
|
+
OpenAI::Beta::BetaResponse::ToolUsage
|
|
312
|
+
) -> OpenAI::Beta::BetaResponse::ToolUsage
|
|
313
|
+
|
|
283
314
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
284
315
|
# to return at each token position, each with an associated log probability. In
|
|
285
316
|
# some cases, the number of returned tokens may be fewer than requested.
|
|
@@ -493,6 +524,19 @@ module OpenAI
|
|
|
493
524
|
#
|
|
494
525
|
# - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
|
|
495
526
|
# - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
|
|
527
|
+
# @param tool_usage
|
|
528
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
529
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
530
|
+
# recorded usage have zero counts.
|
|
531
|
+
#
|
|
532
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
533
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
534
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
535
|
+
# is unknown.
|
|
536
|
+
#
|
|
537
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
538
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
539
|
+
# final charges.
|
|
496
540
|
# @param top_logprobs
|
|
497
541
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
498
542
|
# to return at each token position, each with an associated log probability. In
|
|
@@ -548,6 +592,7 @@ module OpenAI
|
|
|
548
592
|
?service_tier: OpenAI::Models::Beta::BetaResponse::service_tier?,
|
|
549
593
|
?status: OpenAI::Models::Beta::beta_response_status,
|
|
550
594
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
595
|
+
?tool_usage: OpenAI::Beta::BetaResponse::ToolUsage,
|
|
551
596
|
?top_logprobs: Integer?,
|
|
552
597
|
?truncation: OpenAI::Models::Beta::BetaResponse::truncation?,
|
|
553
598
|
?usage: OpenAI::Beta::BetaResponseUsage,
|
|
@@ -588,6 +633,7 @@ module OpenAI
|
|
|
588
633
|
?service_tier: OpenAI::Models::Beta::BetaResponse::service_tier?,
|
|
589
634
|
?status: OpenAI::Models::Beta::beta_response_status,
|
|
590
635
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
636
|
+
?tool_usage: OpenAI::Beta::BetaResponse::ToolUsage,
|
|
591
637
|
?top_logprobs: Integer?,
|
|
592
638
|
?truncation: OpenAI::Models::Beta::BetaResponse::truncation?,
|
|
593
639
|
?usage: OpenAI::Beta::BetaResponseUsage,
|
|
@@ -1572,6 +1618,183 @@ module OpenAI
|
|
|
1572
1618
|
def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponse::service_tier]
|
|
1573
1619
|
end
|
|
1574
1620
|
|
|
1621
|
+
type tool_usage =
|
|
1622
|
+
{
|
|
1623
|
+
image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen,
|
|
1624
|
+
web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
class ToolUsage < OpenAI::Internal::Type::BaseModel
|
|
1628
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1629
|
+
attr_accessor image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen
|
|
1630
|
+
|
|
1631
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1632
|
+
attr_accessor web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1633
|
+
|
|
1634
|
+
# @param image_gen
|
|
1635
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1636
|
+
# @param web_search
|
|
1637
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1638
|
+
def initialize: (
|
|
1639
|
+
image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen,
|
|
1640
|
+
web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1641
|
+
) -> void
|
|
1642
|
+
|
|
1643
|
+
def to_hash: -> {
|
|
1644
|
+
image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen,
|
|
1645
|
+
web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
type image_gen =
|
|
1649
|
+
{
|
|
1650
|
+
input_tokens: Integer,
|
|
1651
|
+
input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails,
|
|
1652
|
+
output_tokens: Integer,
|
|
1653
|
+
total_tokens: Integer,
|
|
1654
|
+
?cached_tokens: Integer,
|
|
1655
|
+
?cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails,
|
|
1656
|
+
?output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
class ImageGen < OpenAI::Internal::Type::BaseModel
|
|
1660
|
+
# The number of tokens (images and text) in the input prompt.
|
|
1661
|
+
attr_accessor input_tokens: Integer
|
|
1662
|
+
|
|
1663
|
+
# The input tokens detailed information for the image generation.
|
|
1664
|
+
attr_accessor input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails
|
|
1665
|
+
|
|
1666
|
+
# The number of output tokens generated by the model.
|
|
1667
|
+
attr_accessor output_tokens: Integer
|
|
1668
|
+
|
|
1669
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
1670
|
+
attr_accessor total_tokens: Integer
|
|
1671
|
+
|
|
1672
|
+
attr_reader cached_tokens: Integer?
|
|
1673
|
+
|
|
1674
|
+
def cached_tokens=: (Integer) -> Integer
|
|
1675
|
+
|
|
1676
|
+
attr_reader cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails?
|
|
1677
|
+
|
|
1678
|
+
def cached_tokens_details=: (
|
|
1679
|
+
OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails
|
|
1680
|
+
) -> OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails
|
|
1681
|
+
|
|
1682
|
+
# The output token details for the image generation.
|
|
1683
|
+
attr_reader output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails?
|
|
1684
|
+
|
|
1685
|
+
# The output token details for the image generation.
|
|
1686
|
+
def output_tokens_details=: (
|
|
1687
|
+
OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1688
|
+
) -> OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1689
|
+
|
|
1690
|
+
# @param input_tokens
|
|
1691
|
+
# The number of tokens (images and text) in the input prompt.
|
|
1692
|
+
# @param input_tokens_details
|
|
1693
|
+
# The input tokens detailed information for the image generation.
|
|
1694
|
+
# @param output_tokens
|
|
1695
|
+
# The number of output tokens generated by the model.
|
|
1696
|
+
# @param total_tokens
|
|
1697
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
1698
|
+
# @param output_tokens_details
|
|
1699
|
+
# The output token details for the image generation.
|
|
1700
|
+
def initialize: (
|
|
1701
|
+
input_tokens: Integer,
|
|
1702
|
+
input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails,
|
|
1703
|
+
output_tokens: Integer,
|
|
1704
|
+
total_tokens: Integer,
|
|
1705
|
+
?cached_tokens: Integer,
|
|
1706
|
+
?cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails,
|
|
1707
|
+
?output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1708
|
+
) -> void
|
|
1709
|
+
|
|
1710
|
+
def to_hash: -> {
|
|
1711
|
+
input_tokens: Integer,
|
|
1712
|
+
input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails,
|
|
1713
|
+
output_tokens: Integer,
|
|
1714
|
+
total_tokens: Integer,
|
|
1715
|
+
?cached_tokens: Integer,
|
|
1716
|
+
?cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails,
|
|
1717
|
+
?output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
type input_tokens_details =
|
|
1721
|
+
{ image_tokens: Integer, text_tokens: Integer }
|
|
1722
|
+
|
|
1723
|
+
class InputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1724
|
+
# The number of image tokens in the input prompt.
|
|
1725
|
+
attr_accessor image_tokens: Integer
|
|
1726
|
+
|
|
1727
|
+
# The number of text tokens in the input prompt.
|
|
1728
|
+
attr_accessor text_tokens: Integer
|
|
1729
|
+
|
|
1730
|
+
# @param image_tokens
|
|
1731
|
+
# The number of image tokens in the input prompt.
|
|
1732
|
+
# @param text_tokens
|
|
1733
|
+
# The number of text tokens in the input prompt.
|
|
1734
|
+
def initialize: (
|
|
1735
|
+
image_tokens: Integer,
|
|
1736
|
+
text_tokens: Integer
|
|
1737
|
+
) -> void
|
|
1738
|
+
|
|
1739
|
+
def to_hash: -> { image_tokens: Integer, text_tokens: Integer }
|
|
1740
|
+
end
|
|
1741
|
+
|
|
1742
|
+
type cached_tokens_details =
|
|
1743
|
+
{ cached_image_tokens: Integer, cached_text_tokens: Integer }
|
|
1744
|
+
|
|
1745
|
+
class CachedTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1746
|
+
attr_accessor cached_image_tokens: Integer
|
|
1747
|
+
|
|
1748
|
+
attr_accessor cached_text_tokens: Integer
|
|
1749
|
+
|
|
1750
|
+
def initialize: (
|
|
1751
|
+
cached_image_tokens: Integer,
|
|
1752
|
+
cached_text_tokens: Integer
|
|
1753
|
+
) -> void
|
|
1754
|
+
|
|
1755
|
+
def to_hash: -> {
|
|
1756
|
+
cached_image_tokens: Integer,
|
|
1757
|
+
cached_text_tokens: Integer
|
|
1758
|
+
}
|
|
1759
|
+
end
|
|
1760
|
+
|
|
1761
|
+
type output_tokens_details =
|
|
1762
|
+
{ image_tokens: Integer, text_tokens: Integer }
|
|
1763
|
+
|
|
1764
|
+
class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1765
|
+
# The number of image output tokens generated by the model.
|
|
1766
|
+
attr_accessor image_tokens: Integer
|
|
1767
|
+
|
|
1768
|
+
# The number of text output tokens generated by the model.
|
|
1769
|
+
attr_accessor text_tokens: Integer
|
|
1770
|
+
|
|
1771
|
+
# @param image_tokens
|
|
1772
|
+
# The number of image output tokens generated by the model.
|
|
1773
|
+
# @param text_tokens
|
|
1774
|
+
# The number of text output tokens generated by the model.
|
|
1775
|
+
def initialize: (
|
|
1776
|
+
image_tokens: Integer,
|
|
1777
|
+
text_tokens: Integer
|
|
1778
|
+
) -> void
|
|
1779
|
+
|
|
1780
|
+
def to_hash: -> { image_tokens: Integer, text_tokens: Integer }
|
|
1781
|
+
end
|
|
1782
|
+
end
|
|
1783
|
+
|
|
1784
|
+
type web_search = { num_requests: Integer }
|
|
1785
|
+
|
|
1786
|
+
class WebSearch < OpenAI::Internal::Type::BaseModel
|
|
1787
|
+
# The number of billable web search requests issued.
|
|
1788
|
+
attr_accessor num_requests: Integer
|
|
1789
|
+
|
|
1790
|
+
# @param num_requests
|
|
1791
|
+
# The number of billable web search requests issued.
|
|
1792
|
+
def initialize: (num_requests: Integer) -> void
|
|
1793
|
+
|
|
1794
|
+
def to_hash: -> { num_requests: Integer }
|
|
1795
|
+
end
|
|
1796
|
+
end
|
|
1797
|
+
|
|
1575
1798
|
type truncation = :auto | :disabled
|
|
1576
1799
|
|
|
1577
1800
|
module Truncation
|
|
@@ -8,7 +8,8 @@ module OpenAI
|
|
|
8
8
|
id: String,
|
|
9
9
|
?type: :configuration_update,
|
|
10
10
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Agent,
|
|
11
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
11
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning,
|
|
12
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
class BetaResponseConfigurationUpdateItem < OpenAI::Internal::Type::BaseModel
|
|
@@ -34,18 +35,29 @@ module OpenAI
|
|
|
34
35
|
OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
35
36
|
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
36
37
|
|
|
38
|
+
# The text output configuration for subsequent responses.
|
|
39
|
+
attr_reader text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text?
|
|
40
|
+
|
|
41
|
+
# The text output configuration for subsequent responses.
|
|
42
|
+
def text=: (
|
|
43
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
44
|
+
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
45
|
+
|
|
37
46
|
# @param id
|
|
38
47
|
# The unique ID of the configuration update item.
|
|
39
48
|
# @param agent
|
|
40
49
|
# The agent that produced this item.
|
|
41
50
|
# @param reasoning
|
|
42
51
|
# The reasoning configuration applied by this update.
|
|
52
|
+
# @param text
|
|
53
|
+
# The text output configuration for subsequent responses.
|
|
43
54
|
# @param type
|
|
44
55
|
# The item type. Always `configuration_update`.
|
|
45
56
|
def initialize: (
|
|
46
57
|
id: String,
|
|
47
58
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Agent,
|
|
48
59
|
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning,
|
|
60
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text,
|
|
49
61
|
?type: :configuration_update
|
|
50
62
|
) -> void
|
|
51
63
|
|
|
@@ -53,7 +65,8 @@ module OpenAI
|
|
|
53
65
|
id: String,
|
|
54
66
|
?type: :configuration_update,
|
|
55
67
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Agent,
|
|
56
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
68
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning,
|
|
69
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
57
70
|
}
|
|
58
71
|
|
|
59
72
|
type agent = { agent_name: String }
|
|
@@ -107,6 +120,49 @@ module OpenAI
|
|
|
107
120
|
def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Reasoning::effort]
|
|
108
121
|
end
|
|
109
122
|
end
|
|
123
|
+
|
|
124
|
+
type text =
|
|
125
|
+
{
|
|
126
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
130
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
131
|
+
attr_accessor format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
132
|
+
|
|
133
|
+
# @param format_
|
|
134
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
135
|
+
def initialize: (
|
|
136
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
137
|
+
) -> void
|
|
138
|
+
|
|
139
|
+
def to_hash: -> {
|
|
140
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type format_ =
|
|
144
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text
|
|
145
|
+
| OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig
|
|
146
|
+
|
|
147
|
+
module Format
|
|
148
|
+
extend OpenAI::Internal::Type::Union
|
|
149
|
+
|
|
150
|
+
type text = { ?type: :text }
|
|
151
|
+
|
|
152
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
153
|
+
# The type of response format being defined. Always `text`.
|
|
154
|
+
attr_accessor type: :text
|
|
155
|
+
|
|
156
|
+
# @param type
|
|
157
|
+
# The type of response format being defined. Always `text`.
|
|
158
|
+
def initialize: (?type: :text) -> void
|
|
159
|
+
|
|
160
|
+
def to_hash: -> { ?type: :text }
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_]
|
|
164
|
+
end
|
|
165
|
+
end
|
|
110
166
|
end
|
|
111
167
|
end
|
|
112
168
|
end
|
|
@@ -8,7 +8,8 @@ module OpenAI
|
|
|
8
8
|
?type: :configuration_update,
|
|
9
9
|
?id: String?,
|
|
10
10
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Agent?,
|
|
11
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
11
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning,
|
|
12
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
class BetaResponseConfigurationUpdateItemParam < OpenAI::Internal::Type::BaseModel
|
|
@@ -29,18 +30,29 @@ module OpenAI
|
|
|
29
30
|
OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
30
31
|
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
31
32
|
|
|
33
|
+
# The text output configuration for subsequent responses.
|
|
34
|
+
attr_reader text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text?
|
|
35
|
+
|
|
36
|
+
# The text output configuration for subsequent responses.
|
|
37
|
+
def text=: (
|
|
38
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
39
|
+
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
40
|
+
|
|
32
41
|
# @param id
|
|
33
42
|
# The unique ID of the configuration update item.
|
|
34
43
|
# @param agent
|
|
35
44
|
# The agent that produced this item.
|
|
36
45
|
# @param reasoning
|
|
37
46
|
# Updates to reasoning configuration. Only effort is supported.
|
|
47
|
+
# @param text
|
|
48
|
+
# The text output configuration for subsequent responses.
|
|
38
49
|
# @param type
|
|
39
50
|
# The item type. Always `configuration_update`.
|
|
40
51
|
def initialize: (
|
|
41
52
|
?id: String?,
|
|
42
53
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Agent?,
|
|
43
54
|
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning,
|
|
55
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text,
|
|
44
56
|
?type: :configuration_update
|
|
45
57
|
) -> void
|
|
46
58
|
|
|
@@ -48,7 +60,8 @@ module OpenAI
|
|
|
48
60
|
?type: :configuration_update,
|
|
49
61
|
?id: String?,
|
|
50
62
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Agent?,
|
|
51
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
63
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning,
|
|
64
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
52
65
|
}
|
|
53
66
|
|
|
54
67
|
type agent = { agent_name: String }
|
|
@@ -102,6 +115,49 @@ module OpenAI
|
|
|
102
115
|
def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning::effort]
|
|
103
116
|
end
|
|
104
117
|
end
|
|
118
|
+
|
|
119
|
+
type text =
|
|
120
|
+
{
|
|
121
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
125
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
126
|
+
attr_accessor format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
127
|
+
|
|
128
|
+
# @param format_
|
|
129
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
130
|
+
def initialize: (
|
|
131
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
132
|
+
) -> void
|
|
133
|
+
|
|
134
|
+
def to_hash: -> {
|
|
135
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
type format_ =
|
|
139
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format::Text
|
|
140
|
+
| OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig
|
|
141
|
+
|
|
142
|
+
module Format
|
|
143
|
+
extend OpenAI::Internal::Type::Union
|
|
144
|
+
|
|
145
|
+
type text = { ?type: :text }
|
|
146
|
+
|
|
147
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
148
|
+
# The type of response format being defined. Always `text`.
|
|
149
|
+
attr_accessor type: :text
|
|
150
|
+
|
|
151
|
+
# @param type
|
|
152
|
+
# The type of response format being defined. Always `text`.
|
|
153
|
+
def initialize: (?type: :text) -> void
|
|
154
|
+
|
|
155
|
+
def to_hash: -> { ?type: :text }
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_]
|
|
159
|
+
end
|
|
160
|
+
end
|
|
105
161
|
end
|
|
106
162
|
end
|
|
107
163
|
end
|
|
@@ -55,14 +55,14 @@ module OpenAI
|
|
|
55
55
|
# The name of the file to be sent to the model.
|
|
56
56
|
def filename=: (String) -> String
|
|
57
57
|
|
|
58
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
59
|
-
#
|
|
60
|
-
# token block.
|
|
58
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
59
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
60
|
+
# not rounded to a token block.
|
|
61
61
|
attr_reader prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputFile::PromptCacheBreakpoint?
|
|
62
62
|
|
|
63
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
64
|
-
#
|
|
65
|
-
# token block.
|
|
63
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
64
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
65
|
+
# not rounded to a token block.
|
|
66
66
|
def prompt_cache_breakpoint=: (
|
|
67
67
|
OpenAI::Beta::BetaResponseInputFile::PromptCacheBreakpoint
|
|
68
68
|
) -> OpenAI::Beta::BetaResponseInputFile::PromptCacheBreakpoint
|
|
@@ -82,9 +82,9 @@ module OpenAI
|
|
|
82
82
|
# @param filename
|
|
83
83
|
# The name of the file to be sent to the model.
|
|
84
84
|
# @param prompt_cache_breakpoint
|
|
85
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
86
|
-
#
|
|
87
|
-
# token block.
|
|
85
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
86
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
87
|
+
# not rounded to a token block.
|
|
88
88
|
# @param type
|
|
89
89
|
# The type of the input item. Always `input_file`.
|
|
90
90
|
def initialize: (
|
|
@@ -46,9 +46,9 @@ module OpenAI
|
|
|
46
46
|
# The name of the file to be sent to the model.
|
|
47
47
|
attr_accessor filename: String?
|
|
48
48
|
|
|
49
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
50
|
-
#
|
|
51
|
-
# token block.
|
|
49
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
50
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
51
|
+
# not rounded to a token block.
|
|
52
52
|
attr_accessor prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputFileContent::PromptCacheBreakpoint?
|
|
53
53
|
|
|
54
54
|
# @param detail
|
|
@@ -66,9 +66,9 @@ module OpenAI
|
|
|
66
66
|
# @param filename
|
|
67
67
|
# The name of the file to be sent to the model.
|
|
68
68
|
# @param prompt_cache_breakpoint
|
|
69
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
70
|
-
#
|
|
71
|
-
# token block.
|
|
69
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
70
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
71
|
+
# not rounded to a token block.
|
|
72
72
|
# @param type
|
|
73
73
|
# The type of the input item. Always `input_file`.
|
|
74
74
|
def initialize: (
|
|
@@ -27,14 +27,14 @@ module OpenAI
|
|
|
27
27
|
# encoded image in a data URL.
|
|
28
28
|
attr_accessor image_url: String?
|
|
29
29
|
|
|
30
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
31
|
-
#
|
|
32
|
-
# token block.
|
|
30
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
31
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
32
|
+
# not rounded to a token block.
|
|
33
33
|
attr_reader prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputImage::PromptCacheBreakpoint?
|
|
34
34
|
|
|
35
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
36
|
-
#
|
|
37
|
-
# token block.
|
|
35
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
36
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
37
|
+
# not rounded to a token block.
|
|
38
38
|
def prompt_cache_breakpoint=: (
|
|
39
39
|
OpenAI::Beta::BetaResponseInputImage::PromptCacheBreakpoint
|
|
40
40
|
) -> OpenAI::Beta::BetaResponseInputImage::PromptCacheBreakpoint
|
|
@@ -48,9 +48,9 @@ module OpenAI
|
|
|
48
48
|
# The URL of the image to be sent to the model. A fully qualified URL or base64
|
|
49
49
|
# encoded image in a data URL.
|
|
50
50
|
# @param prompt_cache_breakpoint
|
|
51
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
52
|
-
#
|
|
53
|
-
# token block.
|
|
51
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
52
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
53
|
+
# not rounded to a token block.
|
|
54
54
|
# @param type
|
|
55
55
|
# The type of the input item. Always `input_image`.
|
|
56
56
|
def initialize: (
|
|
@@ -27,9 +27,9 @@ module OpenAI
|
|
|
27
27
|
# encoded image in a data URL.
|
|
28
28
|
attr_accessor image_url: String?
|
|
29
29
|
|
|
30
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
31
|
-
#
|
|
32
|
-
# token block.
|
|
30
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
31
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
32
|
+
# not rounded to a token block.
|
|
33
33
|
attr_accessor prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputImageContent::PromptCacheBreakpoint?
|
|
34
34
|
|
|
35
35
|
# @param detail
|
|
@@ -41,9 +41,9 @@ module OpenAI
|
|
|
41
41
|
# The URL of the image to be sent to the model. A fully qualified URL or base64
|
|
42
42
|
# encoded image in a data URL.
|
|
43
43
|
# @param prompt_cache_breakpoint
|
|
44
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
45
|
-
#
|
|
46
|
-
# token block.
|
|
44
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
45
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
46
|
+
# not rounded to a token block.
|
|
47
47
|
# @param type
|
|
48
48
|
# The type of the input item. Always `input_image`.
|
|
49
49
|
def initialize: (
|
|
@@ -17,14 +17,14 @@ module OpenAI
|
|
|
17
17
|
# The type of the input item. Always `input_text`.
|
|
18
18
|
attr_accessor type: :input_text
|
|
19
19
|
|
|
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
|
attr_reader prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputText::PromptCacheBreakpoint?
|
|
24
24
|
|
|
25
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
26
|
-
#
|
|
27
|
-
# token block.
|
|
25
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
26
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
27
|
+
# not rounded to a token block.
|
|
28
28
|
def prompt_cache_breakpoint=: (
|
|
29
29
|
OpenAI::Beta::BetaResponseInputText::PromptCacheBreakpoint
|
|
30
30
|
) -> OpenAI::Beta::BetaResponseInputText::PromptCacheBreakpoint
|
|
@@ -32,9 +32,9 @@ module OpenAI
|
|
|
32
32
|
# @param text
|
|
33
33
|
# The text input to the model.
|
|
34
34
|
# @param prompt_cache_breakpoint
|
|
35
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
36
|
-
#
|
|
37
|
-
# token block.
|
|
35
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
36
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
37
|
+
# not rounded to a token block.
|
|
38
38
|
# @param type
|
|
39
39
|
# The type of the input item. Always `input_text`.
|
|
40
40
|
def initialize: (
|
|
@@ -17,17 +17,17 @@ module OpenAI
|
|
|
17
17
|
# The type of the input item. Always `input_text`.
|
|
18
18
|
attr_accessor type: :input_text
|
|
19
19
|
|
|
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
|
attr_accessor prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint?
|
|
24
24
|
|
|
25
25
|
# @param text
|
|
26
26
|
# The text input to the model.
|
|
27
27
|
# @param prompt_cache_breakpoint
|
|
28
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
29
|
-
#
|
|
30
|
-
# token block.
|
|
28
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
29
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
30
|
+
# not rounded to a token block.
|
|
31
31
|
# @param type
|
|
32
32
|
# The type of the input item. Always `input_text`.
|
|
33
33
|
def initialize: (
|