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
|
@@ -118,3 +118,304 @@ module OpenAI
|
|
|
118
118
|
end
|
|
119
119
|
end
|
|
120
120
|
end
|
|
121
|
+
|
|
122
|
+
module OpenAI
|
|
123
|
+
module Resources
|
|
124
|
+
class Responses
|
|
125
|
+
# See {OpenAI::Resources::Responses#create} for non-streaming counterpart.
|
|
126
|
+
#
|
|
127
|
+
# Creates a model response. Provide
|
|
128
|
+
# [text](https://developers.openai.com/api/docs/guides/text) or
|
|
129
|
+
# [image](https://developers.openai.com/api/docs/guides/images-vision) inputs to generate
|
|
130
|
+
# [text](https://developers.openai.com/api/docs/guides/text) or
|
|
131
|
+
# [JSON](https://developers.openai.com/api/docs/guides/structured-outputs) outputs. Have
|
|
132
|
+
# the model call your own
|
|
133
|
+
# [custom code](https://developers.openai.com/api/docs/guides/function-calling) or use
|
|
134
|
+
# built-in [tools](https://developers.openai.com/api/docs/guides/tools) like
|
|
135
|
+
# [web search](https://developers.openai.com/api/docs/guides/tools-web-search) or
|
|
136
|
+
# [file search](https://developers.openai.com/api/docs/guides/tools-file-search) to use
|
|
137
|
+
# your own data as input for the model's response.
|
|
138
|
+
sig do
|
|
139
|
+
params(
|
|
140
|
+
access_programs: OpenAI::Responses::ResponseCreateParams::AccessPrograms::OrHash,
|
|
141
|
+
background: T.nilable(T::Boolean),
|
|
142
|
+
include: T.nilable(
|
|
143
|
+
T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]
|
|
144
|
+
),
|
|
145
|
+
input: T.nilable(OpenAI::Responses::ResponseCreateParams::Input::Variants),
|
|
146
|
+
instructions: T.nilable(String),
|
|
147
|
+
max_output_tokens: T.nilable(Integer),
|
|
148
|
+
max_tool_calls: T.nilable(Integer),
|
|
149
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
150
|
+
model: T.nilable(
|
|
151
|
+
T.any(
|
|
152
|
+
String,
|
|
153
|
+
OpenAI::ChatModel::OrSymbol,
|
|
154
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::OrSymbol
|
|
155
|
+
)
|
|
156
|
+
),
|
|
157
|
+
parallel_tool_calls: T.nilable(T::Boolean),
|
|
158
|
+
previous_response_id: T.nilable(String),
|
|
159
|
+
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
160
|
+
prompt_cache_key: String,
|
|
161
|
+
prompt_cache_options: T.nilable(OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::OrHash),
|
|
162
|
+
prompt_cache_retention: T.nilable(OpenAI::Responses::ResponseCreateParams::PromptCacheRetention::OrSymbol),
|
|
163
|
+
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
164
|
+
response_id: T.nilable(String),
|
|
165
|
+
safety_identifier: String,
|
|
166
|
+
service_tier: T.nilable(
|
|
167
|
+
OpenAI::Responses::ResponseCreateParams::ServiceTier::OrSymbol
|
|
168
|
+
),
|
|
169
|
+
starting_after: T.nilable(Integer),
|
|
170
|
+
store: T.nilable(T::Boolean),
|
|
171
|
+
temperature: T.nilable(Float),
|
|
172
|
+
text: T.nilable(
|
|
173
|
+
T.any(
|
|
174
|
+
OpenAI::Responses::ResponseTextConfig::OrHash,
|
|
175
|
+
OpenAI::StructuredOutput::JsonSchemaConverter
|
|
176
|
+
)
|
|
177
|
+
),
|
|
178
|
+
tool_choice: T.any(
|
|
179
|
+
OpenAI::Responses::ToolChoiceOptions::OrSymbol,
|
|
180
|
+
OpenAI::Responses::ToolChoiceAllowed::OrHash,
|
|
181
|
+
OpenAI::Responses::ToolChoiceTypes::OrHash,
|
|
182
|
+
OpenAI::Responses::ToolChoiceFunction::OrHash,
|
|
183
|
+
OpenAI::Responses::ToolChoiceMcp::OrHash
|
|
184
|
+
),
|
|
185
|
+
tools: T.nilable(
|
|
186
|
+
T::Array[
|
|
187
|
+
T.any(
|
|
188
|
+
OpenAI::StructuredOutput::JsonSchemaConverter,
|
|
189
|
+
OpenAI::Responses::FunctionTool::OrHash,
|
|
190
|
+
OpenAI::Responses::FileSearchTool::OrHash,
|
|
191
|
+
OpenAI::Responses::ComputerTool::OrHash,
|
|
192
|
+
OpenAI::Responses::Tool::Mcp::OrHash,
|
|
193
|
+
OpenAI::Responses::Tool::CodeInterpreter::OrHash,
|
|
194
|
+
OpenAI::Responses::Tool::ImageGeneration::OrHash,
|
|
195
|
+
OpenAI::Responses::Tool::LocalShell::OrHash,
|
|
196
|
+
OpenAI::Responses::WebSearchTool::OrHash
|
|
197
|
+
)
|
|
198
|
+
]
|
|
199
|
+
),
|
|
200
|
+
top_logprobs: T.nilable(Integer),
|
|
201
|
+
top_p: T.nilable(Float),
|
|
202
|
+
truncation: T.nilable(
|
|
203
|
+
OpenAI::Responses::ResponseCreateParams::Truncation::OrSymbol
|
|
204
|
+
),
|
|
205
|
+
user: String,
|
|
206
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
207
|
+
)
|
|
208
|
+
.returns(OpenAI::Streaming::ResponseStream)
|
|
209
|
+
end
|
|
210
|
+
def stream(
|
|
211
|
+
# Domain-specific access programs to use for this request.
|
|
212
|
+
access_programs: nil,
|
|
213
|
+
# Whether to run the model response in the background.
|
|
214
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/background).
|
|
215
|
+
background: nil,
|
|
216
|
+
# Specify additional output data to include in the model response. Currently
|
|
217
|
+
# supported values are:
|
|
218
|
+
#
|
|
219
|
+
# - `code_interpreter_call.outputs`: Includes the outputs of python code execution
|
|
220
|
+
# in code interpreter tool call items.
|
|
221
|
+
# - `computer_call_output.output.image_url`: Include image urls from the computer
|
|
222
|
+
# call output.
|
|
223
|
+
# - `file_search_call.results`: Include the search results of the file search tool
|
|
224
|
+
# call.
|
|
225
|
+
# - `message.input_image.image_url`: Include image urls from the input message.
|
|
226
|
+
# - `message.output_text.logprobs`: Include logprobs with assistant messages.
|
|
227
|
+
# - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
|
|
228
|
+
# tokens in reasoning item outputs. This enables reasoning items to be used in
|
|
229
|
+
# multi-turn conversations when using the Responses API statelessly (like when
|
|
230
|
+
# the `store` parameter is set to `false`, or when an organization is enrolled
|
|
231
|
+
# in the zero data retention program).
|
|
232
|
+
include: nil,
|
|
233
|
+
# Text, image, or file inputs to the model, used to generate a response.
|
|
234
|
+
#
|
|
235
|
+
# Learn more:
|
|
236
|
+
#
|
|
237
|
+
# - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
|
|
238
|
+
# - [Image inputs](https://developers.openai.com/api/docs/guides/images-vision)
|
|
239
|
+
# - [File inputs](https://developers.openai.com/api/docs/guides/file-inputs)
|
|
240
|
+
# - [Conversation state](https://developers.openai.com/api/docs/guides/conversation-state)
|
|
241
|
+
# - [Function calling](https://developers.openai.com/api/docs/guides/function-calling)
|
|
242
|
+
input: nil,
|
|
243
|
+
# A system (or developer) message inserted into the model's context.
|
|
244
|
+
#
|
|
245
|
+
# When using along with `previous_response_id`, the instructions from a previous
|
|
246
|
+
# response will not be carried over to the next response. This makes it simple to
|
|
247
|
+
# swap out system (or developer) messages in new responses.
|
|
248
|
+
instructions: nil,
|
|
249
|
+
# An upper bound for the number of tokens that can be generated for a response,
|
|
250
|
+
# including visible output tokens and
|
|
251
|
+
# [reasoning tokens](https://developers.openai.com/api/docs/guides/reasoning).
|
|
252
|
+
max_output_tokens: nil,
|
|
253
|
+
# The maximum number of total calls to built-in tools that can be processed in a
|
|
254
|
+
# response. This maximum number applies across all built-in tool calls, not per
|
|
255
|
+
# individual tool. Any further attempts to call a tool by the model will be
|
|
256
|
+
# ignored.
|
|
257
|
+
max_tool_calls: nil,
|
|
258
|
+
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
259
|
+
# for storing additional information about the object in a structured format, and
|
|
260
|
+
# querying for objects via API or the dashboard.
|
|
261
|
+
#
|
|
262
|
+
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
263
|
+
# a maximum length of 512 characters.
|
|
264
|
+
metadata: nil,
|
|
265
|
+
# Model ID used to generate the response, like `gpt-6-astra`. OpenAI offers a wide
|
|
266
|
+
# range of models with different capabilities, performance characteristics, and
|
|
267
|
+
# price points. Refer to the
|
|
268
|
+
# [model guide](https://developers.openai.com/api/docs/models) to browse and
|
|
269
|
+
# compare available models.
|
|
270
|
+
model: nil,
|
|
271
|
+
# Whether to allow the model to run tool calls in parallel.
|
|
272
|
+
parallel_tool_calls: nil,
|
|
273
|
+
# The unique ID of the previous response to the model. Use this to create
|
|
274
|
+
# multi-turn conversations. Learn more about
|
|
275
|
+
# [conversation state](https://developers.openai.com/api/docs/guides/conversation-state).
|
|
276
|
+
# Cannot be used in conjunction with `conversation`.
|
|
277
|
+
previous_response_id: nil,
|
|
278
|
+
# Reference to a prompt template and its variables.
|
|
279
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/text?api-mode=responses#version-prompts-in-code).
|
|
280
|
+
prompt: nil,
|
|
281
|
+
# Used by OpenAI to cache responses for similar requests to optimize your cache
|
|
282
|
+
# hit rates. Replaces the `user` field.
|
|
283
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching).
|
|
284
|
+
prompt_cache_key: nil,
|
|
285
|
+
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
286
|
+
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
287
|
+
# explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
288
|
+
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
289
|
+
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
290
|
+
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
291
|
+
# `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
292
|
+
# [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
|
|
293
|
+
# for current details.
|
|
294
|
+
prompt_cache_options: nil,
|
|
295
|
+
# Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
296
|
+
#
|
|
297
|
+
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
298
|
+
# prompt caching, which keeps cached prefixes active for longer, up to a maximum
|
|
299
|
+
# of 24 hours.
|
|
300
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).
|
|
301
|
+
# This field expresses a maximum retention policy, while
|
|
302
|
+
# `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields
|
|
303
|
+
# are independent and do not interact. For `gpt-5.5`, `gpt-5.5-pro`, and future
|
|
304
|
+
# models, only `24h` is supported.
|
|
305
|
+
#
|
|
306
|
+
# For older models that support both `in_memory` and `24h`, the default depends on
|
|
307
|
+
# your organization's data retention policy:
|
|
308
|
+
#
|
|
309
|
+
# - Organizations without ZDR enabled default to `24h`.
|
|
310
|
+
# - Organizations with ZDR enabled default to `in_memory` when
|
|
311
|
+
# `prompt_cache_retention` is not specified.
|
|
312
|
+
prompt_cache_retention: nil,
|
|
313
|
+
# Configuration options for
|
|
314
|
+
# [reasoning models](https://developers.openai.com/api/docs/guides/reasoning).
|
|
315
|
+
reasoning: nil,
|
|
316
|
+
# The ID of the response whose stream to resume.
|
|
317
|
+
response_id: nil,
|
|
318
|
+
# A stable identifier used to help detect users of your application that may be
|
|
319
|
+
# violating OpenAI's usage policies. The IDs should be a string that uniquely
|
|
320
|
+
# identifies each user, with a maximum length of 128 characters. We recommend
|
|
321
|
+
# hashing their username or email address, in order to avoid sending us any
|
|
322
|
+
# identifying information.
|
|
323
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
324
|
+
safety_identifier: nil,
|
|
325
|
+
# Specifies the processing type used for serving the request.
|
|
326
|
+
#
|
|
327
|
+
# - If set to 'auto', then the request will be processed with the service tier
|
|
328
|
+
# configured in the Project settings. Unless otherwise configured, the Project
|
|
329
|
+
# will use 'default'.
|
|
330
|
+
# - If set to 'default', then the request will be processed with the standard
|
|
331
|
+
# pricing and performance for the selected model.
|
|
332
|
+
# - If set to
|
|
333
|
+
# '[flex](https://developers.openai.com/api/docs/guides/flex-processing)', then
|
|
334
|
+
# the request will be processed with the Flex Processing service tier.
|
|
335
|
+
# - To opt-in to
|
|
336
|
+
# [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) at the
|
|
337
|
+
# request level, include the `service_tier=fast` or `service_tier=priority`
|
|
338
|
+
# parameter for Responses or Chat Completions. The response will show
|
|
339
|
+
# `service_tier=priority` regardless of if you specify `service_tier=fast` or
|
|
340
|
+
# `priority` in your request.
|
|
341
|
+
# - If set to 'ultrafast', then the request will be processed with the
|
|
342
|
+
# access-controlled Ultrafast Processing service tier. This tier is currently
|
|
343
|
+
# available for `gpt-5.6-sol`; a response served through it will show
|
|
344
|
+
# `service_tier=ultrafast`.
|
|
345
|
+
# - When not set, the default behavior is 'auto'.
|
|
346
|
+
#
|
|
347
|
+
# When the `service_tier` parameter is set, the response body will include the
|
|
348
|
+
# `service_tier` value based on the processing mode actually used to serve the
|
|
349
|
+
# request. This response value may be different from the value set in the
|
|
350
|
+
# parameter.
|
|
351
|
+
service_tier: nil,
|
|
352
|
+
# The sequence number of the event after which to resume streaming. Can only be
|
|
353
|
+
# used with `response_id`.
|
|
354
|
+
starting_after: nil,
|
|
355
|
+
# Whether to store the generated model response for later retrieval via API.
|
|
356
|
+
store: nil,
|
|
357
|
+
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
358
|
+
# make the output more random, while lower values like 0.2 will make it more
|
|
359
|
+
# focused and deterministic. We generally recommend altering this or `top_p` but
|
|
360
|
+
# not both.
|
|
361
|
+
temperature: nil,
|
|
362
|
+
# Configuration options for a text response from the model. Can be plain text,
|
|
363
|
+
# structured JSON data, or text that conforms to a custom grammar. Learn more:
|
|
364
|
+
#
|
|
365
|
+
# - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
|
|
366
|
+
# - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
|
|
367
|
+
text: nil,
|
|
368
|
+
# How the model should select which tool (or tools) to use when generating a
|
|
369
|
+
# response. See the `tools` parameter to see how to specify which tools the model
|
|
370
|
+
# can call.
|
|
371
|
+
tool_choice: nil,
|
|
372
|
+
# An array of tools the model may call while generating a response. You can
|
|
373
|
+
# specify which tool to use by setting the `tool_choice` parameter.
|
|
374
|
+
#
|
|
375
|
+
# The two categories of tools you can provide the model are:
|
|
376
|
+
#
|
|
377
|
+
# - **Built-in tools**: Tools that are provided by OpenAI that extend the model's
|
|
378
|
+
# capabilities, like
|
|
379
|
+
# [web search](https://developers.openai.com/api/docs/guides/tools-web-search)
|
|
380
|
+
# or
|
|
381
|
+
# [file search](https://developers.openai.com/api/docs/guides/tools-file-search).
|
|
382
|
+
# Learn more about
|
|
383
|
+
# [built-in tools](https://developers.openai.com/api/docs/guides/tools).
|
|
384
|
+
# - **MCP Tools**: Integrations with third-party systems via custom MCP servers or
|
|
385
|
+
# predefined connectors such as Google Drive and SharePoint. Learn more about
|
|
386
|
+
# [MCP Tools](https://developers.openai.com/api/docs/guides/tools-connectors-mcp).
|
|
387
|
+
# - **Function calls (custom tools)**: Functions that are defined by you, enabling
|
|
388
|
+
# the model to call your own code with strongly typed arguments and outputs.
|
|
389
|
+
# Learn more about
|
|
390
|
+
# [function calling](https://developers.openai.com/api/docs/guides/function-calling).
|
|
391
|
+
# You can also use custom tools to call your own code.
|
|
392
|
+
tools: nil,
|
|
393
|
+
# An integer between 0 and 20 specifying the number of most likely tokens to
|
|
394
|
+
# return at each token position, each with an associated log probability.
|
|
395
|
+
top_logprobs: nil,
|
|
396
|
+
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
397
|
+
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
398
|
+
# means only the tokens comprising the top 10% probability mass are considered.
|
|
399
|
+
#
|
|
400
|
+
# We generally recommend altering this or `temperature` but not both.
|
|
401
|
+
top_p: nil,
|
|
402
|
+
# The truncation strategy to use for the model response.
|
|
403
|
+
#
|
|
404
|
+
# - `auto`: If the context of this response and previous ones exceeds the model's
|
|
405
|
+
# context window size, the model will truncate the response to fit the context
|
|
406
|
+
# window by dropping input items in the middle of the conversation.
|
|
407
|
+
# - `disabled` (default): If a model response will exceed the context window size
|
|
408
|
+
# for a model, the request will fail with a 400 error.
|
|
409
|
+
truncation: nil,
|
|
410
|
+
# This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use
|
|
411
|
+
# `prompt_cache_key` instead to maintain caching optimizations. A stable
|
|
412
|
+
# identifier for your end-users. Used to boost cache hit rates by better bucketing
|
|
413
|
+
# similar requests and to help OpenAI detect and prevent abuse.
|
|
414
|
+
# [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).
|
|
415
|
+
user: nil,
|
|
416
|
+
request_options: {}
|
|
417
|
+
)
|
|
418
|
+
end
|
|
419
|
+
end
|
|
420
|
+
end
|
|
421
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class VectorStores
|
|
6
|
+
class FileBatches
|
|
7
|
+
# Create a vector store file batch and wait for processing to finish.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
vector_store_id: String,
|
|
11
|
+
attributes: T.nilable(
|
|
12
|
+
T::Hash[
|
|
13
|
+
Symbol,
|
|
14
|
+
OpenAI::VectorStores::FileBatchCreateParams::Attribute::Variants
|
|
15
|
+
]
|
|
16
|
+
),
|
|
17
|
+
chunking_strategy: T.any(
|
|
18
|
+
OpenAI::AutoFileChunkingStrategyParam::OrHash,
|
|
19
|
+
OpenAI::StaticFileChunkingStrategyObjectParam::OrHash
|
|
20
|
+
),
|
|
21
|
+
file_ids: T::Array[String],
|
|
22
|
+
files: T::Array[
|
|
23
|
+
OpenAI::VectorStores::FileBatchCreateParams::File::OrHash
|
|
24
|
+
],
|
|
25
|
+
poll_interval: T.nilable(T.any(Integer, Float)),
|
|
26
|
+
timeout: T.nilable(T.any(Integer, Float)),
|
|
27
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
28
|
+
)
|
|
29
|
+
.returns(OpenAI::VectorStores::VectorStoreFileBatch)
|
|
30
|
+
end
|
|
31
|
+
def create_and_poll(
|
|
32
|
+
vector_store_id,
|
|
33
|
+
attributes: nil,
|
|
34
|
+
chunking_strategy: nil,
|
|
35
|
+
file_ids: nil,
|
|
36
|
+
files: nil,
|
|
37
|
+
poll_interval: nil,
|
|
38
|
+
timeout: OpenAI::Internal::Poller::DEFAULT_TIMEOUT,
|
|
39
|
+
request_options: {}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Wait for a vector store file batch to finish processing.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
batch_id: String,
|
|
47
|
+
vector_store_id: String,
|
|
48
|
+
poll_interval: T.nilable(T.any(Integer, Float)),
|
|
49
|
+
timeout: T.nilable(T.any(Integer, Float)),
|
|
50
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
51
|
+
)
|
|
52
|
+
.returns(OpenAI::VectorStores::VectorStoreFileBatch)
|
|
53
|
+
end
|
|
54
|
+
def poll(
|
|
55
|
+
batch_id,
|
|
56
|
+
vector_store_id:,
|
|
57
|
+
poll_interval: nil,
|
|
58
|
+
timeout: OpenAI::Internal::Poller::DEFAULT_TIMEOUT,
|
|
59
|
+
request_options: {}
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Upload files concurrently, create a vector store file batch, and wait for
|
|
64
|
+
# processing to finish.
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
vector_store_id: String,
|
|
68
|
+
files: T::Enumerable[OpenAI::Internal::FileInput],
|
|
69
|
+
file_ids: T::Array[String],
|
|
70
|
+
max_concurrency: Integer,
|
|
71
|
+
attributes: T.nilable(
|
|
72
|
+
T::Hash[
|
|
73
|
+
Symbol,
|
|
74
|
+
OpenAI::VectorStores::FileBatchCreateParams::Attribute::Variants
|
|
75
|
+
]
|
|
76
|
+
),
|
|
77
|
+
chunking_strategy: T.any(
|
|
78
|
+
OpenAI::AutoFileChunkingStrategyParam::OrHash,
|
|
79
|
+
OpenAI::StaticFileChunkingStrategyObjectParam::OrHash
|
|
80
|
+
),
|
|
81
|
+
poll_interval: T.nilable(T.any(Integer, Float)),
|
|
82
|
+
timeout: T.nilable(T.any(Integer, Float)),
|
|
83
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
84
|
+
)
|
|
85
|
+
.returns(OpenAI::VectorStores::VectorStoreFileBatch)
|
|
86
|
+
end
|
|
87
|
+
def upload_and_poll(
|
|
88
|
+
vector_store_id,
|
|
89
|
+
files:,
|
|
90
|
+
file_ids: [],
|
|
91
|
+
max_concurrency: 5,
|
|
92
|
+
attributes: nil,
|
|
93
|
+
chunking_strategy: nil,
|
|
94
|
+
poll_interval: nil,
|
|
95
|
+
timeout: OpenAI::Internal::Poller::DEFAULT_TIMEOUT,
|
|
96
|
+
request_options: {}
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class VectorStores
|
|
6
|
+
class Files
|
|
7
|
+
# Attach a file to a vector store and wait for processing to finish.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
vector_store_id: String,
|
|
11
|
+
file_id: String,
|
|
12
|
+
attributes: T.nilable(
|
|
13
|
+
T::Hash[
|
|
14
|
+
Symbol,
|
|
15
|
+
OpenAI::VectorStores::FileCreateParams::Attribute::Variants
|
|
16
|
+
]
|
|
17
|
+
),
|
|
18
|
+
chunking_strategy: T.any(
|
|
19
|
+
OpenAI::AutoFileChunkingStrategyParam::OrHash,
|
|
20
|
+
OpenAI::StaticFileChunkingStrategyObjectParam::OrHash
|
|
21
|
+
),
|
|
22
|
+
poll_interval: T.nilable(T.any(Integer, Float)),
|
|
23
|
+
timeout: T.nilable(T.any(Integer, Float)),
|
|
24
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
25
|
+
)
|
|
26
|
+
.returns(OpenAI::VectorStores::VectorStoreFile)
|
|
27
|
+
end
|
|
28
|
+
def create_and_poll(
|
|
29
|
+
vector_store_id,
|
|
30
|
+
file_id:,
|
|
31
|
+
attributes: nil,
|
|
32
|
+
chunking_strategy: nil,
|
|
33
|
+
poll_interval: nil,
|
|
34
|
+
timeout: OpenAI::Internal::Poller::DEFAULT_TIMEOUT,
|
|
35
|
+
request_options: {}
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Wait for a vector store file to finish processing.
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
file_id: String,
|
|
43
|
+
vector_store_id: String,
|
|
44
|
+
poll_interval: T.nilable(T.any(Integer, Float)),
|
|
45
|
+
timeout: T.nilable(T.any(Integer, Float)),
|
|
46
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
47
|
+
)
|
|
48
|
+
.returns(OpenAI::VectorStores::VectorStoreFile)
|
|
49
|
+
end
|
|
50
|
+
def poll(
|
|
51
|
+
file_id,
|
|
52
|
+
vector_store_id:,
|
|
53
|
+
poll_interval: nil,
|
|
54
|
+
timeout: OpenAI::Internal::Poller::DEFAULT_TIMEOUT,
|
|
55
|
+
request_options: {}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Upload a file and attach it to a vector store.
|
|
60
|
+
sig do
|
|
61
|
+
params(
|
|
62
|
+
vector_store_id: String,
|
|
63
|
+
file: OpenAI::Internal::FileInput,
|
|
64
|
+
attributes: T.nilable(
|
|
65
|
+
T::Hash[
|
|
66
|
+
Symbol,
|
|
67
|
+
OpenAI::VectorStores::FileCreateParams::Attribute::Variants
|
|
68
|
+
]
|
|
69
|
+
),
|
|
70
|
+
chunking_strategy: T.any(
|
|
71
|
+
OpenAI::AutoFileChunkingStrategyParam::OrHash,
|
|
72
|
+
OpenAI::StaticFileChunkingStrategyObjectParam::OrHash
|
|
73
|
+
),
|
|
74
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
75
|
+
)
|
|
76
|
+
.returns(OpenAI::VectorStores::VectorStoreFile)
|
|
77
|
+
end
|
|
78
|
+
def upload(
|
|
79
|
+
vector_store_id,
|
|
80
|
+
file:,
|
|
81
|
+
attributes: nil,
|
|
82
|
+
chunking_strategy: nil,
|
|
83
|
+
request_options: {}
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Upload a file, attach it to a vector store, and wait for processing to
|
|
88
|
+
# finish.
|
|
89
|
+
sig do
|
|
90
|
+
params(
|
|
91
|
+
vector_store_id: String,
|
|
92
|
+
file: OpenAI::Internal::FileInput,
|
|
93
|
+
attributes: T.nilable(
|
|
94
|
+
T::Hash[
|
|
95
|
+
Symbol,
|
|
96
|
+
OpenAI::VectorStores::FileCreateParams::Attribute::Variants
|
|
97
|
+
]
|
|
98
|
+
),
|
|
99
|
+
chunking_strategy: T.any(
|
|
100
|
+
OpenAI::AutoFileChunkingStrategyParam::OrHash,
|
|
101
|
+
OpenAI::StaticFileChunkingStrategyObjectParam::OrHash
|
|
102
|
+
),
|
|
103
|
+
poll_interval: T.nilable(T.any(Integer, Float)),
|
|
104
|
+
timeout: T.nilable(T.any(Integer, Float)),
|
|
105
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
106
|
+
)
|
|
107
|
+
.returns(OpenAI::VectorStores::VectorStoreFile)
|
|
108
|
+
end
|
|
109
|
+
def upload_and_poll(
|
|
110
|
+
vector_store_id,
|
|
111
|
+
file:,
|
|
112
|
+
attributes: nil,
|
|
113
|
+
chunking_strategy: nil,
|
|
114
|
+
poll_interval: nil,
|
|
115
|
+
timeout: OpenAI::Internal::Poller::DEFAULT_TIMEOUT,
|
|
116
|
+
request_options: {}
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -1,6 +1,88 @@
|
|
|
1
1
|
# typed: strong
|
|
2
2
|
|
|
3
3
|
module OpenAI
|
|
4
|
+
class Client < OpenAI::Internal::Transport::BaseClient
|
|
5
|
+
# @api private
|
|
6
|
+
sig do
|
|
7
|
+
params(
|
|
8
|
+
request: OpenAI::Internal::Transport::BaseClient::RequestComponents,
|
|
9
|
+
websocket_base_url: T.nilable(String),
|
|
10
|
+
options: T.nilable(OpenAI::RequestOptions::OrHash),
|
|
11
|
+
block: T
|
|
12
|
+
.proc
|
|
13
|
+
.params(
|
|
14
|
+
request: OpenAI::Internal::Transport::BaseClient::RequestInput,
|
|
15
|
+
mark_handshake_completed: T.proc.void
|
|
16
|
+
)
|
|
17
|
+
.returns(T.anything)
|
|
18
|
+
)
|
|
19
|
+
.returns(T.anything)
|
|
20
|
+
end
|
|
21
|
+
def with_websocket_connection_request(request:, websocket_base_url: nil, options: nil, &block)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module WebSocket
|
|
26
|
+
# @api private
|
|
27
|
+
module Resource
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
path_arguments: T.untyped,
|
|
31
|
+
query: T::Hash[T.untyped, T.untyped],
|
|
32
|
+
websocket_base_url: T.nilable(String),
|
|
33
|
+
request_options: T.untyped,
|
|
34
|
+
transport: T.untyped,
|
|
35
|
+
transport_options: T::Hash[T.untyped, T.untyped],
|
|
36
|
+
block: T.proc.params(connection: TypedConnection).returns(T.untyped)
|
|
37
|
+
)
|
|
38
|
+
.returns(T.untyped)
|
|
39
|
+
end
|
|
40
|
+
def connect(
|
|
41
|
+
*path_arguments,
|
|
42
|
+
query: {},
|
|
43
|
+
websocket_base_url: nil,
|
|
44
|
+
request_options: nil,
|
|
45
|
+
transport: nil,
|
|
46
|
+
transport_options: {},
|
|
47
|
+
&block
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# @api private
|
|
53
|
+
class TypedConnection
|
|
54
|
+
include Enumerable
|
|
55
|
+
Elem = type_member { {fixed: T.untyped} }
|
|
56
|
+
|
|
57
|
+
sig { returns(URI::Generic) }
|
|
58
|
+
attr_reader :url
|
|
59
|
+
|
|
60
|
+
sig { returns(T.untyped) }
|
|
61
|
+
def receive
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
sig { params(event: T.untyped).void }
|
|
65
|
+
def send_event(event)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
sig do
|
|
69
|
+
params(block: T.nilable(T.proc.params(event: T.untyped).void)).returns(
|
|
70
|
+
T.any(TypedConnection, T::Enumerator[T.untyped])
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
def each(&block)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig { params(code: Integer, reason: String).void }
|
|
77
|
+
def close(code: 1000, reason: "")
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
sig { returns(T::Boolean) }
|
|
81
|
+
def closed?
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
4
86
|
module Errors
|
|
5
87
|
class WebSocketConnectionError < OpenAI::Errors::Error
|
|
6
88
|
sig { returns(URI::Generic) }
|
|
@@ -3130,7 +3130,8 @@ module OpenAI
|
|
|
3130
3130
|
provider: T.any(
|
|
3131
3131
|
OpenAI::Admin::Organization::AwsExternalStorageProvider::OrHash,
|
|
3132
3132
|
OpenAI::Admin::Organization::AzureExternalStorageProvider::OrHash,
|
|
3133
|
-
OpenAI::Admin::Organization::GcpExternalStorageProvider::OrHash
|
|
3133
|
+
OpenAI::Admin::Organization::GcpExternalStorageProvider::OrHash,
|
|
3134
|
+
OpenAI::Admin::Organization::OciExternalStorageProvider::OrHash
|
|
3134
3135
|
)
|
|
3135
3136
|
)
|
|
3136
3137
|
.void
|
|
@@ -3146,7 +3147,8 @@ module OpenAI
|
|
|
3146
3147
|
provider: T.any(
|
|
3147
3148
|
OpenAI::Admin::Organization::AwsExternalStorageProvider::OrHash,
|
|
3148
3149
|
OpenAI::Admin::Organization::AzureExternalStorageProvider::OrHash,
|
|
3149
|
-
OpenAI::Admin::Organization::GcpExternalStorageProvider::OrHash
|
|
3150
|
+
OpenAI::Admin::Organization::GcpExternalStorageProvider::OrHash,
|
|
3151
|
+
OpenAI::Admin::Organization::OciExternalStorageProvider::OrHash
|
|
3150
3152
|
)
|
|
3151
3153
|
)
|
|
3152
3154
|
.returns(T.attached_class)
|
|
@@ -3181,7 +3183,8 @@ module OpenAI
|
|
|
3181
3183
|
T.any(
|
|
3182
3184
|
OpenAI::Admin::Organization::AwsExternalStorageProvider,
|
|
3183
3185
|
OpenAI::Admin::Organization::AzureExternalStorageProvider,
|
|
3184
|
-
OpenAI::Admin::Organization::GcpExternalStorageProvider
|
|
3186
|
+
OpenAI::Admin::Organization::GcpExternalStorageProvider,
|
|
3187
|
+
OpenAI::Admin::Organization::OciExternalStorageProvider
|
|
3185
3188
|
)
|
|
3186
3189
|
}
|
|
3187
3190
|
|
|
@@ -51,7 +51,8 @@ module OpenAI
|
|
|
51
51
|
provider: T.any(
|
|
52
52
|
OpenAI::Admin::Organization::AwsExternalStorageProvider::OrHash,
|
|
53
53
|
OpenAI::Admin::Organization::AzureExternalStorageProvider::OrHash,
|
|
54
|
-
OpenAI::Admin::Organization::GcpExternalStorageProvider::OrHash
|
|
54
|
+
OpenAI::Admin::Organization::GcpExternalStorageProvider::OrHash,
|
|
55
|
+
OpenAI::Admin::Organization::OciExternalStorageProvider::OrHash
|
|
55
56
|
),
|
|
56
57
|
|
|
57
58
|
status: OpenAI::Admin::Organization::ExternalStorageConfiguration::Status::OrSymbol,
|
|
@@ -101,7 +102,8 @@ module OpenAI
|
|
|
101
102
|
T.any(
|
|
102
103
|
OpenAI::Admin::Organization::AwsExternalStorageProvider,
|
|
103
104
|
OpenAI::Admin::Organization::AzureExternalStorageProvider,
|
|
104
|
-
OpenAI::Admin::Organization::GcpExternalStorageProvider
|
|
105
|
+
OpenAI::Admin::Organization::GcpExternalStorageProvider,
|
|
106
|
+
OpenAI::Admin::Organization::OciExternalStorageProvider
|
|
105
107
|
)
|
|
106
108
|
}
|
|
107
109
|
|