openai 0.103.0 → 0.104.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 +81 -0
- data/README.md +23 -1
- data/lib/openai/client.rb +3 -386
- data/lib/openai/helpers/admin/organization/projects/api_keys.rb +42 -0
- data/lib/openai/helpers/agents/session_stream_resource.rb +60 -0
- data/lib/openai/helpers/beta/agents/artifacts.rb +18 -0
- data/lib/openai/helpers/beta/agents/files.rb +41 -0
- data/lib/openai/helpers/client_runtime.rb +391 -0
- data/lib/openai/helpers/files.rb +47 -0
- data/lib/openai/helpers/live/websocket.rb +8 -57
- data/lib/openai/helpers/models/chat/parsed.rb +32 -0
- data/lib/openai/helpers/models/responses/parsed.rb +30 -0
- data/lib/openai/helpers/models/responses/response.rb +32 -0
- data/lib/openai/helpers/models/webhooks/webhook_endpoint_with_secret.rb +20 -0
- data/lib/openai/helpers/realtime/client_extension.rb +1 -2
- data/lib/openai/helpers/realtime/connection_manager.rb +1 -1
- data/lib/openai/helpers/realtime/translation.rb +7 -50
- data/lib/openai/helpers/responses_websocket/client_extension.rb +1 -2
- data/lib/openai/helpers/streaming/chat_completion_resource.rb +36 -0
- data/lib/openai/helpers/streaming/response_stream.rb +1 -16
- data/lib/openai/helpers/streaming/response_stream_resource.rb +78 -0
- data/lib/openai/helpers/vector_stores/file_batches.rb +188 -0
- data/lib/openai/helpers/vector_stores/files.rb +198 -0
- data/lib/openai/helpers/websocket/client_request.rb +31 -6
- data/lib/openai/helpers/websocket/connection.rb +58 -0
- data/lib/openai/helpers/websocket/connection_manager.rb +4 -2
- data/lib/openai/helpers/websocket/protocol.rb +2 -1
- data/lib/openai/helpers/websocket/resource.rb +54 -0
- data/lib/openai/helpers/websocket/typed_connection.rb +95 -0
- data/lib/openai/helpers/websocket.rb +4 -0
- data/lib/openai/models/admin/organization/audit_log_list_response.rb +5 -3
- data/lib/openai/models/admin/organization/external_storage_configuration.rb +5 -3
- data/lib/openai/models/admin/organization/external_storage_create_params.rb +33 -3
- data/lib/openai/models/admin/organization/oci_external_storage_provider.rb +37 -0
- data/lib/openai/models/admin/organization/project_residency.rb +3 -0
- data/lib/openai/models/admin/organization/projects/api_key_update_params.rb +64 -0
- data/lib/openai/models/admin/organization/projects/api_key_update_scopes_params.rb +34 -0
- data/lib/openai/models/admin/organization/usage_decisions_params.rb +177 -0
- data/lib/openai/models/admin/organization/usage_decisions_response.rb +351 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -3
- data/lib/openai/models/audio/translation_create_response.rb +0 -1
- data/lib/openai/models/audio/voice.rb +17 -2
- data/lib/openai/models/audio/voice_create_params.rb +100 -3
- data/lib/openai/models/beta/agent_create_params.rb +4 -2
- data/lib/openai/models/beta/agent_list_params.rb +4 -4
- data/lib/openai/models/beta/agent_session.rb +37 -1
- data/lib/openai/models/beta/agent_update_params.rb +4 -2
- data/lib/openai/models/beta/agents/environment_list_params.rb +7 -7
- data/lib/openai/models/beta/agents/session_create_params.rb +39 -3
- data/lib/openai/models/beta/agents/session_list_params.rb +7 -10
- data/lib/openai/models/beta/agents/session_update_params.rb +33 -1
- data/lib/openai/models/beta/agents/sessions/artifact_list_params.rb +11 -11
- data/lib/openai/models/beta/agents/vault_list_params.rb +23 -13
- data/lib/openai/models/beta/agents/vault_status_filter.rb +1 -3
- data/lib/openai/models/beta/agents/vault_update_params.rb +47 -0
- data/lib/openai/models/beta/agents/vaults/credential_list_params.rb +23 -13
- data/lib/openai/models/beta/beta_response.rb +23 -2
- data/lib/openai/models/beta/beta_response_error.rb +19 -1
- data/lib/openai/models/beta/beta_response_input_item.rb +107 -1
- data/lib/openai/models/beta/beta_response_item.rb +107 -1
- data/lib/openai/models/beta/beta_response_output_item.rb +107 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +23 -2
- data/lib/openai/models/beta/response_compact_params.rb +21 -0
- data/lib/openai/models/beta/response_create_params.rb +23 -2
- data/lib/openai/models/beta/session_turn_error.rb +3 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +3 -3
- data/lib/openai/models/chat/chat_completion_message.rb +0 -8
- data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +0 -8
- data/lib/openai/models/chat/completion_create_params.rb +5 -12
- data/lib/openai/models/chat_model.rb +21 -0
- data/lib/openai/models/conversations/conversation_item.rb +107 -1
- data/lib/openai/models/decision.rb +17 -2
- data/lib/openai/models/decision_create_params.rb +29 -12
- data/lib/openai/models/decision_input_image.rb +4 -3
- data/lib/openai/models/decision_input_message.rb +4 -4
- data/lib/openai/models/decision_input_part.rb +3 -2
- data/lib/openai/models/image_edit_completed_event.rb +1 -2
- data/lib/openai/models/image_edit_partial_image_event.rb +1 -2
- data/lib/openai/models/image_gen_completed_event.rb +1 -2
- data/lib/openai/models/image_gen_partial_image_event.rb +1 -2
- data/lib/openai/models/images_response.rb +1 -2
- data/lib/openai/models/live/built_in_voice.rb +1 -0
- data/lib/openai/models/live/client_event.rb +14 -2
- data/lib/openai/models/live/decision_create_event.rb +26 -0
- data/lib/openai/models/live/decision_event.rb +117 -0
- data/lib/openai/models/live/decision_item_create_event.rb +194 -0
- data/lib/openai/models/live/decision_item_created_event.rb +202 -0
- data/lib/openai/models/live/decision_item_delete_event.rb +38 -0
- data/lib/openai/models/live/decision_item_deleted_event.rb +46 -0
- data/lib/openai/models/live/decision_trigger.rb +244 -0
- data/lib/openai/models/live/decisions_delegation_config.rb +201 -0
- data/lib/openai/models/live/decisions_delegation_update_config.rb +208 -0
- data/lib/openai/models/live/delegation_created_event.rb +10 -10
- data/lib/openai/models/live/fork_client_event.rb +14 -2
- data/lib/openai/models/live/fork_server_event.rb +17 -2
- data/lib/openai/models/live/media_session_config.rb +47 -11
- data/lib/openai/models/live/output_audio_fixture_play_event.rb +48 -0
- data/lib/openai/models/live/output_audio_fixture_played_event.rb +42 -0
- data/lib/openai/models/live/output_audio_fixture_playing_event.rb +41 -0
- data/lib/openai/models/live/server_event.rb +17 -2
- data/lib/openai/models/live/session_accept_params.rb +47 -11
- data/lib/openai/models/live/session_config.rb +47 -11
- data/lib/openai/models/live/session_resource.rb +47 -11
- data/lib/openai/models/live/session_update_config.rb +38 -6
- data/lib/openai/models/live/session_update_event.rb +8 -8
- data/lib/openai/models/live/sideband_client_event.rb +57 -0
- data/lib/openai/models/live/sideband_server_event.rb +78 -0
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +6 -3
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +6 -3
- data/lib/openai/models/realtime/realtime_response_status.rb +10 -1
- data/lib/openai/models/response_format_json_schema.rb +1 -1
- data/lib/openai/models/responses/function_tool.rb +8 -6
- data/lib/openai/models/responses/response.rb +2 -23
- data/lib/openai/models/responses/response_compact_params.rb +21 -0
- data/lib/openai/models/responses/response_create_params.rb +3 -6
- data/lib/openai/models/responses/response_error.rb +19 -1
- data/lib/openai/models/responses/response_format_text_config.rb +0 -4
- data/lib/openai/models/responses/response_function_tool_call.rb +0 -8
- data/lib/openai/models/responses/response_input_item.rb +107 -1
- data/lib/openai/models/responses/response_item.rb +107 -1
- data/lib/openai/models/responses/response_output_item.rb +107 -1
- data/lib/openai/models/responses/response_output_text.rb +0 -8
- data/lib/openai/models/responses/responses_client_event.rb +2 -2
- data/lib/openai/models/safety/safety_alert.rb +12 -1
- data/lib/openai/models/video_create_error.rb +19 -1
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -4
- data/lib/openai/models/webhooks/webhook_endpoint_with_secret.rb +0 -9
- data/lib/openai/resources/admin/organization/external_storage.rb +1 -1
- data/lib/openai/resources/admin/organization/projects/api_keys.rb +61 -0
- data/lib/openai/resources/admin/organization/usage.rb +67 -0
- data/lib/openai/resources/audio/speech.rb +2 -1
- data/lib/openai/resources/audio/voices.rb +10 -10
- data/lib/openai/resources/beta/agents/environments/files.rb +3 -31
- data/lib/openai/resources/beta/agents/environments.rb +3 -3
- data/lib/openai/resources/beta/agents/sessions/artifacts.rb +5 -11
- data/lib/openai/resources/beta/agents/sessions.rb +20 -56
- data/lib/openai/resources/beta/agents/vaults/credentials.rb +10 -6
- data/lib/openai/resources/beta/agents/vaults.rb +45 -6
- data/lib/openai/resources/beta/agents.rb +6 -4
- data/lib/openai/resources/beta/responses.rb +2 -2
- data/lib/openai/resources/chat/completions.rb +11 -37
- data/lib/openai/resources/decisions.rb +9 -15
- data/lib/openai/resources/files.rb +0 -39
- data/lib/openai/resources/live/forks.rb +19 -0
- data/lib/openai/resources/live/sideband.rb +19 -0
- data/lib/openai/resources/live.rb +19 -0
- data/lib/openai/resources/realtime/translations.rb +19 -0
- data/lib/openai/resources/realtime.rb +19 -0
- data/lib/openai/resources/responses.rb +44 -95
- data/lib/openai/resources/vector_stores/file_batches.rb +0 -178
- data/lib/openai/resources/vector_stores/files.rb +0 -188
- data/lib/openai/resources/webhooks.rb +13 -29
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +31 -0
- data/rbi/openai/client.rbi +0 -103
- data/rbi/openai/helpers/admin/organization/projects/api_keys.rbi +25 -0
- data/rbi/openai/helpers/beta/agents/artifacts.rbi +25 -0
- data/rbi/openai/helpers/beta/agents/files.rbi +48 -0
- data/rbi/openai/helpers/client_runtime.rbi +108 -0
- data/rbi/openai/helpers/files.rbi +25 -0
- data/rbi/openai/helpers/models/chat/parsed.rbi +21 -0
- data/rbi/openai/helpers/models/responses/parsed.rbi +19 -0
- data/rbi/openai/helpers/models/responses/response.rbi +15 -0
- data/rbi/openai/helpers/streaming/response_stream.rbi +301 -0
- data/rbi/openai/helpers/vector_stores/file_batches.rbi +102 -0
- data/rbi/openai/helpers/vector_stores/files.rbi +122 -0
- data/rbi/openai/helpers/websocket.rbi +82 -0
- data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +6 -3
- data/rbi/openai/models/admin/organization/external_storage_configuration.rbi +4 -2
- data/rbi/openai/models/admin/organization/external_storage_create_params.rbi +63 -4
- data/rbi/openai/models/admin/organization/oci_external_storage_provider.rbi +71 -0
- data/rbi/openai/models/admin/organization/project_residency.rbi +12 -0
- data/rbi/openai/models/admin/organization/projects/api_key_update_params.rbi +110 -0
- data/rbi/openai/models/admin/organization/projects/api_key_update_scopes_params.rbi +72 -0
- data/rbi/openai/models/admin/organization/usage_decisions_params.rbi +229 -0
- data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +479 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -3
- data/rbi/openai/models/audio/voice.rbi +21 -2
- data/rbi/openai/models/audio/voice_create_params.rbi +149 -4
- data/rbi/openai/models/beta/agent_create_params.rbi +4 -2
- data/rbi/openai/models/beta/agent_list_params.rbi +8 -5
- data/rbi/openai/models/beta/agent_session.rbi +64 -1
- data/rbi/openai/models/beta/agent_update_params.rbi +4 -2
- data/rbi/openai/models/beta/agents/environment_list_params.rbi +7 -7
- data/rbi/openai/models/beta/agents/session_create_params.rbi +62 -2
- data/rbi/openai/models/beta/agents/session_list_params.rbi +11 -11
- data/rbi/openai/models/beta/agents/session_update_params.rbi +56 -0
- data/rbi/openai/models/beta/agents/sessions/artifact_list_params.rbi +19 -13
- data/rbi/openai/models/beta/agents/vault_list_params.rbi +30 -13
- data/rbi/openai/models/beta/agents/vault_status_filter.rbi +1 -3
- data/rbi/openai/models/beta/agents/vault_update_params.rbi +87 -0
- data/rbi/openai/models/beta/agents/vaults/credential_list_params.rbi +30 -13
- data/rbi/openai/models/beta/beta_response.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +24 -3
- data/rbi/openai/models/beta/beta_response_input_item.rbi +191 -0
- data/rbi/openai/models/beta/beta_response_item.rbi +189 -0
- data/rbi/openai/models/beta/beta_response_output_item.rbi +191 -0
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +2 -2
- data/rbi/openai/models/beta/response_create_params.rbi +2 -2
- data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +3 -3
- data/rbi/openai/models/chat/chat_completion_message.rbi +0 -4
- data/rbi/openai/models/chat/chat_completion_message_function_tool_call.rbi +0 -4
- data/rbi/openai/models/chat/completion_create_params.rbi +63 -78
- data/rbi/openai/models/conversations/conversation_item.rbi +191 -0
- data/rbi/openai/models/decision.rbi +14 -1
- data/rbi/openai/models/decision_create_params.rbi +23 -12
- data/rbi/openai/models/decision_input_image.rbi +4 -3
- data/rbi/openai/models/decision_input_message.rbi +4 -4
- data/rbi/openai/models/decision_input_part.rbi +2 -1
- data/rbi/openai/models/image_edit_completed_event.rbi +1 -0
- data/rbi/openai/models/image_edit_partial_image_event.rbi +1 -0
- data/rbi/openai/models/image_gen_completed_event.rbi +1 -0
- data/rbi/openai/models/image_gen_partial_image_event.rbi +1 -0
- data/rbi/openai/models/images_response.rbi +1 -0
- data/rbi/openai/models/live/built_in_voice.rbi +1 -0
- data/rbi/openai/models/live/client_event.rbi +4 -0
- data/rbi/openai/models/live/decision_create_event.rbi +55 -0
- data/rbi/openai/models/live/decision_event.rbi +185 -0
- data/rbi/openai/models/live/decision_item_create_event.rbi +338 -0
- data/rbi/openai/models/live/decision_item_created_event.rbi +354 -0
- data/rbi/openai/models/live/decision_item_delete_event.rbi +66 -0
- data/rbi/openai/models/live/decision_item_deleted_event.rbi +77 -0
- data/rbi/openai/models/live/decision_trigger.rbi +465 -0
- data/rbi/openai/models/live/decisions_delegation_config.rbi +393 -0
- data/rbi/openai/models/live/decisions_delegation_update_config.rbi +412 -0
- data/rbi/openai/models/live/delegation_created_event.rbi +8 -10
- data/rbi/openai/models/live/fork_client_event.rbi +4 -0
- data/rbi/openai/models/live/fork_server_event.rbi +5 -0
- data/rbi/openai/models/live/media_session_config.rbi +95 -14
- data/rbi/openai/models/live/output_audio_fixture_play_event.rbi +76 -0
- data/rbi/openai/models/live/output_audio_fixture_played_event.rbi +73 -0
- data/rbi/openai/models/live/output_audio_fixture_playing_event.rbi +72 -0
- data/rbi/openai/models/live/server_event.rbi +5 -0
- data/rbi/openai/models/live/session_accept_params.rbi +88 -12
- data/rbi/openai/models/live/session_config.rbi +100 -14
- data/rbi/openai/models/live/session_resource.rbi +81 -10
- data/rbi/openai/models/live/session_update_config.rbi +86 -9
- data/rbi/openai/models/live/session_update_event.rbi +8 -8
- data/rbi/openai/models/live/sideband_client_event.rbi +40 -0
- data/rbi/openai/models/live/sideband_server_event.rbi +47 -0
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +6 -3
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +6 -3
- data/rbi/openai/models/realtime/realtime_response_status.rbi +13 -1
- data/rbi/openai/models/realtime/realtime_translation_input_audio_buffer_append_event.rbi +1 -1
- data/rbi/openai/models/realtime/realtime_translation_output_audio_delta_event.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_translation_session_close_event.rbi +1 -1
- data/rbi/openai/models/realtime/realtime_translation_session_update_event.rbi +5 -1
- data/rbi/openai/models/responses/response.rbi +2 -7
- data/rbi/openai/models/responses/response_create_params.rbi +5 -9
- data/rbi/openai/models/responses/response_error.rbi +24 -3
- data/rbi/openai/models/responses/response_function_tool_call.rbi +0 -4
- data/rbi/openai/models/responses/response_function_web_search.rbi +21 -17
- data/rbi/openai/models/responses/response_input_item.rbi +191 -0
- data/rbi/openai/models/responses/response_item.rbi +189 -0
- data/rbi/openai/models/responses/response_output_item.rbi +191 -0
- data/rbi/openai/models/responses/response_output_text.rbi +0 -4
- data/rbi/openai/models/responses/responses_client_event.rbi +2 -2
- data/rbi/openai/models/safety/safety_alert.rbi +13 -1
- data/rbi/openai/models/video_create_error.rbi +24 -3
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -1
- data/rbi/openai/resources/admin/organization/external_storage.rbi +2 -1
- data/rbi/openai/resources/admin/organization/projects/api_keys.rbi +48 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +56 -0
- data/rbi/openai/resources/audio/speech.rbi +2 -1
- data/rbi/openai/resources/audio/voices.rbi +13 -10
- data/rbi/openai/resources/beta/agents/environments/files.rbi +3 -33
- data/rbi/openai/resources/beta/agents/environments.rbi +3 -3
- data/rbi/openai/resources/beta/agents/sessions/artifacts.rbi +5 -13
- data/rbi/openai/resources/beta/agents/sessions.rbi +15 -4
- data/rbi/openai/resources/beta/agents/vaults/credentials.rbi +9 -5
- data/rbi/openai/resources/beta/agents/vaults.rbi +34 -5
- data/rbi/openai/resources/beta/agents.rbi +6 -4
- data/rbi/openai/resources/beta/responses.rbi +2 -2
- data/rbi/openai/resources/chat/completions.rbi +26 -29
- data/rbi/openai/resources/decisions.rbi +9 -15
- data/rbi/openai/resources/files.rbi +0 -18
- data/rbi/openai/resources/live/forks.rbi +17 -0
- data/rbi/openai/resources/live/sideband.rbi +17 -0
- data/rbi/openai/resources/live.rbi +17 -0
- data/rbi/openai/resources/realtime/translations.rbi +17 -0
- data/rbi/openai/resources/realtime.rbi +17 -0
- data/rbi/openai/resources/responses.rbi +41 -333
- data/rbi/openai/resources/vector_stores/file_batches.rbi +0 -93
- data/rbi/openai/resources/vector_stores/files.rbi +0 -113
- data/rbi/openai/resources/webhooks.rbi +1 -1
- data/sig/openai/client.rbs +0 -50
- data/sig/openai/helpers/admin/organization/projects/api_keys.rbs +18 -0
- data/sig/openai/helpers/beta/agents/artifacts.rbs +17 -0
- data/sig/openai/helpers/beta/agents/files.rbs +30 -0
- data/sig/openai/helpers/client_runtime.rbs +53 -0
- data/sig/openai/helpers/files.rbs +12 -0
- data/sig/openai/helpers/models/responses/response.rbs +9 -0
- data/sig/openai/helpers/streaming/response_stream.rbs +37 -0
- data/sig/openai/helpers/vector_stores/file_batches.rbs +38 -0
- data/sig/openai/helpers/vector_stores/files.rbs +43 -0
- data/sig/openai/helpers/websocket.rbs +40 -0
- data/sig/openai/models/admin/organization/audit_log_list_response.rbs +1 -0
- data/sig/openai/models/admin/organization/external_storage_configuration.rbs +1 -0
- data/sig/openai/models/admin/organization/external_storage_create_params.rbs +33 -0
- data/sig/openai/models/admin/organization/oci_external_storage_provider.rbs +34 -0
- data/sig/openai/models/admin/organization/project_residency.rbs +6 -0
- data/sig/openai/models/admin/organization/projects/api_key_update_params.rbs +77 -0
- data/sig/openai/models/admin/organization/projects/api_key_update_scopes_params.rbs +38 -0
- data/sig/openai/models/admin/organization/usage_decisions_params.rbs +170 -0
- data/sig/openai/models/admin/organization/usage_decisions_response.rbs +319 -0
- data/sig/openai/models/audio/speech_create_params.rbs +4 -2
- data/sig/openai/models/audio/voice.rbs +21 -3
- data/sig/openai/models/audio/voice_create_params.rbs +90 -1
- data/sig/openai/models/beta/agent_create_params.rbs +4 -2
- data/sig/openai/models/beta/agent_list_params.rbs +9 -6
- data/sig/openai/models/beta/agent_session.rbs +36 -2
- data/sig/openai/models/beta/agent_update_params.rbs +4 -2
- data/sig/openai/models/beta/agents/environment_list_params.rbs +9 -9
- data/sig/openai/models/beta/agents/session_create_params.rbs +29 -2
- data/sig/openai/models/beta/agents/session_list_params.rbs +12 -12
- data/sig/openai/models/beta/agents/session_update_params.rbs +23 -0
- data/sig/openai/models/beta/agents/sessions/artifact_list_params.rbs +21 -15
- data/sig/openai/models/beta/agents/vault_list_params.rbs +32 -14
- data/sig/openai/models/beta/agents/vault_update_params.rbs +54 -0
- data/sig/openai/models/beta/agents/vaults/credential_list_params.rbs +32 -14
- data/sig/openai/models/beta/beta_response.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +19 -3
- data/sig/openai/models/beta/beta_response_input_item.rbs +110 -0
- data/sig/openai/models/beta/beta_response_item.rbs +110 -0
- data/sig/openai/models/beta/beta_response_output_item.rbs +110 -0
- data/sig/openai/models/beta/beta_responses_client_event.rbs +2 -2
- data/sig/openai/models/beta/response_create_params.rbs +2 -2
- data/sig/openai/models/beta/session_turn_error.rbs +4 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +2 -2
- data/sig/openai/models/chat/completion_create_params.rbs +2 -2
- data/sig/openai/models/conversations/conversation_item.rbs +110 -0
- data/sig/openai/models/decision.rbs +13 -0
- data/sig/openai/models/decision_create_params.rbs +19 -8
- data/sig/openai/models/decision_input_image.rbs +2 -2
- data/sig/openai/models/decision_input_message.rbs +2 -2
- data/sig/openai/models/live/built_in_voice.rbs +2 -0
- data/sig/openai/models/live/client_event.rbs +4 -0
- data/sig/openai/models/live/decision_create_event.rbs +18 -0
- data/sig/openai/models/live/decision_event.rbs +102 -0
- data/sig/openai/models/live/decision_item_create_event.rbs +183 -0
- data/sig/openai/models/live/decision_item_created_event.rbs +195 -0
- data/sig/openai/models/live/decision_item_delete_event.rbs +33 -0
- data/sig/openai/models/live/decision_item_deleted_event.rbs +49 -0
- data/sig/openai/models/live/decision_trigger.rbs +234 -0
- data/sig/openai/models/live/decisions_delegation_config.rbs +195 -0
- data/sig/openai/models/live/decisions_delegation_update_config.rbs +202 -0
- data/sig/openai/models/live/delegation_created_event.rbs +6 -7
- data/sig/openai/models/live/fork_client_event.rbs +4 -0
- data/sig/openai/models/live/fork_server_event.rbs +5 -0
- data/sig/openai/models/live/media_session_config.rbs +58 -11
- data/sig/openai/models/live/output_audio_fixture_play_event.rbs +42 -0
- data/sig/openai/models/live/output_audio_fixture_played_event.rbs +44 -0
- data/sig/openai/models/live/output_audio_fixture_playing_event.rbs +44 -0
- data/sig/openai/models/live/server_event.rbs +5 -0
- data/sig/openai/models/live/session_accept_params.rbs +57 -10
- data/sig/openai/models/live/session_config.rbs +58 -11
- data/sig/openai/models/live/session_resource.rbs +57 -10
- data/sig/openai/models/live/session_update_config.rbs +54 -3
- data/sig/openai/models/live/session_update_event.rbs +6 -6
- data/sig/openai/models/live/sideband_client_event.rbs +26 -0
- data/sig/openai/models/live/sideband_server_event.rbs +33 -0
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +6 -3
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +6 -3
- data/sig/openai/models/realtime/realtime_response_status.rbs +15 -3
- data/sig/openai/models/responses/response.rbs +2 -4
- data/sig/openai/models/responses/response_create_params.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +19 -3
- data/sig/openai/models/responses/response_input_item.rbs +110 -0
- data/sig/openai/models/responses/response_item.rbs +110 -0
- data/sig/openai/models/responses/response_output_item.rbs +110 -0
- data/sig/openai/models/responses/responses_client_event.rbs +2 -2
- data/sig/openai/models/safety/safety_alert.rbs +12 -2
- data/sig/openai/models/video_create_error.rbs +19 -3
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -1
- data/sig/openai/resources/admin/organization/projects/api_keys.rbs +8 -0
- data/sig/openai/resources/admin/organization/usage.rbs +15 -0
- data/sig/openai/resources/beta/agents/environments/files.rbs +0 -17
- data/sig/openai/resources/beta/agents/sessions/artifacts.rbs +2 -6
- data/sig/openai/resources/beta/agents/sessions.rbs +4 -1
- data/sig/openai/resources/beta/agents/vaults/credentials.rbs +2 -1
- data/sig/openai/resources/beta/agents/vaults.rbs +9 -1
- data/sig/openai/resources/beta/agents.rbs +1 -1
- data/sig/openai/resources/files.rbs +0 -7
- data/sig/openai/resources/live/forks.rbs +8 -0
- data/sig/openai/resources/live/sideband.rbs +8 -0
- data/sig/openai/resources/live.rbs +7 -0
- data/sig/openai/resources/realtime/translations.rbs +7 -0
- data/sig/openai/resources/realtime.rbs +7 -0
- data/sig/openai/resources/responses.rbs +7 -31
- data/sig/openai/resources/vector_stores/file_batches.rbs +0 -31
- data/sig/openai/resources/vector_stores/files.rbs +0 -36
- data/sig/openai/resources/webhooks.rbs +1 -1
- metadata +89 -1
|
@@ -23,7 +23,7 @@ module OpenAI
|
|
|
23
23
|
# [text](https://developers.openai.com/api/docs/guides/text),
|
|
24
24
|
# [images](https://developers.openai.com/api/docs/guides/images-vision), and
|
|
25
25
|
# [audio](https://developers.openai.com/api/docs/guides/audio).
|
|
26
|
-
sig
|
|
26
|
+
sig {
|
|
27
27
|
returns(
|
|
28
28
|
T::Array[
|
|
29
29
|
T.any(
|
|
@@ -36,8 +36,7 @@ module OpenAI
|
|
|
36
36
|
)
|
|
37
37
|
]
|
|
38
38
|
)
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
}
|
|
41
40
|
attr_accessor :messages
|
|
42
41
|
|
|
43
42
|
# Model ID used to generate the response, like `gpt-6-astra` or `o3`. OpenAI
|
|
@@ -77,7 +76,7 @@ module OpenAI
|
|
|
77
76
|
#
|
|
78
77
|
# `none` is the default when no functions are present. `auto` is the default if
|
|
79
78
|
# functions are present.
|
|
80
|
-
sig
|
|
79
|
+
sig {
|
|
81
80
|
returns(
|
|
82
81
|
T.nilable(
|
|
83
82
|
T.any(
|
|
@@ -86,11 +85,10 @@ module OpenAI
|
|
|
86
85
|
)
|
|
87
86
|
)
|
|
88
87
|
)
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
}
|
|
91
89
|
attr_reader :function_call
|
|
92
90
|
|
|
93
|
-
sig
|
|
91
|
+
sig {
|
|
94
92
|
params(
|
|
95
93
|
function_call: T.any(
|
|
96
94
|
OpenAI::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::OrSymbol,
|
|
@@ -98,8 +96,7 @@ module OpenAI
|
|
|
98
96
|
)
|
|
99
97
|
)
|
|
100
98
|
.void
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
}
|
|
103
100
|
attr_writer :function_call
|
|
104
101
|
|
|
105
102
|
# Deprecated in favor of `tools`.
|
|
@@ -265,38 +262,36 @@ module OpenAI
|
|
|
265
262
|
# Setting to `{ "type": "json_object" }` enables the older JSON mode, which
|
|
266
263
|
# ensures the message the model generates is valid JSON. Using `json_schema` is
|
|
267
264
|
# preferred for models that support it.
|
|
268
|
-
sig
|
|
265
|
+
sig {
|
|
269
266
|
returns(
|
|
270
|
-
T.
|
|
271
|
-
T.
|
|
272
|
-
OpenAI::ResponseFormatText,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
OpenAI::ResponseFormatJSONObject
|
|
276
|
-
)
|
|
267
|
+
T.any(
|
|
268
|
+
T.nilable(
|
|
269
|
+
T.any(OpenAI::ResponseFormatText, OpenAI::ResponseFormatJSONSchema, OpenAI::ResponseFormatJSONObject)
|
|
270
|
+
),
|
|
271
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
277
272
|
)
|
|
278
273
|
)
|
|
279
|
-
|
|
280
|
-
|
|
274
|
+
}
|
|
281
275
|
attr_reader :response_format
|
|
282
276
|
|
|
283
|
-
sig
|
|
277
|
+
sig {
|
|
284
278
|
params(
|
|
285
279
|
response_format: T.any(
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
280
|
+
T.any(
|
|
281
|
+
OpenAI::ResponseFormatText::OrHash,
|
|
282
|
+
OpenAI::ResponseFormatJSONSchema::OrHash,
|
|
283
|
+
OpenAI::ResponseFormatJSONObject::OrHash
|
|
284
|
+
),
|
|
285
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
290
286
|
)
|
|
291
287
|
)
|
|
292
288
|
.void
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
}
|
|
295
290
|
attr_writer :response_format
|
|
296
291
|
|
|
297
292
|
# A stable identifier used to help detect users of your application that may be
|
|
298
293
|
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
299
|
-
# identifies each user, with a maximum length of
|
|
294
|
+
# identifies each user, with a maximum length of 128 characters. We recommend
|
|
300
295
|
# hashing their username or email address, in order to avoid sending us any
|
|
301
296
|
# identifying information.
|
|
302
297
|
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
@@ -375,7 +370,7 @@ module OpenAI
|
|
|
375
370
|
#
|
|
376
371
|
# `none` is the default when no tools are present. `auto` is the default if tools
|
|
377
372
|
# are present.
|
|
378
|
-
sig
|
|
373
|
+
sig {
|
|
379
374
|
returns(
|
|
380
375
|
T.nilable(
|
|
381
376
|
T.any(
|
|
@@ -386,11 +381,10 @@ module OpenAI
|
|
|
386
381
|
)
|
|
387
382
|
)
|
|
388
383
|
)
|
|
389
|
-
|
|
390
|
-
|
|
384
|
+
}
|
|
391
385
|
attr_reader :tool_choice
|
|
392
386
|
|
|
393
|
-
sig
|
|
387
|
+
sig {
|
|
394
388
|
params(
|
|
395
389
|
tool_choice: T.any(
|
|
396
390
|
OpenAI::Chat::ChatCompletionToolChoiceOption::Auto::OrSymbol,
|
|
@@ -400,35 +394,31 @@ module OpenAI
|
|
|
400
394
|
)
|
|
401
395
|
)
|
|
402
396
|
.void
|
|
403
|
-
|
|
404
|
-
|
|
397
|
+
}
|
|
405
398
|
attr_writer :tool_choice
|
|
406
399
|
|
|
407
400
|
# A list of tools the model may call. You can provide either
|
|
408
401
|
# [custom tools](https://developers.openai.com/api/docs/guides/function-calling#custom-tools)
|
|
409
402
|
# or
|
|
410
403
|
# [function tools](https://developers.openai.com/api/docs/guides/function-calling).
|
|
411
|
-
sig
|
|
404
|
+
sig {
|
|
412
405
|
returns(
|
|
413
406
|
T.nilable(T::Array[T.any(OpenAI::Chat::ChatCompletionFunctionTool, OpenAI::Chat::ChatCompletionCustomTool)])
|
|
414
407
|
)
|
|
415
|
-
|
|
416
|
-
|
|
408
|
+
}
|
|
417
409
|
attr_reader :tools
|
|
418
410
|
|
|
419
|
-
sig
|
|
411
|
+
sig {
|
|
420
412
|
params(
|
|
421
413
|
tools: T::Array[
|
|
422
414
|
T.any(
|
|
423
|
-
OpenAI::
|
|
424
|
-
OpenAI::
|
|
425
|
-
OpenAI::Chat::ChatCompletionCustomTool::OrHash
|
|
415
|
+
T.any(OpenAI::Chat::ChatCompletionFunctionTool::OrHash, OpenAI::Chat::ChatCompletionCustomTool::OrHash),
|
|
416
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
426
417
|
)
|
|
427
418
|
]
|
|
428
419
|
)
|
|
429
420
|
.void
|
|
430
|
-
|
|
431
|
-
|
|
421
|
+
}
|
|
432
422
|
attr_writer :tools
|
|
433
423
|
|
|
434
424
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
@@ -531,10 +521,12 @@ module OpenAI
|
|
|
531
521
|
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
532
522
|
|
|
533
523
|
response_format: T.any(
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
524
|
+
T.any(
|
|
525
|
+
OpenAI::ResponseFormatText::OrHash,
|
|
526
|
+
OpenAI::ResponseFormatJSONSchema::OrHash,
|
|
527
|
+
OpenAI::ResponseFormatJSONObject::OrHash
|
|
528
|
+
),
|
|
529
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
538
530
|
),
|
|
539
531
|
|
|
540
532
|
safety_identifier: T.nilable(String),
|
|
@@ -560,9 +552,8 @@ module OpenAI
|
|
|
560
552
|
|
|
561
553
|
tools: T::Array[
|
|
562
554
|
T.any(
|
|
563
|
-
OpenAI::
|
|
564
|
-
OpenAI::
|
|
565
|
-
OpenAI::Chat::ChatCompletionCustomTool::OrHash
|
|
555
|
+
T.any(OpenAI::Chat::ChatCompletionFunctionTool::OrHash, OpenAI::Chat::ChatCompletionCustomTool::OrHash),
|
|
556
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
566
557
|
)
|
|
567
558
|
],
|
|
568
559
|
|
|
@@ -759,7 +750,7 @@ module OpenAI
|
|
|
759
750
|
|
|
760
751
|
# A stable identifier used to help detect users of your application that may be
|
|
761
752
|
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
762
|
-
# identifies each user, with a maximum length of
|
|
753
|
+
# identifies each user, with a maximum length of 128 characters. We recommend
|
|
763
754
|
# hashing their username or email address, in order to avoid sending us any
|
|
764
755
|
# identifying information.
|
|
765
756
|
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
@@ -927,9 +918,8 @@ module OpenAI
|
|
|
927
918
|
),
|
|
928
919
|
tools: T::Array[
|
|
929
920
|
T.any(
|
|
930
|
-
OpenAI::
|
|
931
|
-
OpenAI::
|
|
932
|
-
OpenAI::Chat::ChatCompletionCustomTool
|
|
921
|
+
T.any(OpenAI::Chat::ChatCompletionFunctionTool, OpenAI::Chat::ChatCompletionCustomTool),
|
|
922
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
933
923
|
)
|
|
934
924
|
],
|
|
935
925
|
top_logprobs: T.nilable(Integer),
|
|
@@ -977,12 +967,12 @@ module OpenAI
|
|
|
977
967
|
module FunctionCall
|
|
978
968
|
extend OpenAI::Internal::Type::Union
|
|
979
969
|
|
|
980
|
-
Variants = T.type_alias
|
|
970
|
+
Variants = T.type_alias {
|
|
981
971
|
T.any(
|
|
982
972
|
OpenAI::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::TaggedSymbol,
|
|
983
973
|
OpenAI::Chat::ChatCompletionFunctionCallOption
|
|
984
974
|
)
|
|
985
|
-
|
|
975
|
+
}
|
|
986
976
|
|
|
987
977
|
# `none` means the model will not call a function and instead generates a message.
|
|
988
978
|
# `auto` means the model can pick between generating a message or calling a
|
|
@@ -998,11 +988,11 @@ module OpenAI
|
|
|
998
988
|
NONE = T.let(:none, OpenAI::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::TaggedSymbol)
|
|
999
989
|
AUTO = T.let(:auto, OpenAI::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::TaggedSymbol)
|
|
1000
990
|
|
|
1001
|
-
sig
|
|
991
|
+
sig {
|
|
1002
992
|
override.returns(
|
|
1003
993
|
T::Array[OpenAI::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::TaggedSymbol]
|
|
1004
994
|
)
|
|
1005
|
-
|
|
995
|
+
}
|
|
1006
996
|
def self.values
|
|
1007
997
|
end
|
|
1008
998
|
end
|
|
@@ -1262,11 +1252,11 @@ module OpenAI
|
|
|
1262
1252
|
OpenAI::Chat::CompletionCreateParams::Moderation::Policy::Input::Mode::TaggedSymbol
|
|
1263
1253
|
)
|
|
1264
1254
|
|
|
1265
|
-
sig
|
|
1255
|
+
sig {
|
|
1266
1256
|
override.returns(
|
|
1267
1257
|
T::Array[OpenAI::Chat::CompletionCreateParams::Moderation::Policy::Input::Mode::TaggedSymbol]
|
|
1268
1258
|
)
|
|
1269
|
-
|
|
1259
|
+
}
|
|
1270
1260
|
def self.values
|
|
1271
1261
|
end
|
|
1272
1262
|
end
|
|
@@ -1322,11 +1312,11 @@ module OpenAI
|
|
|
1322
1312
|
OpenAI::Chat::CompletionCreateParams::Moderation::Policy::Output::Mode::TaggedSymbol
|
|
1323
1313
|
)
|
|
1324
1314
|
|
|
1325
|
-
sig
|
|
1315
|
+
sig {
|
|
1326
1316
|
override.returns(
|
|
1327
1317
|
T::Array[OpenAI::Chat::CompletionCreateParams::Moderation::Policy::Output::Mode::TaggedSymbol]
|
|
1328
1318
|
)
|
|
1329
|
-
|
|
1319
|
+
}
|
|
1330
1320
|
def self.values
|
|
1331
1321
|
end
|
|
1332
1322
|
end
|
|
@@ -1502,14 +1492,12 @@ module OpenAI
|
|
|
1502
1492
|
module ResponseFormat
|
|
1503
1493
|
extend OpenAI::Internal::Type::Union
|
|
1504
1494
|
|
|
1505
|
-
Variants = T.type_alias
|
|
1495
|
+
Variants = T.type_alias {
|
|
1506
1496
|
T.any(
|
|
1507
|
-
OpenAI::ResponseFormatText,
|
|
1508
|
-
OpenAI::
|
|
1509
|
-
OpenAI::StructuredOutput::JsonSchemaConverter,
|
|
1510
|
-
OpenAI::ResponseFormatJSONObject
|
|
1497
|
+
T.any(OpenAI::ResponseFormatText, OpenAI::ResponseFormatJSONSchema, OpenAI::ResponseFormatJSONObject),
|
|
1498
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
1511
1499
|
)
|
|
1512
|
-
|
|
1500
|
+
}
|
|
1513
1501
|
|
|
1514
1502
|
sig { override.returns(T::Array[OpenAI::Chat::CompletionCreateParams::ResponseFormat::Variants]) }
|
|
1515
1503
|
def self.variants
|
|
@@ -1611,26 +1599,24 @@ module OpenAI
|
|
|
1611
1599
|
}
|
|
1612
1600
|
attr_reader :search_context_size
|
|
1613
1601
|
|
|
1614
|
-
sig
|
|
1602
|
+
sig {
|
|
1615
1603
|
params(
|
|
1616
1604
|
search_context_size: OpenAI::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::OrSymbol
|
|
1617
1605
|
)
|
|
1618
1606
|
.void
|
|
1619
|
-
|
|
1620
|
-
|
|
1607
|
+
}
|
|
1621
1608
|
attr_writer :search_context_size
|
|
1622
1609
|
|
|
1623
1610
|
# Approximate location parameters for the search.
|
|
1624
1611
|
sig { returns(T.nilable(OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation)) }
|
|
1625
1612
|
attr_reader :user_location
|
|
1626
1613
|
|
|
1627
|
-
sig
|
|
1614
|
+
sig {
|
|
1628
1615
|
params(
|
|
1629
1616
|
user_location: T.nilable(OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::OrHash)
|
|
1630
1617
|
)
|
|
1631
1618
|
.void
|
|
1632
|
-
|
|
1633
|
-
|
|
1619
|
+
}
|
|
1634
1620
|
attr_writer :user_location
|
|
1635
1621
|
|
|
1636
1622
|
# This tool searches the web for relevant results to use in a response. Learn more
|
|
@@ -1685,11 +1671,11 @@ module OpenAI
|
|
|
1685
1671
|
)
|
|
1686
1672
|
HIGH = T.let(:high, OpenAI::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::TaggedSymbol)
|
|
1687
1673
|
|
|
1688
|
-
sig
|
|
1674
|
+
sig {
|
|
1689
1675
|
override.returns(
|
|
1690
1676
|
T::Array[OpenAI::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::TaggedSymbol]
|
|
1691
1677
|
)
|
|
1692
|
-
|
|
1678
|
+
}
|
|
1693
1679
|
def self.values
|
|
1694
1680
|
end
|
|
1695
1681
|
end
|
|
@@ -1706,13 +1692,12 @@ module OpenAI
|
|
|
1706
1692
|
sig { returns(OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate) }
|
|
1707
1693
|
attr_reader :approximate
|
|
1708
1694
|
|
|
1709
|
-
sig
|
|
1695
|
+
sig {
|
|
1710
1696
|
params(
|
|
1711
1697
|
approximate: OpenAI::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate::OrHash
|
|
1712
1698
|
)
|
|
1713
1699
|
.void
|
|
1714
|
-
|
|
1715
|
-
|
|
1700
|
+
}
|
|
1716
1701
|
attr_writer :approximate
|
|
1717
1702
|
|
|
1718
1703
|
# The type of location approximation. Always `approximate`.
|
|
@@ -83,6 +83,13 @@ module OpenAI
|
|
|
83
83
|
}
|
|
84
84
|
attr_accessor :background
|
|
85
85
|
|
|
86
|
+
# Details of a moderation failure, when available.
|
|
87
|
+
sig { returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error)) }
|
|
88
|
+
attr_reader :error
|
|
89
|
+
|
|
90
|
+
sig { params(error: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::OrHash).void }
|
|
91
|
+
attr_writer :error
|
|
92
|
+
|
|
86
93
|
# The output format used for generation.
|
|
87
94
|
sig {
|
|
88
95
|
returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::OutputFormat::TaggedSymbol))
|
|
@@ -118,6 +125,8 @@ module OpenAI
|
|
|
118
125
|
|
|
119
126
|
background: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Background::OrSymbol),
|
|
120
127
|
|
|
128
|
+
error: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::OrHash,
|
|
129
|
+
|
|
121
130
|
output_format: T.nilable(
|
|
122
131
|
OpenAI::Conversations::ConversationItem::ImageGenerationCall::OutputFormat::OrSymbol
|
|
123
132
|
),
|
|
@@ -151,6 +160,9 @@ module OpenAI
|
|
|
151
160
|
# The background setting used for generation.
|
|
152
161
|
background: nil,
|
|
153
162
|
|
|
163
|
+
# Details of a moderation failure, when available.
|
|
164
|
+
error: nil,
|
|
165
|
+
|
|
154
166
|
# The output format used for generation.
|
|
155
167
|
output_format: nil,
|
|
156
168
|
|
|
@@ -181,6 +193,7 @@ module OpenAI
|
|
|
181
193
|
background: T.nilable(
|
|
182
194
|
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Background::TaggedSymbol
|
|
183
195
|
),
|
|
196
|
+
error: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error,
|
|
184
197
|
output_format: T.nilable(
|
|
185
198
|
OpenAI::Conversations::ConversationItem::ImageGenerationCall::OutputFormat::TaggedSymbol
|
|
186
199
|
),
|
|
@@ -278,6 +291,184 @@ module OpenAI
|
|
|
278
291
|
end
|
|
279
292
|
end
|
|
280
293
|
|
|
294
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
295
|
+
OrHash = T.type_alias do
|
|
296
|
+
T.any(
|
|
297
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error,
|
|
298
|
+
OpenAI::Internal::AnyHash
|
|
299
|
+
)
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# The error code.
|
|
303
|
+
sig { returns(T.nilable(String)) }
|
|
304
|
+
attr_accessor :code
|
|
305
|
+
|
|
306
|
+
# A description of the error.
|
|
307
|
+
sig { returns(String) }
|
|
308
|
+
attr_accessor :message
|
|
309
|
+
|
|
310
|
+
# The related request parameter.
|
|
311
|
+
sig { returns(T.nilable(String)) }
|
|
312
|
+
attr_accessor :param
|
|
313
|
+
|
|
314
|
+
# The error type.
|
|
315
|
+
sig { returns(String) }
|
|
316
|
+
attr_accessor :type
|
|
317
|
+
|
|
318
|
+
# Public details for a `moderation_blocked` error, when available.
|
|
319
|
+
sig {
|
|
320
|
+
returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails))
|
|
321
|
+
}
|
|
322
|
+
attr_reader :moderation_details
|
|
323
|
+
|
|
324
|
+
sig {
|
|
325
|
+
params(
|
|
326
|
+
moderation_details: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::OrHash
|
|
327
|
+
)
|
|
328
|
+
.void
|
|
329
|
+
}
|
|
330
|
+
attr_writer :moderation_details
|
|
331
|
+
|
|
332
|
+
# Details of a moderation failure, when available.
|
|
333
|
+
sig do
|
|
334
|
+
params(
|
|
335
|
+
|
|
336
|
+
code: T.nilable(String),
|
|
337
|
+
|
|
338
|
+
message: String,
|
|
339
|
+
|
|
340
|
+
param: T.nilable(String),
|
|
341
|
+
|
|
342
|
+
type: String,
|
|
343
|
+
|
|
344
|
+
moderation_details: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::OrHash
|
|
345
|
+
)
|
|
346
|
+
.returns(T.attached_class)
|
|
347
|
+
end
|
|
348
|
+
def self.new(
|
|
349
|
+
|
|
350
|
+
# The error code.
|
|
351
|
+
code:,
|
|
352
|
+
|
|
353
|
+
# A description of the error.
|
|
354
|
+
message:,
|
|
355
|
+
|
|
356
|
+
# The related request parameter.
|
|
357
|
+
param:,
|
|
358
|
+
|
|
359
|
+
# The error type.
|
|
360
|
+
type:,
|
|
361
|
+
|
|
362
|
+
# Public details for a `moderation_blocked` error, when available.
|
|
363
|
+
|
|
364
|
+
moderation_details: nil
|
|
365
|
+
)
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
sig do
|
|
369
|
+
override.returns(
|
|
370
|
+
{
|
|
371
|
+
code: T.nilable(String),
|
|
372
|
+
message: String,
|
|
373
|
+
param: T.nilable(String),
|
|
374
|
+
type: String,
|
|
375
|
+
moderation_details: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
end
|
|
379
|
+
def to_hash
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
class ModerationDetails < OpenAI::Internal::Type::BaseModel
|
|
383
|
+
OrHash = T.type_alias do
|
|
384
|
+
T.any(
|
|
385
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails,
|
|
386
|
+
OpenAI::Internal::AnyHash
|
|
387
|
+
)
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
# Public moderation categories. New category values may be added over time.
|
|
391
|
+
sig { returns(T::Array[String]) }
|
|
392
|
+
attr_accessor :categories
|
|
393
|
+
|
|
394
|
+
# The stage where moderation blocked the image generation call.
|
|
395
|
+
sig {
|
|
396
|
+
returns(
|
|
397
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::TaggedSymbol
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
attr_accessor :moderation_stage
|
|
401
|
+
|
|
402
|
+
# Public details for a `moderation_blocked` error, when available.
|
|
403
|
+
sig do
|
|
404
|
+
params(
|
|
405
|
+
|
|
406
|
+
categories: T::Array[String],
|
|
407
|
+
|
|
408
|
+
moderation_stage: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::OrSymbol
|
|
409
|
+
)
|
|
410
|
+
.returns(T.attached_class)
|
|
411
|
+
end
|
|
412
|
+
def self.new(
|
|
413
|
+
|
|
414
|
+
# Public moderation categories. New category values may be added over time.
|
|
415
|
+
categories:,
|
|
416
|
+
|
|
417
|
+
# The stage where moderation blocked the image generation call.
|
|
418
|
+
|
|
419
|
+
moderation_stage:
|
|
420
|
+
)
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
sig do
|
|
424
|
+
override.returns(
|
|
425
|
+
{
|
|
426
|
+
categories: T::Array[String],
|
|
427
|
+
moderation_stage: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::TaggedSymbol
|
|
428
|
+
}
|
|
429
|
+
)
|
|
430
|
+
end
|
|
431
|
+
def to_hash
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
# The stage where moderation blocked the image generation call.
|
|
435
|
+
module ModerationStage
|
|
436
|
+
extend OpenAI::Internal::Type::Enum
|
|
437
|
+
|
|
438
|
+
TaggedSymbol = T.type_alias {
|
|
439
|
+
T.all(
|
|
440
|
+
Symbol,
|
|
441
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage
|
|
442
|
+
)
|
|
443
|
+
}
|
|
444
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
445
|
+
|
|
446
|
+
INPUT = T.let(
|
|
447
|
+
:input,
|
|
448
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::TaggedSymbol
|
|
449
|
+
)
|
|
450
|
+
OUTPUT = T.let(
|
|
451
|
+
:output,
|
|
452
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::TaggedSymbol
|
|
453
|
+
)
|
|
454
|
+
UNKNOWN = T.let(
|
|
455
|
+
:unknown,
|
|
456
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::TaggedSymbol
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
sig {
|
|
460
|
+
override.returns(
|
|
461
|
+
T::Array[
|
|
462
|
+
OpenAI::Conversations::ConversationItem::ImageGenerationCall::Error::ModerationDetails::ModerationStage::TaggedSymbol
|
|
463
|
+
]
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
def self.values
|
|
467
|
+
end
|
|
468
|
+
end
|
|
469
|
+
end
|
|
470
|
+
end
|
|
471
|
+
|
|
281
472
|
# The output format used for generation.
|
|
282
473
|
module OutputFormat
|
|
283
474
|
extend OpenAI::Internal::Type::Enum
|
|
@@ -12,12 +12,17 @@ module OpenAI
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# Answers in question order. Any question can return a refusal instead of an
|
|
16
|
+
# answer; other questions can still receive answers. A refusal has
|
|
17
|
+
# `type: "refusal"` and the question's `name`, or `null` if it was unnamed.
|
|
15
18
|
sig { returns(T::Array[OpenAI::Decision::Answer::Variants]) }
|
|
16
19
|
attr_accessor :answers
|
|
17
20
|
|
|
21
|
+
# The model used.
|
|
18
22
|
sig { returns(String) }
|
|
19
23
|
attr_accessor :model
|
|
20
24
|
|
|
25
|
+
# Token usage for the request.
|
|
21
26
|
sig { returns(OpenAI::Decision::Usage) }
|
|
22
27
|
attr_reader :usage
|
|
23
28
|
|
|
@@ -44,10 +49,16 @@ module OpenAI
|
|
|
44
49
|
end
|
|
45
50
|
def self.new(
|
|
46
51
|
|
|
52
|
+
# Answers in question order. Any question can return a refusal instead of an
|
|
53
|
+
# answer; other questions can still receive answers. A refusal has
|
|
54
|
+
# `type: "refusal"` and the question's `name`, or `null` if it was unnamed.
|
|
47
55
|
answers:,
|
|
48
56
|
|
|
57
|
+
# The model used.
|
|
49
58
|
model:,
|
|
50
59
|
|
|
60
|
+
# Token usage for the request.
|
|
61
|
+
|
|
51
62
|
usage:
|
|
52
63
|
)
|
|
53
64
|
end
|
|
@@ -396,7 +407,8 @@ module OpenAI
|
|
|
396
407
|
sig { returns(Symbol) }
|
|
397
408
|
attr_accessor :type
|
|
398
409
|
|
|
399
|
-
# The
|
|
410
|
+
# The model declined to answer this question. Other questions in the same request
|
|
411
|
+
# can still receive answers.
|
|
400
412
|
sig do
|
|
401
413
|
params(
|
|
402
414
|
|
|
@@ -461,6 +473,7 @@ module OpenAI
|
|
|
461
473
|
sig { returns(Integer) }
|
|
462
474
|
attr_accessor :total_tokens
|
|
463
475
|
|
|
476
|
+
# Token usage for the request.
|
|
464
477
|
sig do
|
|
465
478
|
params(
|
|
466
479
|
|