openai 0.103.0 → 0.105.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 +98 -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 +15 -3
- data/lib/openai/models/image_edit_params.rb +28 -5
- data/lib/openai/models/image_edit_partial_image_event.rb +1 -2
- data/lib/openai/models/image_gen_completed_event.rb +15 -3
- data/lib/openai/models/image_gen_partial_image_event.rb +1 -2
- data/lib/openai/models/image_generate_params.rb +28 -5
- data/lib/openai/models/images_response.rb +15 -3
- 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/images.rb +50 -12
- 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 +16 -1
- data/rbi/openai/models/image_edit_params.rbi +26 -4
- data/rbi/openai/models/image_edit_partial_image_event.rbi +1 -0
- data/rbi/openai/models/image_gen_completed_event.rbi +16 -1
- data/rbi/openai/models/image_gen_partial_image_event.rbi +1 -0
- data/rbi/openai/models/image_generate_params.rbi +26 -4
- data/rbi/openai/models/images_response.rbi +15 -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/images.rbi +44 -8
- 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/image_edit_completed_event.rbs +14 -2
- data/sig/openai/models/image_edit_params.rbs +27 -6
- data/sig/openai/models/image_gen_completed_event.rbs +14 -2
- data/sig/openai/models/image_generate_params.rbs +27 -6
- data/sig/openai/models/images_response.rbs +12 -0
- 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/images.rbs +4 -0
- 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
|
@@ -5,24 +5,36 @@ module OpenAI
|
|
|
5
5
|
# @see OpenAI::Resources::Decisions#create
|
|
6
6
|
class Decision < OpenAI::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute answers
|
|
8
|
+
# Answers in question order. Any question can return a refusal instead of an
|
|
9
|
+
# answer; other questions can still receive answers. A refusal has
|
|
10
|
+
# `type: "refusal"` and the question's `name`, or `null` if it was unnamed.
|
|
8
11
|
#
|
|
9
12
|
# @return [Array<OpenAI::Models::Decision::Answer::Predicate, OpenAI::Models::Decision::Answer::Choice, OpenAI::Models::Decision::Answer::Score, OpenAI::Models::Decision::Answer::Refusal>]
|
|
10
13
|
required :answers, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Decision::Answer] }
|
|
11
14
|
|
|
12
15
|
# @!attribute model
|
|
16
|
+
# The model used.
|
|
13
17
|
#
|
|
14
18
|
# @return [String]
|
|
15
19
|
required :model, String
|
|
16
20
|
|
|
17
21
|
# @!attribute usage
|
|
22
|
+
# Token usage for the request.
|
|
18
23
|
#
|
|
19
24
|
# @return [OpenAI::Models::Decision::Usage]
|
|
20
25
|
required :usage, -> { OpenAI::Decision::Usage }
|
|
21
26
|
|
|
22
27
|
# @!method initialize(answers:, model:, usage:)
|
|
23
28
|
# @param answers [Array<OpenAI::Models::Decision::Answer::Predicate, OpenAI::Models::Decision::Answer::Choice, OpenAI::Models::Decision::Answer::Score, OpenAI::Models::Decision::Answer::Refusal>]
|
|
29
|
+
# Answers in question order. Any question can return a refusal instead of an
|
|
30
|
+
# answer; other questions can still receive answers. A refusal has
|
|
31
|
+
# `type: "refusal"` and the question's `name`, or `null` if it was unnamed.
|
|
32
|
+
#
|
|
24
33
|
# @param model [String]
|
|
34
|
+
# The model used.
|
|
35
|
+
#
|
|
25
36
|
# @param usage [OpenAI::Models::Decision::Usage]
|
|
37
|
+
# Token usage for the request.
|
|
26
38
|
|
|
27
39
|
# A completed question always includes its name, including null when unnamed.
|
|
28
40
|
module Answer
|
|
@@ -36,7 +48,7 @@ module OpenAI
|
|
|
36
48
|
|
|
37
49
|
variant :score, -> { OpenAI::Decision::Answer::Score }
|
|
38
50
|
|
|
39
|
-
# The
|
|
51
|
+
# The model declined to answer this question. Other questions in the same request can still receive answers.
|
|
40
52
|
variant :refusal, -> { OpenAI::Decision::Answer::Refusal }
|
|
41
53
|
|
|
42
54
|
class Predicate < OpenAI::Internal::Type::BaseModel
|
|
@@ -234,7 +246,8 @@ module OpenAI
|
|
|
234
246
|
required :type, const: :refusal
|
|
235
247
|
|
|
236
248
|
# @!method initialize(name:, type: :refusal)
|
|
237
|
-
# The
|
|
249
|
+
# The model declined to answer this question. Other questions in the same request
|
|
250
|
+
# can still receive answers.
|
|
238
251
|
#
|
|
239
252
|
# @param name [String, nil]
|
|
240
253
|
#
|
|
@@ -274,6 +287,8 @@ module OpenAI
|
|
|
274
287
|
required :total_tokens, Integer
|
|
275
288
|
|
|
276
289
|
# @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, output_tokens_details:, total_tokens:)
|
|
290
|
+
# Token usage for the request.
|
|
291
|
+
#
|
|
277
292
|
# @param input_tokens [Integer]
|
|
278
293
|
# @param input_tokens_details [OpenAI::Models::Decision::Usage::InputTokensDetails]
|
|
279
294
|
# @param output_tokens [Integer]
|
|
@@ -8,20 +8,23 @@ module OpenAI
|
|
|
8
8
|
include OpenAI::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute input
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
11
|
+
# The text or images to evaluate for every question. Provide a text string or user
|
|
12
|
+
# messages containing text and images. Images can be base64 data URLs or publicly
|
|
13
|
+
# accessible HTTP(S) URLs; at most 128 images are allowed across all messages in
|
|
14
|
+
# one request. Files, audio, tools, and item references are not supported.
|
|
15
15
|
#
|
|
16
16
|
# @return [String, Array<OpenAI::Models::DecisionInputMessage>]
|
|
17
17
|
required :input, union: -> { OpenAI::DecisionCreateParams::Input }
|
|
18
18
|
|
|
19
19
|
# @!attribute model
|
|
20
|
+
# The model to use. Only `gpt-6-luna` is supported.
|
|
20
21
|
#
|
|
21
22
|
# @return [String]
|
|
22
23
|
required :model, String
|
|
23
24
|
|
|
24
25
|
# @!attribute questions
|
|
26
|
+
# Ask 1–200 questions about the input. Each question can be a predicate, choice,
|
|
27
|
+
# or score. Answers come back in the same order.
|
|
25
28
|
#
|
|
26
29
|
# @return [Array<OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score>]
|
|
27
30
|
required :questions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::DecisionCreateParams::Question] }
|
|
@@ -35,14 +38,17 @@ module OpenAI
|
|
|
35
38
|
|
|
36
39
|
# @!method initialize(input:, model:, questions:, safety_identifier: nil, request_options: {})
|
|
37
40
|
# @param input [String, Array<OpenAI::Models::DecisionInputMessage>]
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
41
|
+
# The text or images to evaluate for every question. Provide a text string or user
|
|
42
|
+
# messages containing text and images. Images can be base64 data URLs or publicly
|
|
43
|
+
# accessible HTTP(S) URLs; at most 128 images are allowed across all messages in
|
|
44
|
+
# one request. Files, audio, tools, and item references are not supported.
|
|
42
45
|
#
|
|
43
46
|
# @param model [String]
|
|
47
|
+
# The model to use. Only `gpt-6-luna` is supported.
|
|
44
48
|
#
|
|
45
49
|
# @param questions [Array<OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score>]
|
|
50
|
+
# Ask 1–200 questions about the input. Each question can be a predicate, choice,
|
|
51
|
+
# or score. Answers come back in the same order.
|
|
46
52
|
#
|
|
47
53
|
# @param safety_identifier [String, nil]
|
|
48
54
|
# Opaque caller-provided end-user identifier, scoped by the verified org. Match
|
|
@@ -50,10 +56,10 @@ module OpenAI
|
|
|
50
56
|
#
|
|
51
57
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
52
58
|
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
59
|
+
# The text or images to evaluate for every question. Provide a text string or user
|
|
60
|
+
# messages containing text and images. Images can be base64 data URLs or publicly
|
|
61
|
+
# accessible HTTP(S) URLs; at most 128 images are allowed across all messages in
|
|
62
|
+
# one request. Files, audio, tools, and item references are not supported.
|
|
57
63
|
module Input
|
|
58
64
|
extend OpenAI::Internal::Type::Union
|
|
59
65
|
|
|
@@ -74,10 +80,13 @@ module OpenAI
|
|
|
74
80
|
|
|
75
81
|
discriminator :type
|
|
76
82
|
|
|
83
|
+
# Estimate how likely it is that a statement about the input is true.
|
|
77
84
|
variant :predicate, -> { OpenAI::DecisionCreateParams::Question::Predicate }
|
|
78
85
|
|
|
86
|
+
# Choose from the supplied options based on the input.
|
|
79
87
|
variant :choice, -> { OpenAI::DecisionCreateParams::Question::Choice }
|
|
80
88
|
|
|
89
|
+
# Rate the input against the supplied ordered levels.
|
|
81
90
|
variant :score, -> { OpenAI::DecisionCreateParams::Question::Score }
|
|
82
91
|
|
|
83
92
|
class Predicate < OpenAI::Internal::Type::BaseModel
|
|
@@ -98,6 +107,8 @@ module OpenAI
|
|
|
98
107
|
optional :name, String
|
|
99
108
|
|
|
100
109
|
# @!method initialize(instructions:, name: nil, type: :predicate)
|
|
110
|
+
# Estimate how likely it is that a statement about the input is true.
|
|
111
|
+
#
|
|
101
112
|
# @param instructions [String]
|
|
102
113
|
#
|
|
103
114
|
# @param name [String]
|
|
@@ -108,6 +119,7 @@ module OpenAI
|
|
|
108
119
|
|
|
109
120
|
class Choice < OpenAI::Internal::Type::BaseModel
|
|
110
121
|
# @!attribute choices
|
|
122
|
+
# Provide between 2 and 255 choices. Each choice must be unique.
|
|
111
123
|
#
|
|
112
124
|
# @return [Array<OpenAI::Models::DecisionCreateParams::Question::Choice::Choice>]
|
|
113
125
|
required(
|
|
@@ -132,7 +144,10 @@ module OpenAI
|
|
|
132
144
|
optional :name, String
|
|
133
145
|
|
|
134
146
|
# @!method initialize(choices:, instructions:, name: nil, type: :choice)
|
|
147
|
+
# Choose from the supplied options based on the input.
|
|
148
|
+
#
|
|
135
149
|
# @param choices [Array<OpenAI::Models::DecisionCreateParams::Question::Choice::Choice>]
|
|
150
|
+
# Provide between 2 and 255 choices. Each choice must be unique.
|
|
136
151
|
#
|
|
137
152
|
# @param instructions [String]
|
|
138
153
|
#
|
|
@@ -200,6 +215,8 @@ module OpenAI
|
|
|
200
215
|
optional :name, String
|
|
201
216
|
|
|
202
217
|
# @!method initialize(instructions:, levels:, name: nil, type: :score)
|
|
218
|
+
# Rate the input against the supplied ordered levels.
|
|
219
|
+
#
|
|
203
220
|
# @param instructions [String]
|
|
204
221
|
#
|
|
205
222
|
# @param levels [Array<OpenAI::Models::DecisionCreateParams::Question::Score::Level>]
|
|
@@ -4,7 +4,7 @@ module OpenAI
|
|
|
4
4
|
module Models
|
|
5
5
|
class DecisionInputImage < OpenAI::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute image_url
|
|
7
|
-
# A base64-encoded image in a data URL.
|
|
7
|
+
# A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.
|
|
8
8
|
#
|
|
9
9
|
# @return [String]
|
|
10
10
|
required :image_url, String
|
|
@@ -22,10 +22,11 @@ module OpenAI
|
|
|
22
22
|
optional :detail, enum: -> { OpenAI::DecisionInputImage::Detail }, nil?: true
|
|
23
23
|
|
|
24
24
|
# @!method initialize(image_url:, detail: nil, type: :input_image)
|
|
25
|
-
# An
|
|
25
|
+
# An image provided as a base64 data URL or a publicly accessible HTTP(S) URL.
|
|
26
|
+
# File IDs are not supported.
|
|
26
27
|
#
|
|
27
28
|
# @param image_url [String]
|
|
28
|
-
# A base64-encoded image in a data URL.
|
|
29
|
+
# A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.
|
|
29
30
|
#
|
|
30
31
|
# @param detail [Symbol, OpenAI::Models::DecisionInputImage::Detail, nil]
|
|
31
32
|
# The image detail level, using the selected model's image profile. Defaults to
|
|
@@ -4,7 +4,7 @@ module OpenAI
|
|
|
4
4
|
module Models
|
|
5
5
|
class DecisionInputMessage < OpenAI::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute content
|
|
7
|
-
# Text evidence or an ordered list of text and
|
|
7
|
+
# Text evidence or an ordered list of text and image parts.
|
|
8
8
|
#
|
|
9
9
|
# @return [String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>]
|
|
10
10
|
required :content, union: -> { OpenAI::DecisionInputMessage::Content }
|
|
@@ -20,16 +20,16 @@ module OpenAI
|
|
|
20
20
|
optional :type, enum: -> { OpenAI::DecisionInputMessage::Type }
|
|
21
21
|
|
|
22
22
|
# @!method initialize(content:, type: nil, role: :user)
|
|
23
|
-
# A user message containing text or
|
|
23
|
+
# A user message containing text or images.
|
|
24
24
|
#
|
|
25
25
|
# @param content [String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>]
|
|
26
|
-
# Text evidence or an ordered list of text and
|
|
26
|
+
# Text evidence or an ordered list of text and image parts.
|
|
27
27
|
#
|
|
28
28
|
# @param type [Symbol, OpenAI::Models::DecisionInputMessage::Type]
|
|
29
29
|
#
|
|
30
30
|
# @param role [Symbol, :user]
|
|
31
31
|
|
|
32
|
-
# Text evidence or an ordered list of text and
|
|
32
|
+
# Text evidence or an ordered list of text and image parts.
|
|
33
33
|
#
|
|
34
34
|
# @see OpenAI::Models::DecisionInputMessage#content
|
|
35
35
|
module Content
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
|
-
# An
|
|
5
|
+
# An image provided as a base64 data URL or a publicly accessible HTTP(S) URL.
|
|
6
|
+
# File IDs are not supported.
|
|
6
7
|
module DecisionInputPart
|
|
7
8
|
extend OpenAI::Internal::Type::Union
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ module OpenAI
|
|
|
10
11
|
|
|
11
12
|
variant :input_text, -> { OpenAI::DecisionInputText }
|
|
12
13
|
|
|
13
|
-
# An
|
|
14
|
+
# An image provided as a base64 data URL or a publicly accessible HTTP(S) URL. File IDs are not supported.
|
|
14
15
|
variant :input_image, -> { OpenAI::DecisionInputImage }
|
|
15
16
|
|
|
16
17
|
# @!method self.variants
|
|
@@ -52,7 +52,15 @@ module OpenAI
|
|
|
52
52
|
# @return [OpenAI::Models::ImageEditCompletedEvent::Usage]
|
|
53
53
|
required :usage, -> { OpenAI::ImageEditCompletedEvent::Usage }
|
|
54
54
|
|
|
55
|
-
# @!
|
|
55
|
+
# @!attribute safety_identifier
|
|
56
|
+
# The effective safety identifier used for safety monitoring and abuse detection.
|
|
57
|
+
# This is the non-empty `safety_identifier` from the request, or the deprecated
|
|
58
|
+
# `user` value when `safety_identifier` is omitted, null, or empty.
|
|
59
|
+
#
|
|
60
|
+
# @return [String, nil]
|
|
61
|
+
optional :safety_identifier, String, nil?: true
|
|
62
|
+
|
|
63
|
+
# @!method initialize(b64_json:, background:, created_at:, output_format:, quality:, size:, usage:, safety_identifier: nil, type: :"image_edit.completed")
|
|
56
64
|
# Emitted when image editing has completed and the final image is available.
|
|
57
65
|
#
|
|
58
66
|
# @param b64_json [String]
|
|
@@ -77,6 +85,11 @@ module OpenAI
|
|
|
77
85
|
# For the GPT image models only, the token usage information for the image
|
|
78
86
|
# generation.
|
|
79
87
|
#
|
|
88
|
+
# @param safety_identifier [String, nil]
|
|
89
|
+
# The effective safety identifier used for safety monitoring and abuse detection.
|
|
90
|
+
# This is the non-empty `safety_identifier` from the request, or the deprecated
|
|
91
|
+
# `user` value when `safety_identifier` is omitted, null, or empty.
|
|
92
|
+
#
|
|
80
93
|
# @param type [Symbol, :"image_edit.completed"]
|
|
81
94
|
# The type of the event. Always `image_edit.completed`.
|
|
82
95
|
|
|
@@ -139,7 +152,6 @@ module OpenAI
|
|
|
139
152
|
|
|
140
153
|
variant const: -> { OpenAI::Models::ImageEditCompletedEvent::Size::AUTO }
|
|
141
154
|
|
|
142
|
-
# Keep known dimensions as symbols when reading existing API responses.
|
|
143
155
|
variant String
|
|
144
156
|
|
|
145
157
|
# @!method self.variants
|
|
@@ -158,7 +170,7 @@ module OpenAI
|
|
|
158
170
|
|
|
159
171
|
# @!endgroup
|
|
160
172
|
|
|
161
|
-
# Preserve the enum helper available before
|
|
173
|
+
# Preserve the enum helper available before arbitrary strings were supported.
|
|
162
174
|
#
|
|
163
175
|
# @return [Array<Symbol>]
|
|
164
176
|
def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO]
|
|
@@ -130,6 +130,17 @@ module OpenAI
|
|
|
130
130
|
# @return [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil]
|
|
131
131
|
optional :response_format, enum: -> { OpenAI::ImageEditParams::ResponseFormat }, nil?: true
|
|
132
132
|
|
|
133
|
+
# @!attribute safety_identifier
|
|
134
|
+
# A stable identifier for an end user in your organization, used for safety
|
|
135
|
+
# monitoring and abuse detection. Hash a username or email address to avoid
|
|
136
|
+
# sending identifying information. A non-empty value takes precedence over the
|
|
137
|
+
# deprecated `user` parameter. If omitted, null, or empty, the API uses `user`
|
|
138
|
+
# when available.
|
|
139
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
140
|
+
#
|
|
141
|
+
# @return [String, nil]
|
|
142
|
+
optional :safety_identifier, String, nil?: true
|
|
143
|
+
|
|
133
144
|
# @!attribute size
|
|
134
145
|
# The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
|
|
135
146
|
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
@@ -147,14 +158,17 @@ module OpenAI
|
|
|
147
158
|
optional :size, union: -> { OpenAI::ImageEditParams::Size }, nil?: true
|
|
148
159
|
|
|
149
160
|
# @!attribute user
|
|
150
|
-
#
|
|
151
|
-
#
|
|
161
|
+
# @deprecated
|
|
162
|
+
#
|
|
163
|
+
# Deprecated: use `safety_identifier` instead. This parameter remains accepted for
|
|
164
|
+
# backward compatibility and is used when `safety_identifier` is omitted, null, or
|
|
165
|
+
# empty.
|
|
152
166
|
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
153
167
|
#
|
|
154
168
|
# @return [String, nil]
|
|
155
169
|
optional :user, String
|
|
156
170
|
|
|
157
|
-
# @!method initialize(image:, prompt:, background: nil, input_fidelity: nil, mask: nil, model: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, user: nil, request_options: {})
|
|
171
|
+
# @!method initialize(image:, prompt:, background: nil, input_fidelity: nil, mask: nil, model: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, safety_identifier: nil, size: nil, user: nil, request_options: {})
|
|
158
172
|
# @param image [Pathname, StringIO, IO, String, OpenAI::FilePart, Array<Pathname, StringIO, IO, String, OpenAI::FilePart>]
|
|
159
173
|
# The image(s) to edit. Must be a supported image file or an array of images.
|
|
160
174
|
#
|
|
@@ -238,6 +252,14 @@ module OpenAI
|
|
|
238
252
|
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
239
253
|
# image models, which always return base64-encoded images.
|
|
240
254
|
#
|
|
255
|
+
# @param safety_identifier [String, nil]
|
|
256
|
+
# A stable identifier for an end user in your organization, used for safety
|
|
257
|
+
# monitoring and abuse detection. Hash a username or email address to avoid
|
|
258
|
+
# sending identifying information. A non-empty value takes precedence over the
|
|
259
|
+
# deprecated `user` parameter. If omitted, null, or empty, the API uses `user`
|
|
260
|
+
# when available.
|
|
261
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
262
|
+
#
|
|
241
263
|
# @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil]
|
|
242
264
|
# The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
|
|
243
265
|
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
@@ -252,8 +274,9 @@ module OpenAI
|
|
|
252
274
|
# models that allow automatic sizing.
|
|
253
275
|
#
|
|
254
276
|
# @param user [String]
|
|
255
|
-
#
|
|
256
|
-
# and
|
|
277
|
+
# Deprecated: use `safety_identifier` instead. This parameter remains accepted for
|
|
278
|
+
# backward compatibility and is used when `safety_identifier` is omitted, null, or
|
|
279
|
+
# empty.
|
|
257
280
|
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
258
281
|
#
|
|
259
282
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -137,7 +137,6 @@ module OpenAI
|
|
|
137
137
|
|
|
138
138
|
variant const: -> { OpenAI::Models::ImageEditPartialImageEvent::Size::AUTO }
|
|
139
139
|
|
|
140
|
-
# Keep known dimensions as symbols when reading existing API responses.
|
|
141
140
|
variant String
|
|
142
141
|
|
|
143
142
|
# @!method self.variants
|
|
@@ -156,7 +155,7 @@ module OpenAI
|
|
|
156
155
|
|
|
157
156
|
# @!endgroup
|
|
158
157
|
|
|
159
|
-
# Preserve the enum helper available before
|
|
158
|
+
# Preserve the enum helper available before arbitrary strings were supported.
|
|
160
159
|
#
|
|
161
160
|
# @return [Array<Symbol>]
|
|
162
161
|
def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO]
|
|
@@ -52,7 +52,15 @@ module OpenAI
|
|
|
52
52
|
# @return [OpenAI::Models::ImageGenCompletedEvent::Usage]
|
|
53
53
|
required :usage, -> { OpenAI::ImageGenCompletedEvent::Usage }
|
|
54
54
|
|
|
55
|
-
# @!
|
|
55
|
+
# @!attribute safety_identifier
|
|
56
|
+
# The effective safety identifier used for safety monitoring and abuse detection.
|
|
57
|
+
# This is the non-empty `safety_identifier` from the request, or the deprecated
|
|
58
|
+
# `user` value when `safety_identifier` is omitted, null, or empty.
|
|
59
|
+
#
|
|
60
|
+
# @return [String, nil]
|
|
61
|
+
optional :safety_identifier, String, nil?: true
|
|
62
|
+
|
|
63
|
+
# @!method initialize(b64_json:, background:, created_at:, output_format:, quality:, size:, usage:, safety_identifier: nil, type: :"image_generation.completed")
|
|
56
64
|
# Emitted when image generation has completed and the final image is available.
|
|
57
65
|
#
|
|
58
66
|
# @param b64_json [String]
|
|
@@ -77,6 +85,11 @@ module OpenAI
|
|
|
77
85
|
# For the GPT image models only, the token usage information for the image
|
|
78
86
|
# generation.
|
|
79
87
|
#
|
|
88
|
+
# @param safety_identifier [String, nil]
|
|
89
|
+
# The effective safety identifier used for safety monitoring and abuse detection.
|
|
90
|
+
# This is the non-empty `safety_identifier` from the request, or the deprecated
|
|
91
|
+
# `user` value when `safety_identifier` is omitted, null, or empty.
|
|
92
|
+
#
|
|
80
93
|
# @param type [Symbol, :"image_generation.completed"]
|
|
81
94
|
# The type of the event. Always `image_generation.completed`.
|
|
82
95
|
|
|
@@ -139,7 +152,6 @@ module OpenAI
|
|
|
139
152
|
|
|
140
153
|
variant const: -> { OpenAI::Models::ImageGenCompletedEvent::Size::AUTO }
|
|
141
154
|
|
|
142
|
-
# Keep known dimensions as symbols when reading existing API responses.
|
|
143
155
|
variant String
|
|
144
156
|
|
|
145
157
|
# @!method self.variants
|
|
@@ -158,7 +170,7 @@ module OpenAI
|
|
|
158
170
|
|
|
159
171
|
# @!endgroup
|
|
160
172
|
|
|
161
|
-
# Preserve the enum helper available before
|
|
173
|
+
# Preserve the enum helper available before arbitrary strings were supported.
|
|
162
174
|
#
|
|
163
175
|
# @return [Array<Symbol>]
|
|
164
176
|
def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO]
|
|
@@ -137,7 +137,6 @@ module OpenAI
|
|
|
137
137
|
|
|
138
138
|
variant const: -> { OpenAI::Models::ImageGenPartialImageEvent::Size::AUTO }
|
|
139
139
|
|
|
140
|
-
# Keep known dimensions as symbols when reading existing API responses.
|
|
141
140
|
variant String
|
|
142
141
|
|
|
143
142
|
# @!method self.variants
|
|
@@ -156,7 +155,7 @@ module OpenAI
|
|
|
156
155
|
|
|
157
156
|
# @!endgroup
|
|
158
157
|
|
|
159
|
-
# Preserve the enum helper available before
|
|
158
|
+
# Preserve the enum helper available before arbitrary strings were supported.
|
|
160
159
|
#
|
|
161
160
|
# @return [Array<Symbol>]
|
|
162
161
|
def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO]
|
|
@@ -101,6 +101,17 @@ module OpenAI
|
|
|
101
101
|
# @return [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil]
|
|
102
102
|
optional :response_format, enum: -> { OpenAI::ImageGenerateParams::ResponseFormat }, nil?: true
|
|
103
103
|
|
|
104
|
+
# @!attribute safety_identifier
|
|
105
|
+
# A stable identifier for an end user in your organization, used for safety
|
|
106
|
+
# monitoring and abuse detection. Hash a username or email address to avoid
|
|
107
|
+
# sending identifying information. A non-empty value takes precedence over the
|
|
108
|
+
# deprecated `user` parameter. If omitted, null, or empty, the API uses `user`
|
|
109
|
+
# when available.
|
|
110
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
111
|
+
#
|
|
112
|
+
# @return [String, nil]
|
|
113
|
+
optional :safety_identifier, String, nil?: true
|
|
114
|
+
|
|
104
115
|
# @!attribute size
|
|
105
116
|
# The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
106
117
|
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
@@ -126,14 +137,17 @@ module OpenAI
|
|
|
126
137
|
optional :style, enum: -> { OpenAI::ImageGenerateParams::Style }, nil?: true
|
|
127
138
|
|
|
128
139
|
# @!attribute user
|
|
129
|
-
#
|
|
130
|
-
#
|
|
140
|
+
# @deprecated
|
|
141
|
+
#
|
|
142
|
+
# Deprecated: use `safety_identifier` instead. This parameter remains accepted for
|
|
143
|
+
# backward compatibility and is used when `safety_identifier` is omitted, null, or
|
|
144
|
+
# empty.
|
|
131
145
|
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
132
146
|
#
|
|
133
147
|
# @return [String, nil]
|
|
134
148
|
optional :user, String
|
|
135
149
|
|
|
136
|
-
# @!method initialize(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {})
|
|
150
|
+
# @!method initialize(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, safety_identifier: nil, size: nil, style: nil, user: nil, request_options: {})
|
|
137
151
|
# @param prompt [String]
|
|
138
152
|
# A text description of the desired image(s). The maximum length is 32000
|
|
139
153
|
# characters.
|
|
@@ -194,6 +208,14 @@ module OpenAI
|
|
|
194
208
|
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
195
209
|
# image models, which always return base64-encoded images.
|
|
196
210
|
#
|
|
211
|
+
# @param safety_identifier [String, nil]
|
|
212
|
+
# A stable identifier for an end user in your organization, used for safety
|
|
213
|
+
# monitoring and abuse detection. Hash a username or email address to avoid
|
|
214
|
+
# sending identifying information. A non-empty value takes precedence over the
|
|
215
|
+
# deprecated `user` parameter. If omitted, null, or empty, the API uses `user`
|
|
216
|
+
# when available.
|
|
217
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
218
|
+
#
|
|
197
219
|
# @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
|
|
198
220
|
# The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
199
221
|
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
@@ -211,8 +233,9 @@ module OpenAI
|
|
|
211
233
|
# models; describe the desired style in the prompt instead.
|
|
212
234
|
#
|
|
213
235
|
# @param user [String]
|
|
214
|
-
#
|
|
215
|
-
# and
|
|
236
|
+
# Deprecated: use `safety_identifier` instead. This parameter remains accepted for
|
|
237
|
+
# backward compatibility and is used when `safety_identifier` is omitted, null, or
|
|
238
|
+
# empty.
|
|
216
239
|
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
217
240
|
#
|
|
218
241
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -36,6 +36,14 @@ module OpenAI
|
|
|
36
36
|
# @return [Symbol, OpenAI::Models::ImagesResponse::Quality, nil]
|
|
37
37
|
optional :quality, enum: -> { OpenAI::ImagesResponse::Quality }
|
|
38
38
|
|
|
39
|
+
# @!attribute safety_identifier
|
|
40
|
+
# The effective safety identifier used for safety monitoring and abuse detection.
|
|
41
|
+
# This is the non-empty `safety_identifier` from the request, or the deprecated
|
|
42
|
+
# `user` value when `safety_identifier` is omitted, null, or empty.
|
|
43
|
+
#
|
|
44
|
+
# @return [String, nil]
|
|
45
|
+
optional :safety_identifier, String, nil?: true
|
|
46
|
+
|
|
39
47
|
# @!attribute size
|
|
40
48
|
# The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
41
49
|
#
|
|
@@ -48,7 +56,7 @@ module OpenAI
|
|
|
48
56
|
# @return [OpenAI::Models::ImagesResponse::Usage, nil]
|
|
49
57
|
optional :usage, -> { OpenAI::ImagesResponse::Usage }
|
|
50
58
|
|
|
51
|
-
# @!method initialize(created:, background: nil, data: nil, output_format: nil, quality: nil, size: nil, usage: nil)
|
|
59
|
+
# @!method initialize(created:, background: nil, data: nil, output_format: nil, quality: nil, safety_identifier: nil, size: nil, usage: nil)
|
|
52
60
|
# The response from the image generation endpoint.
|
|
53
61
|
#
|
|
54
62
|
# @param created [Integer]
|
|
@@ -68,6 +76,11 @@ module OpenAI
|
|
|
68
76
|
# The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or
|
|
69
77
|
# `max`.
|
|
70
78
|
#
|
|
79
|
+
# @param safety_identifier [String, nil]
|
|
80
|
+
# The effective safety identifier used for safety monitoring and abuse detection.
|
|
81
|
+
# This is the non-empty `safety_identifier` from the request, or the deprecated
|
|
82
|
+
# `user` value when `safety_identifier` is omitted, null, or empty.
|
|
83
|
+
#
|
|
71
84
|
# @param size [String, Symbol, OpenAI::Models::ImagesResponse::Size]
|
|
72
85
|
# The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
73
86
|
#
|
|
@@ -131,7 +144,6 @@ module OpenAI
|
|
|
131
144
|
|
|
132
145
|
variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1536X1024 }
|
|
133
146
|
|
|
134
|
-
# Keep known dimensions as symbols when reading existing API responses.
|
|
135
147
|
variant String
|
|
136
148
|
|
|
137
149
|
# @!method self.variants
|
|
@@ -149,7 +161,7 @@ module OpenAI
|
|
|
149
161
|
|
|
150
162
|
# @!endgroup
|
|
151
163
|
|
|
152
|
-
# Preserve the enum helper available before
|
|
164
|
+
# Preserve the enum helper available before arbitrary strings were supported.
|
|
153
165
|
#
|
|
154
166
|
# @return [Array<Symbol>]
|
|
155
167
|
def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024]
|
|
@@ -16,7 +16,7 @@ module OpenAI
|
|
|
16
16
|
# Start a Live session on a primary WebSocket. Send this event before other commands and wait for `session.started`.
|
|
17
17
|
variant :"session.start", -> { OpenAI::Live::SessionStartEvent }
|
|
18
18
|
|
|
19
|
-
# Update the delegation settings of an active Live session. The server acknowledges accepted changes with `session.updated`.
|
|
19
|
+
# Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`.
|
|
20
20
|
variant :"session.update", -> { OpenAI::Live::SessionUpdateEvent }
|
|
21
21
|
|
|
22
22
|
# Send audio to a Live session over its primary WebSocket. WebRTC and SIP sessions send audio over their media transport.
|
|
@@ -28,6 +28,9 @@ module OpenAI
|
|
|
28
28
|
# Resume audio input to a Live model after muting it. The server acknowledges with `session.input_audio.unmuted`.
|
|
29
29
|
variant :"session.input_audio.unmute", -> { OpenAI::Live::InputAudioUnmuteEvent }
|
|
30
30
|
|
|
31
|
+
# Play one complete audio fixture through the session output. Send this event over the primary WebSocket or a server sideband. Audio must be raw mono PCM16 little-endian at 24 kHz, regardless of the session audio format, and at most 30 seconds. The entire payload is validated before model speech is interrupted and input is muted. Only one fixture can be active. fixture.playing acknowledges acceptance and fixture.played reports server mixer drain. These notifications are not exact transport-media boundaries. Input arriving during playback is dropped and not replayed.
|
|
32
|
+
variant :"session.output_audio.fixture.play", -> { OpenAI::Live::OutputAudioFixturePlayEvent }
|
|
33
|
+
|
|
31
34
|
# Append instructions to the Live conversation while it is running, optionally associating them with an existing client delegation.
|
|
32
35
|
variant :"session.instructions.append", -> { OpenAI::Live::InstructionsAppendEvent }
|
|
33
36
|
|
|
@@ -37,6 +40,15 @@ module OpenAI
|
|
|
37
40
|
# Provide context the Live model can communicate to the user, optionally for an existing client delegation.
|
|
38
41
|
variant :"session.commentary.append", -> { OpenAI::Live::CommentaryAppendEvent }
|
|
39
42
|
|
|
43
|
+
# Evaluate the configured questions using the current conversation and Decision inputs. Reusing an event_id is rejected for the lifetime of the session.
|
|
44
|
+
variant :"decision.create", -> { OpenAI::Live::DecisionCreateEvent }
|
|
45
|
+
|
|
46
|
+
# Append an input item for future decisions without starting an evaluation or changing Live voice context.
|
|
47
|
+
variant :"decision.item.create", -> { OpenAI::Live::DecisionItemCreateEvent }
|
|
48
|
+
|
|
49
|
+
# Delete an input item from future decisions without starting an evaluation or changing Live voice context.
|
|
50
|
+
variant :"decision.item.delete", -> { OpenAI::Live::DecisionItemDeleteEvent }
|
|
51
|
+
|
|
40
52
|
# Add an input item to the Live session’s Responses backend. Requires Responses delegation; use `response.create` to request a response.
|
|
41
53
|
variant :"response.item.create", -> { OpenAI::Live::ResponseItemCreateEvent }
|
|
42
54
|
|
|
@@ -47,7 +59,7 @@ module OpenAI
|
|
|
47
59
|
variant :"session.close", -> { OpenAI::Live::SessionCloseEvent }
|
|
48
60
|
|
|
49
61
|
# @!method self.variants
|
|
50
|
-
# @return [Array(OpenAI::Models::Live::SessionStartEvent, OpenAI::Models::Live::SessionUpdateEvent, OpenAI::Models::Live::InputAudioAppendEvent, OpenAI::Models::Live::InputAudioMuteEvent, OpenAI::Models::Live::InputAudioUnmuteEvent, OpenAI::Models::Live::InstructionsAppendEvent, OpenAI::Models::Live::ThinkingAppendEvent, OpenAI::Models::Live::CommentaryAppendEvent, OpenAI::Models::Live::ResponseItemCreateEvent, OpenAI::Models::Live::ResponseCreateEvent, OpenAI::Models::Live::SessionCloseEvent)]
|
|
62
|
+
# @return [Array(OpenAI::Models::Live::SessionStartEvent, OpenAI::Models::Live::SessionUpdateEvent, OpenAI::Models::Live::InputAudioAppendEvent, OpenAI::Models::Live::InputAudioMuteEvent, OpenAI::Models::Live::InputAudioUnmuteEvent, OpenAI::Models::Live::OutputAudioFixturePlayEvent, OpenAI::Models::Live::InstructionsAppendEvent, OpenAI::Models::Live::ThinkingAppendEvent, OpenAI::Models::Live::CommentaryAppendEvent, OpenAI::Models::Live::DecisionCreateEvent, OpenAI::Models::Live::DecisionItemCreateEvent, OpenAI::Models::Live::DecisionItemDeleteEvent, OpenAI::Models::Live::ResponseItemCreateEvent, OpenAI::Models::Live::ResponseCreateEvent, OpenAI::Models::Live::SessionCloseEvent)]
|
|
51
63
|
end
|
|
52
64
|
end
|
|
53
65
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class DecisionCreateEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute event_id
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :event_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, :"decision.create"]
|
|
15
|
+
required :type, const: :"decision.create"
|
|
16
|
+
|
|
17
|
+
# @!method initialize(event_id:, type: :"decision.create")
|
|
18
|
+
# Evaluate the configured questions using the current conversation and Decision
|
|
19
|
+
# inputs. Reusing an event_id is rejected for the lifetime of the session.
|
|
20
|
+
#
|
|
21
|
+
# @param event_id [String]
|
|
22
|
+
# @param type [Symbol, :"decision.create"]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|