openai 0.22.1 → 0.23.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 +8 -0
- data/README.md +1 -1
- data/lib/openai/models/realtime/audio_transcription.rb +60 -0
- data/lib/openai/models/realtime/client_secret_create_params.rb +18 -9
- data/lib/openai/models/realtime/client_secret_create_response.rb +11 -250
- data/lib/openai/models/realtime/conversation_item.rb +1 -1
- data/lib/openai/models/realtime/conversation_item_added.rb +14 -1
- data/lib/openai/models/realtime/conversation_item_done.rb +3 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +10 -8
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +14 -5
- data/lib/openai/models/realtime/conversation_item_truncate_event.rb +2 -2
- data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +10 -5
- data/lib/openai/models/realtime/models.rb +58 -0
- data/lib/openai/models/realtime/noise_reduction_type.rb +20 -0
- data/lib/openai/models/realtime/realtime_audio_config.rb +6 -427
- data/lib/openai/models/realtime/realtime_audio_config_input.rb +89 -0
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +100 -0
- data/lib/openai/models/realtime/realtime_audio_formats.rb +121 -0
- data/lib/openai/models/realtime/realtime_audio_input_turn_detection.rb +131 -0
- data/lib/openai/models/realtime/realtime_client_event.rb +31 -23
- data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +43 -10
- data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +16 -7
- data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +15 -7
- data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +18 -6
- data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +62 -13
- data/lib/openai/models/realtime/realtime_response.rb +117 -107
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +100 -0
- data/lib/openai/models/realtime/realtime_response_create_mcp_tool.rb +310 -0
- data/lib/openai/models/realtime/realtime_response_create_params.rb +225 -0
- data/lib/openai/models/realtime/realtime_response_status.rb +1 -1
- data/lib/openai/models/realtime/realtime_response_usage.rb +5 -2
- data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +58 -8
- data/lib/openai/models/realtime/realtime_server_event.rb +21 -5
- data/lib/openai/models/realtime/realtime_session.rb +9 -125
- data/lib/openai/models/realtime/realtime_session_client_secret.rb +36 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +50 -71
- data/lib/openai/models/realtime/realtime_session_create_response.rb +621 -219
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +2 -53
- data/lib/openai/models/realtime/realtime_tracing_config.rb +7 -6
- data/lib/openai/models/realtime/realtime_transcription_session_audio.rb +19 -0
- data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +90 -0
- data/lib/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rb +131 -0
- data/lib/openai/models/realtime/realtime_transcription_session_client_secret.rb +38 -0
- data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +12 -270
- data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +78 -0
- data/lib/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rb +66 -0
- data/lib/openai/models/realtime/realtime_transcription_session_turn_detection.rb +57 -0
- data/lib/openai/models/realtime/realtime_truncation.rb +8 -40
- data/lib/openai/models/realtime/realtime_truncation_retention_ratio.rb +34 -0
- data/lib/openai/models/realtime/response_cancel_event.rb +3 -1
- data/lib/openai/models/realtime/response_create_event.rb +18 -348
- data/lib/openai/models/realtime/response_done_event.rb +7 -0
- data/lib/openai/models/realtime/session_created_event.rb +20 -4
- data/lib/openai/models/realtime/session_update_event.rb +36 -12
- data/lib/openai/models/realtime/session_updated_event.rb +20 -4
- data/lib/openai/models/realtime/transcription_session_created.rb +8 -243
- data/lib/openai/models/realtime/transcription_session_update.rb +179 -3
- data/lib/openai/models/realtime/transcription_session_updated_event.rb +8 -243
- data/lib/openai/resources/realtime/client_secrets.rb +2 -3
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +19 -1
- data/rbi/openai/models/realtime/audio_transcription.rbi +132 -0
- data/rbi/openai/models/realtime/client_secret_create_params.rbi +25 -11
- data/rbi/openai/models/realtime/client_secret_create_response.rbi +2 -587
- data/rbi/openai/models/realtime/conversation_item_added.rbi +14 -1
- data/rbi/openai/models/realtime/conversation_item_done.rbi +3 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +11 -8
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +15 -5
- data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +2 -2
- data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +10 -5
- data/rbi/openai/models/realtime/models.rbi +97 -0
- data/rbi/openai/models/realtime/noise_reduction_type.rbi +31 -0
- data/rbi/openai/models/realtime/realtime_audio_config.rbi +8 -956
- data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +221 -0
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +222 -0
- data/rbi/openai/models/realtime/realtime_audio_formats.rbi +329 -0
- data/rbi/openai/models/realtime/realtime_audio_input_turn_detection.rbi +262 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +51 -10
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +16 -7
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +14 -7
- data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +16 -6
- data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +110 -12
- data/rbi/openai/models/realtime/realtime_response.rbi +287 -212
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +250 -0
- data/rbi/openai/models/realtime/realtime_response_create_mcp_tool.rbi +616 -0
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +529 -0
- data/rbi/openai/models/realtime/realtime_response_usage.rbi +8 -2
- data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +106 -7
- data/rbi/openai/models/realtime/realtime_server_event.rbi +4 -1
- data/rbi/openai/models/realtime/realtime_session.rbi +12 -262
- data/rbi/openai/models/realtime/realtime_session_client_secret.rbi +49 -0
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +112 -133
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1229 -405
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +1 -117
- data/rbi/openai/models/realtime/realtime_tracing_config.rbi +11 -10
- data/rbi/openai/models/realtime/realtime_transcription_session_audio.rbi +50 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +226 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbi +259 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_client_secret.rbi +51 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +25 -597
- data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +195 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbi +144 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_turn_detection.rbi +94 -0
- data/rbi/openai/models/realtime/realtime_truncation.rbi +5 -56
- data/rbi/openai/models/realtime/realtime_truncation_retention_ratio.rbi +45 -0
- data/rbi/openai/models/realtime/response_cancel_event.rbi +3 -1
- data/rbi/openai/models/realtime/response_create_event.rbi +19 -786
- data/rbi/openai/models/realtime/response_done_event.rbi +7 -0
- data/rbi/openai/models/realtime/session_created_event.rbi +42 -9
- data/rbi/openai/models/realtime/session_update_event.rbi +57 -19
- data/rbi/openai/models/realtime/session_updated_event.rbi +42 -9
- data/rbi/openai/models/realtime/transcription_session_created.rbi +17 -591
- data/rbi/openai/models/realtime/transcription_session_update.rbi +425 -7
- data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +14 -591
- data/rbi/openai/resources/realtime/client_secrets.rbi +5 -3
- data/sig/openai/models/realtime/audio_transcription.rbs +57 -0
- data/sig/openai/models/realtime/client_secret_create_response.rbs +1 -251
- data/sig/openai/models/realtime/models.rbs +57 -0
- data/sig/openai/models/realtime/noise_reduction_type.rbs +16 -0
- data/sig/openai/models/realtime/realtime_audio_config.rbs +12 -331
- data/sig/openai/models/realtime/realtime_audio_config_input.rbs +72 -0
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +72 -0
- data/sig/openai/models/realtime/realtime_audio_formats.rbs +128 -0
- data/sig/openai/models/realtime/realtime_audio_input_turn_detection.rbs +99 -0
- data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +17 -2
- data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +30 -1
- data/sig/openai/models/realtime/realtime_response.rbs +103 -82
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +84 -0
- data/sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs +218 -0
- data/sig/openai/models/realtime/realtime_response_create_params.rbs +148 -0
- data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +50 -1
- data/sig/openai/models/realtime/realtime_session.rbs +16 -106
- data/sig/openai/models/realtime/realtime_session_client_secret.rbs +20 -0
- data/sig/openai/models/realtime/realtime_session_create_request.rbs +27 -43
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +389 -187
- data/sig/openai/models/realtime/realtime_tools_config_union.rbs +1 -53
- data/sig/openai/models/realtime/realtime_transcription_session_audio.rbs +24 -0
- data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +72 -0
- data/sig/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbs +99 -0
- data/sig/openai/models/realtime/realtime_transcription_session_client_secret.rbs +20 -0
- data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +11 -203
- data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +69 -0
- data/sig/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbs +59 -0
- data/sig/openai/models/realtime/realtime_transcription_session_turn_detection.rbs +47 -0
- data/sig/openai/models/realtime/realtime_truncation.rbs +1 -28
- data/sig/openai/models/realtime/realtime_truncation_retention_ratio.rbs +21 -0
- data/sig/openai/models/realtime/response_create_event.rbs +6 -249
- data/sig/openai/models/realtime/session_created_event.rbs +14 -4
- data/sig/openai/models/realtime/session_update_event.rbs +14 -4
- data/sig/openai/models/realtime/session_updated_event.rbs +14 -4
- data/sig/openai/models/realtime/transcription_session_created.rbs +4 -254
- data/sig/openai/models/realtime/transcription_session_update.rbs +154 -4
- data/sig/openai/models/realtime/transcription_session_updated_event.rbs +4 -254
- metadata +59 -5
- data/lib/openai/models/realtime/realtime_client_secret_config.rb +0 -64
- data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +0 -147
- data/sig/openai/models/realtime/realtime_client_secret_config.rbs +0 -60
|
@@ -4,29 +4,23 @@ module OpenAI
|
|
|
4
4
|
module Models
|
|
5
5
|
module Realtime
|
|
6
6
|
class RealtimeSessionCreateResponse < OpenAI::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute id
|
|
8
|
-
# Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
|
9
|
-
#
|
|
10
|
-
# @return [String, nil]
|
|
11
|
-
optional :id, String
|
|
12
|
-
|
|
13
7
|
# @!attribute audio
|
|
14
|
-
# Configuration for input and output audio
|
|
8
|
+
# Configuration for input and output audio.
|
|
15
9
|
#
|
|
16
10
|
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio, nil]
|
|
17
11
|
optional :audio, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio }
|
|
18
12
|
|
|
19
|
-
# @!attribute
|
|
20
|
-
#
|
|
13
|
+
# @!attribute client_secret
|
|
14
|
+
# Ephemeral key returned by the API.
|
|
21
15
|
#
|
|
22
|
-
# @return [
|
|
23
|
-
optional :
|
|
16
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionClientSecret, nil]
|
|
17
|
+
optional :client_secret, -> { OpenAI::Realtime::RealtimeSessionClientSecret }
|
|
24
18
|
|
|
25
19
|
# @!attribute include
|
|
26
20
|
# Additional fields to include in server outputs.
|
|
27
21
|
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
22
|
+
# `item.input_audio_transcription.logprobs`: Include logprobs for input audio
|
|
23
|
+
# transcription.
|
|
30
24
|
#
|
|
31
25
|
# @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>, nil]
|
|
32
26
|
optional :include,
|
|
@@ -60,86 +54,96 @@ module OpenAI
|
|
|
60
54
|
# @!attribute model
|
|
61
55
|
# The Realtime model used for this session.
|
|
62
56
|
#
|
|
63
|
-
# @return [String, nil]
|
|
64
|
-
optional :model,
|
|
65
|
-
|
|
66
|
-
# @!attribute object
|
|
67
|
-
# The object type. Always `realtime.session`.
|
|
68
|
-
#
|
|
69
|
-
# @return [String, nil]
|
|
70
|
-
optional :object, String
|
|
57
|
+
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model, nil]
|
|
58
|
+
optional :model, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Model }
|
|
71
59
|
|
|
72
60
|
# @!attribute output_modalities
|
|
73
|
-
# The set of modalities the model can respond with.
|
|
74
|
-
# ["text"]
|
|
61
|
+
# The set of modalities the model can respond with. It defaults to `["audio"]`,
|
|
62
|
+
# indicating that the model will respond with audio plus a transcript. `["text"]`
|
|
63
|
+
# can be used to make the model respond with text only. It is not possible to
|
|
64
|
+
# request both `text` and `audio` at the same time.
|
|
75
65
|
#
|
|
76
66
|
# @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::OutputModality>, nil]
|
|
77
67
|
optional :output_modalities,
|
|
78
68
|
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateResponse::OutputModality] }
|
|
79
69
|
|
|
70
|
+
# @!attribute prompt
|
|
71
|
+
# Reference to a prompt template and its variables.
|
|
72
|
+
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
|
73
|
+
#
|
|
74
|
+
# @return [OpenAI::Models::Responses::ResponsePrompt, nil]
|
|
75
|
+
optional :prompt, -> { OpenAI::Responses::ResponsePrompt }, nil?: true
|
|
76
|
+
|
|
80
77
|
# @!attribute tool_choice
|
|
81
|
-
# How the model chooses tools.
|
|
82
|
-
#
|
|
78
|
+
# How the model chooses tools. Provide one of the string modes or force a specific
|
|
79
|
+
# function/MCP tool.
|
|
83
80
|
#
|
|
84
|
-
# @return [
|
|
85
|
-
optional :tool_choice,
|
|
81
|
+
# @return [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp, nil]
|
|
82
|
+
optional :tool_choice, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::ToolChoice }
|
|
86
83
|
|
|
87
84
|
# @!attribute tools
|
|
88
|
-
# Tools
|
|
85
|
+
# Tools available to the model.
|
|
89
86
|
#
|
|
90
|
-
# @return [Array<OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool>, nil]
|
|
87
|
+
# @return [Array<OpenAI::Models::Realtime::Models, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool>, nil]
|
|
91
88
|
optional :tools,
|
|
92
|
-
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeSessionCreateResponse::Tool] }
|
|
89
|
+
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeSessionCreateResponse::Tool] }
|
|
93
90
|
|
|
94
91
|
# @!attribute tracing
|
|
95
|
-
#
|
|
96
|
-
#
|
|
92
|
+
# Realtime API can write session traces to the
|
|
93
|
+
# [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once
|
|
94
|
+
# tracing is enabled for a session, the configuration cannot be modified.
|
|
97
95
|
#
|
|
98
96
|
# `auto` will create a trace for the session with default values for the workflow
|
|
99
97
|
# name, group id, and metadata.
|
|
100
98
|
#
|
|
101
99
|
# @return [Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration, nil]
|
|
102
|
-
optional :tracing, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tracing }
|
|
100
|
+
optional :tracing, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tracing }, nil?: true
|
|
101
|
+
|
|
102
|
+
# @!attribute truncation
|
|
103
|
+
# Controls how the realtime conversation is truncated prior to model inference.
|
|
104
|
+
# The default is `auto`.
|
|
105
|
+
#
|
|
106
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio, nil]
|
|
107
|
+
optional :truncation, union: -> { OpenAI::Realtime::RealtimeTruncation }
|
|
103
108
|
|
|
104
|
-
# @!attribute
|
|
105
|
-
#
|
|
106
|
-
# means that the model will detect the start and end of speech based on audio
|
|
107
|
-
# volume and respond at the end of user speech.
|
|
109
|
+
# @!attribute type
|
|
110
|
+
# The type of session to create. Always `realtime` for the Realtime API.
|
|
108
111
|
#
|
|
109
|
-
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::
|
|
110
|
-
optional :
|
|
112
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Type, nil]
|
|
113
|
+
optional :type, enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Type }
|
|
111
114
|
|
|
112
|
-
# @!method initialize(
|
|
115
|
+
# @!method initialize(audio: nil, client_secret: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: nil)
|
|
113
116
|
# Some parameter documentations has been truncated, see
|
|
114
117
|
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse} for more details.
|
|
115
118
|
#
|
|
116
|
-
# A Realtime session configuration
|
|
119
|
+
# A new Realtime session configuration, with an ephemeral key. Default TTL for
|
|
120
|
+
# keys is one minute.
|
|
117
121
|
#
|
|
118
|
-
# @param
|
|
122
|
+
# @param audio [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio] Configuration for input and output audio.
|
|
119
123
|
#
|
|
120
|
-
# @param
|
|
121
|
-
#
|
|
122
|
-
# @param expires_at [Integer] Expiration timestamp for the session, in seconds since epoch.
|
|
124
|
+
# @param client_secret [OpenAI::Models::Realtime::RealtimeSessionClientSecret] Ephemeral key returned by the API.
|
|
123
125
|
#
|
|
124
126
|
# @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>] Additional fields to include in server outputs.
|
|
125
127
|
#
|
|
126
|
-
# @param instructions [String] The default system instructions (i.e. system message) prepended to model
|
|
128
|
+
# @param instructions [String] The default system instructions (i.e. system message) prepended to model calls.
|
|
127
129
|
#
|
|
128
130
|
# @param max_output_tokens [Integer, Symbol, :inf] Maximum number of output tokens for a single assistant response,
|
|
129
131
|
#
|
|
130
|
-
# @param model [String] The Realtime model used for this session.
|
|
132
|
+
# @param model [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model] The Realtime model used for this session.
|
|
133
|
+
#
|
|
134
|
+
# @param output_modalities [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::OutputModality>] The set of modalities the model can respond with. It defaults to `["audio"]`, in
|
|
131
135
|
#
|
|
132
|
-
# @param
|
|
136
|
+
# @param prompt [OpenAI::Models::Responses::ResponsePrompt, nil] Reference to a prompt template and its variables.
|
|
133
137
|
#
|
|
134
|
-
# @param
|
|
138
|
+
# @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
|
|
135
139
|
#
|
|
136
|
-
# @param
|
|
140
|
+
# @param tools [Array<OpenAI::Models::Realtime::Models, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool>] Tools available to the model.
|
|
137
141
|
#
|
|
138
|
-
# @param
|
|
142
|
+
# @param tracing [Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration, nil] Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces
|
|
139
143
|
#
|
|
140
|
-
# @param
|
|
144
|
+
# @param truncation [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio] Controls how the realtime conversation is truncated prior to model inference.
|
|
141
145
|
#
|
|
142
|
-
# @param
|
|
146
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Type] The type of session to create. Always `realtime` for the Realtime API.
|
|
143
147
|
|
|
144
148
|
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#audio
|
|
145
149
|
class Audio < OpenAI::Internal::Type::BaseModel
|
|
@@ -154,7 +158,7 @@ module OpenAI
|
|
|
154
158
|
optional :output, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Output }
|
|
155
159
|
|
|
156
160
|
# @!method initialize(input: nil, output: nil)
|
|
157
|
-
# Configuration for input and output audio
|
|
161
|
+
# Configuration for input and output audio.
|
|
158
162
|
#
|
|
159
163
|
# @param input [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input]
|
|
160
164
|
# @param output [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output]
|
|
@@ -162,27 +166,46 @@ module OpenAI
|
|
|
162
166
|
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio#input
|
|
163
167
|
class Input < OpenAI::Internal::Type::BaseModel
|
|
164
168
|
# @!attribute format_
|
|
165
|
-
# The format of input audio.
|
|
169
|
+
# The format of the input audio.
|
|
166
170
|
#
|
|
167
|
-
# @return [
|
|
168
|
-
optional :format_,
|
|
171
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA, nil]
|
|
172
|
+
optional :format_, union: -> { OpenAI::Realtime::RealtimeAudioFormats }, api_name: :format
|
|
169
173
|
|
|
170
174
|
# @!attribute noise_reduction
|
|
171
|
-
# Configuration for input audio noise reduction.
|
|
175
|
+
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
|
176
|
+
# off. Noise reduction filters audio added to the input audio buffer before it is
|
|
177
|
+
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
|
178
|
+
# detection accuracy (reducing false positives) and model performance by improving
|
|
179
|
+
# perception of the input audio.
|
|
172
180
|
#
|
|
173
181
|
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction, nil]
|
|
174
182
|
optional :noise_reduction,
|
|
175
183
|
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction }
|
|
176
184
|
|
|
177
185
|
# @!attribute transcription
|
|
178
|
-
# Configuration for input audio transcription
|
|
186
|
+
# Configuration for input audio transcription, defaults to off and can be set to
|
|
187
|
+
# `null` to turn off once on. Input audio transcription is not native to the
|
|
188
|
+
# model, since the model consumes audio directly. Transcription runs
|
|
189
|
+
# asynchronously through
|
|
190
|
+
# [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
|
|
191
|
+
# and should be treated as guidance of input audio content rather than precisely
|
|
192
|
+
# what the model heard. The client can optionally set the language and prompt for
|
|
193
|
+
# transcription, these offer additional guidance to the transcription service.
|
|
179
194
|
#
|
|
180
|
-
# @return [OpenAI::Models::Realtime::
|
|
181
|
-
optional :transcription,
|
|
182
|
-
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::Transcription }
|
|
195
|
+
# @return [OpenAI::Models::Realtime::AudioTranscription, nil]
|
|
196
|
+
optional :transcription, -> { OpenAI::Realtime::AudioTranscription }
|
|
183
197
|
|
|
184
198
|
# @!attribute turn_detection
|
|
185
|
-
# Configuration for turn detection.
|
|
199
|
+
# Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
|
200
|
+
# set to `null` to turn off, in which case the client must manually trigger model
|
|
201
|
+
# response. Server VAD means that the model will detect the start and end of
|
|
202
|
+
# speech based on audio volume and respond at the end of user speech. Semantic VAD
|
|
203
|
+
# is more advanced and uses a turn detection model (in conjunction with VAD) to
|
|
204
|
+
# semantically estimate whether the user has finished speaking, then dynamically
|
|
205
|
+
# sets a timeout based on this probability. For example, if user audio trails off
|
|
206
|
+
# with "uhhm", the model will score a low probability of turn end and wait longer
|
|
207
|
+
# for the user to continue speaking. This can be useful for more natural
|
|
208
|
+
# conversations, but may have a higher latency.
|
|
186
209
|
#
|
|
187
210
|
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection, nil]
|
|
188
211
|
optional :turn_detection,
|
|
@@ -193,127 +216,192 @@ module OpenAI
|
|
|
193
216
|
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input} for more
|
|
194
217
|
# details.
|
|
195
218
|
#
|
|
196
|
-
# @param format_ [
|
|
219
|
+
# @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The format of the input audio.
|
|
197
220
|
#
|
|
198
|
-
# @param noise_reduction [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction] Configuration for input audio noise reduction.
|
|
221
|
+
# @param noise_reduction [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction] Configuration for input audio noise reduction. This can be set to `null` to turn
|
|
199
222
|
#
|
|
200
|
-
# @param transcription [OpenAI::Models::Realtime::
|
|
223
|
+
# @param transcription [OpenAI::Models::Realtime::AudioTranscription] Configuration for input audio transcription, defaults to off and can be set to `
|
|
201
224
|
#
|
|
202
|
-
# @param turn_detection [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection] Configuration for turn detection.
|
|
225
|
+
# @param turn_detection [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection] Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
|
203
226
|
|
|
204
227
|
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#noise_reduction
|
|
205
228
|
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
|
206
229
|
# @!attribute type
|
|
230
|
+
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
231
|
+
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
232
|
+
# conference room microphones.
|
|
207
233
|
#
|
|
208
|
-
# @return [Symbol, OpenAI::Models::Realtime::
|
|
209
|
-
optional :type,
|
|
210
|
-
enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction::Type }
|
|
234
|
+
# @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
|
|
235
|
+
optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
|
|
211
236
|
|
|
212
237
|
# @!method initialize(type: nil)
|
|
213
|
-
#
|
|
238
|
+
# Some parameter documentations has been truncated, see
|
|
239
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction}
|
|
240
|
+
# for more details.
|
|
214
241
|
#
|
|
215
|
-
#
|
|
216
|
-
|
|
217
|
-
#
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
FAR_FIELD = :far_field
|
|
223
|
-
|
|
224
|
-
# @!method self.values
|
|
225
|
-
# @return [Array<Symbol>]
|
|
226
|
-
end
|
|
242
|
+
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
|
243
|
+
# off. Noise reduction filters audio added to the input audio buffer before it is
|
|
244
|
+
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
|
245
|
+
# detection accuracy (reducing false positives) and model performance by improving
|
|
246
|
+
# perception of the input audio.
|
|
247
|
+
#
|
|
248
|
+
# @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType] Type of noise reduction. `near_field` is for close-talking microphones such as h
|
|
227
249
|
end
|
|
228
250
|
|
|
229
|
-
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#
|
|
230
|
-
class
|
|
231
|
-
# @!attribute
|
|
232
|
-
#
|
|
251
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#turn_detection
|
|
252
|
+
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
|
253
|
+
# @!attribute create_response
|
|
254
|
+
# Whether or not to automatically generate a response when a VAD stop event
|
|
255
|
+
# occurs.
|
|
233
256
|
#
|
|
234
|
-
# @return [
|
|
235
|
-
optional :
|
|
236
|
-
|
|
237
|
-
# @!attribute
|
|
238
|
-
# The model to
|
|
257
|
+
# @return [Boolean, nil]
|
|
258
|
+
optional :create_response, OpenAI::Internal::Type::Boolean
|
|
259
|
+
|
|
260
|
+
# @!attribute eagerness
|
|
261
|
+
# Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
|
|
262
|
+
# will wait longer for the user to continue speaking, `high` will respond more
|
|
263
|
+
# quickly. `auto` is the default and is equivalent to `medium`. `low`, `medium`,
|
|
264
|
+
# and `high` have max timeouts of 8s, 4s, and 2s respectively.
|
|
239
265
|
#
|
|
240
|
-
# @return [
|
|
241
|
-
optional :
|
|
266
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::Eagerness, nil]
|
|
267
|
+
optional :eagerness,
|
|
268
|
+
enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::Eagerness }
|
|
242
269
|
|
|
243
|
-
# @!attribute
|
|
244
|
-
# Optional
|
|
270
|
+
# @!attribute idle_timeout_ms
|
|
271
|
+
# Optional idle timeout after which turn detection will auto-timeout when no
|
|
272
|
+
# additional audio is received.
|
|
245
273
|
#
|
|
246
|
-
# @return [
|
|
247
|
-
optional :
|
|
274
|
+
# @return [Integer, nil]
|
|
275
|
+
optional :idle_timeout_ms, Integer, nil?: true
|
|
248
276
|
|
|
249
|
-
# @!
|
|
250
|
-
#
|
|
251
|
-
#
|
|
252
|
-
#
|
|
253
|
-
#
|
|
254
|
-
# Configuration for input audio transcription.
|
|
277
|
+
# @!attribute interrupt_response
|
|
278
|
+
# Whether or not to automatically interrupt any ongoing response with output to
|
|
279
|
+
# the default conversation (i.e. `conversation` of `auto`) when a VAD start event
|
|
280
|
+
# occurs.
|
|
255
281
|
#
|
|
256
|
-
# @
|
|
257
|
-
|
|
258
|
-
# @param model [String] The model to use for transcription.
|
|
259
|
-
#
|
|
260
|
-
# @param prompt [String] Optional text to guide the model's style or continue a previous audio segment.
|
|
261
|
-
end
|
|
282
|
+
# @return [Boolean, nil]
|
|
283
|
+
optional :interrupt_response, OpenAI::Internal::Type::Boolean
|
|
262
284
|
|
|
263
|
-
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#turn_detection
|
|
264
|
-
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
|
265
285
|
# @!attribute prefix_padding_ms
|
|
286
|
+
# Used only for `server_vad` mode. Amount of audio to include before the VAD
|
|
287
|
+
# detected speech (in milliseconds). Defaults to 300ms.
|
|
266
288
|
#
|
|
267
289
|
# @return [Integer, nil]
|
|
268
290
|
optional :prefix_padding_ms, Integer
|
|
269
291
|
|
|
270
292
|
# @!attribute silence_duration_ms
|
|
293
|
+
# Used only for `server_vad` mode. Duration of silence to detect speech stop (in
|
|
294
|
+
# milliseconds). Defaults to 500ms. With shorter values the model will respond
|
|
295
|
+
# more quickly, but may jump in on short pauses from the user.
|
|
271
296
|
#
|
|
272
297
|
# @return [Integer, nil]
|
|
273
298
|
optional :silence_duration_ms, Integer
|
|
274
299
|
|
|
275
300
|
# @!attribute threshold
|
|
301
|
+
# Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
|
|
302
|
+
# defaults to 0.5. A higher threshold will require louder audio to activate the
|
|
303
|
+
# model, and thus might perform better in noisy environments.
|
|
276
304
|
#
|
|
277
305
|
# @return [Float, nil]
|
|
278
306
|
optional :threshold, Float
|
|
279
307
|
|
|
280
308
|
# @!attribute type
|
|
281
|
-
# Type of turn detection
|
|
309
|
+
# Type of turn detection.
|
|
282
310
|
#
|
|
283
|
-
# @return [
|
|
284
|
-
optional :type,
|
|
311
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::Type, nil]
|
|
312
|
+
optional :type,
|
|
313
|
+
enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::Type }
|
|
285
314
|
|
|
286
|
-
# @!method initialize(prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
|
|
315
|
+
# @!method initialize(create_response: nil, eagerness: nil, idle_timeout_ms: nil, interrupt_response: nil, prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
|
|
287
316
|
# Some parameter documentations has been truncated, see
|
|
288
317
|
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection}
|
|
289
318
|
# for more details.
|
|
290
319
|
#
|
|
291
|
-
# Configuration for turn detection.
|
|
320
|
+
# Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
|
321
|
+
# set to `null` to turn off, in which case the client must manually trigger model
|
|
322
|
+
# response. Server VAD means that the model will detect the start and end of
|
|
323
|
+
# speech based on audio volume and respond at the end of user speech. Semantic VAD
|
|
324
|
+
# is more advanced and uses a turn detection model (in conjunction with VAD) to
|
|
325
|
+
# semantically estimate whether the user has finished speaking, then dynamically
|
|
326
|
+
# sets a timeout based on this probability. For example, if user audio trails off
|
|
327
|
+
# with "uhhm", the model will score a low probability of turn end and wait longer
|
|
328
|
+
# for the user to continue speaking. This can be useful for more natural
|
|
329
|
+
# conversations, but may have a higher latency.
|
|
330
|
+
#
|
|
331
|
+
# @param create_response [Boolean] Whether or not to automatically generate a response when a VAD stop event occurs
|
|
332
|
+
#
|
|
333
|
+
# @param eagerness [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::Eagerness] Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
|
|
334
|
+
#
|
|
335
|
+
# @param idle_timeout_ms [Integer, nil] Optional idle timeout after which turn detection will auto-timeout when
|
|
336
|
+
#
|
|
337
|
+
# @param interrupt_response [Boolean] Whether or not to automatically interrupt any ongoing response with output to th
|
|
338
|
+
#
|
|
339
|
+
# @param prefix_padding_ms [Integer] Used only for `server_vad` mode. Amount of audio to include before the VAD detec
|
|
292
340
|
#
|
|
293
|
-
# @param
|
|
341
|
+
# @param silence_duration_ms [Integer] Used only for `server_vad` mode. Duration of silence to detect speech stop (in m
|
|
294
342
|
#
|
|
295
|
-
# @param
|
|
343
|
+
# @param threshold [Float] Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
|
|
296
344
|
#
|
|
297
|
-
# @param
|
|
345
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::Type] Type of turn detection.
|
|
346
|
+
|
|
347
|
+
# Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
|
|
348
|
+
# will wait longer for the user to continue speaking, `high` will respond more
|
|
349
|
+
# quickly. `auto` is the default and is equivalent to `medium`. `low`, `medium`,
|
|
350
|
+
# and `high` have max timeouts of 8s, 4s, and 2s respectively.
|
|
351
|
+
#
|
|
352
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection#eagerness
|
|
353
|
+
module Eagerness
|
|
354
|
+
extend OpenAI::Internal::Type::Enum
|
|
355
|
+
|
|
356
|
+
LOW = :low
|
|
357
|
+
MEDIUM = :medium
|
|
358
|
+
HIGH = :high
|
|
359
|
+
AUTO = :auto
|
|
360
|
+
|
|
361
|
+
# @!method self.values
|
|
362
|
+
# @return [Array<Symbol>]
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# Type of turn detection.
|
|
298
366
|
#
|
|
299
|
-
#
|
|
367
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection#type
|
|
368
|
+
module Type
|
|
369
|
+
extend OpenAI::Internal::Type::Enum
|
|
370
|
+
|
|
371
|
+
SERVER_VAD = :server_vad
|
|
372
|
+
SEMANTIC_VAD = :semantic_vad
|
|
373
|
+
|
|
374
|
+
# @!method self.values
|
|
375
|
+
# @return [Array<Symbol>]
|
|
376
|
+
end
|
|
300
377
|
end
|
|
301
378
|
end
|
|
302
379
|
|
|
303
380
|
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio#output
|
|
304
381
|
class Output < OpenAI::Internal::Type::BaseModel
|
|
305
382
|
# @!attribute format_
|
|
306
|
-
# The format of output audio.
|
|
383
|
+
# The format of the output audio.
|
|
307
384
|
#
|
|
308
|
-
# @return [
|
|
309
|
-
optional :format_,
|
|
385
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA, nil]
|
|
386
|
+
optional :format_, union: -> { OpenAI::Realtime::RealtimeAudioFormats }, api_name: :format
|
|
310
387
|
|
|
311
388
|
# @!attribute speed
|
|
389
|
+
# The speed of the model's spoken response as a multiple of the original speed.
|
|
390
|
+
# 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
|
|
391
|
+
# This value can only be changed in between model turns, not while a response is
|
|
392
|
+
# in progress.
|
|
393
|
+
#
|
|
394
|
+
# This parameter is a post-processing adjustment to the audio after it is
|
|
395
|
+
# generated, it's also possible to prompt the model to speak faster or slower.
|
|
312
396
|
#
|
|
313
397
|
# @return [Float, nil]
|
|
314
398
|
optional :speed, Float
|
|
315
399
|
|
|
316
400
|
# @!attribute voice
|
|
401
|
+
# The voice the model uses to respond. Voice cannot be changed during the session
|
|
402
|
+
# once the model has responded with audio at least once. Current voice options are
|
|
403
|
+
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
|
|
404
|
+
# and `cedar`. We recommend `marin` and `cedar` for best quality.
|
|
317
405
|
#
|
|
318
406
|
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice, nil]
|
|
319
407
|
optional :voice, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice }
|
|
@@ -323,12 +411,17 @@ module OpenAI
|
|
|
323
411
|
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output} for
|
|
324
412
|
# more details.
|
|
325
413
|
#
|
|
326
|
-
# @param format_ [
|
|
414
|
+
# @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The format of the output audio.
|
|
327
415
|
#
|
|
328
|
-
# @param speed [Float]
|
|
416
|
+
# @param speed [Float] The speed of the model's spoken response as a multiple of the original speed.
|
|
329
417
|
#
|
|
330
|
-
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice]
|
|
418
|
+
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice] The voice the model uses to respond. Voice cannot be changed during the
|
|
331
419
|
|
|
420
|
+
# The voice the model uses to respond. Voice cannot be changed during the session
|
|
421
|
+
# once the model has responded with audio at least once. Current voice options are
|
|
422
|
+
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
|
|
423
|
+
# and `cedar`. We recommend `marin` and `cedar` for best quality.
|
|
424
|
+
#
|
|
332
425
|
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output#voice
|
|
333
426
|
module Voice
|
|
334
427
|
extend OpenAI::Internal::Type::Union
|
|
@@ -405,6 +498,51 @@ module OpenAI
|
|
|
405
498
|
# @return [Array(Integer, Symbol, :inf)]
|
|
406
499
|
end
|
|
407
500
|
|
|
501
|
+
# The Realtime model used for this session.
|
|
502
|
+
#
|
|
503
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#model
|
|
504
|
+
module Model
|
|
505
|
+
extend OpenAI::Internal::Type::Union
|
|
506
|
+
|
|
507
|
+
variant String
|
|
508
|
+
|
|
509
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME }
|
|
510
|
+
|
|
511
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME_2025_08_28 }
|
|
512
|
+
|
|
513
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_REALTIME_PREVIEW }
|
|
514
|
+
|
|
515
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_REALTIME_PREVIEW_2024_10_01 }
|
|
516
|
+
|
|
517
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_REALTIME_PREVIEW_2024_12_17 }
|
|
518
|
+
|
|
519
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_REALTIME_PREVIEW_2025_06_03 }
|
|
520
|
+
|
|
521
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_MINI_REALTIME_PREVIEW }
|
|
522
|
+
|
|
523
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 }
|
|
524
|
+
|
|
525
|
+
# @!method self.variants
|
|
526
|
+
# @return [Array(String, Symbol)]
|
|
527
|
+
|
|
528
|
+
define_sorbet_constant!(:Variants) do
|
|
529
|
+
T.type_alias { T.any(String, OpenAI::Realtime::RealtimeSessionCreateResponse::Model::TaggedSymbol) }
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
# @!group
|
|
533
|
+
|
|
534
|
+
GPT_REALTIME = :"gpt-realtime"
|
|
535
|
+
GPT_REALTIME_2025_08_28 = :"gpt-realtime-2025-08-28"
|
|
536
|
+
GPT_4O_REALTIME_PREVIEW = :"gpt-4o-realtime-preview"
|
|
537
|
+
GPT_4O_REALTIME_PREVIEW_2024_10_01 = :"gpt-4o-realtime-preview-2024-10-01"
|
|
538
|
+
GPT_4O_REALTIME_PREVIEW_2024_12_17 = :"gpt-4o-realtime-preview-2024-12-17"
|
|
539
|
+
GPT_4O_REALTIME_PREVIEW_2025_06_03 = :"gpt-4o-realtime-preview-2025-06-03"
|
|
540
|
+
GPT_4O_MINI_REALTIME_PREVIEW = :"gpt-4o-mini-realtime-preview"
|
|
541
|
+
GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 = :"gpt-4o-mini-realtime-preview-2024-12-17"
|
|
542
|
+
|
|
543
|
+
# @!endgroup
|
|
544
|
+
end
|
|
545
|
+
|
|
408
546
|
module OutputModality
|
|
409
547
|
extend OpenAI::Internal::Type::Enum
|
|
410
548
|
|
|
@@ -415,60 +553,361 @@ module OpenAI
|
|
|
415
553
|
# @return [Array<Symbol>]
|
|
416
554
|
end
|
|
417
555
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
optional :description, String
|
|
556
|
+
# How the model chooses tools. Provide one of the string modes or force a specific
|
|
557
|
+
# function/MCP tool.
|
|
558
|
+
#
|
|
559
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#tool_choice
|
|
560
|
+
module ToolChoice
|
|
561
|
+
extend OpenAI::Internal::Type::Union
|
|
425
562
|
|
|
426
|
-
#
|
|
427
|
-
# The name of the function.
|
|
563
|
+
# Controls which (if any) tool is called by the model.
|
|
428
564
|
#
|
|
429
|
-
#
|
|
430
|
-
optional :name, String
|
|
431
|
-
|
|
432
|
-
# @!attribute parameters
|
|
433
|
-
# Parameters of the function in JSON Schema.
|
|
565
|
+
# `none` means the model will not call any tool and instead generates a message.
|
|
434
566
|
#
|
|
435
|
-
#
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
# @!attribute type
|
|
439
|
-
# The type of the tool, i.e. `function`.
|
|
567
|
+
# `auto` means the model can pick between generating a message or calling one or
|
|
568
|
+
# more tools.
|
|
440
569
|
#
|
|
441
|
-
#
|
|
442
|
-
|
|
570
|
+
# `required` means the model must call one or more tools.
|
|
571
|
+
variant enum: -> { OpenAI::Responses::ToolChoiceOptions }
|
|
443
572
|
|
|
444
|
-
#
|
|
445
|
-
|
|
446
|
-
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool} for more
|
|
447
|
-
# details.
|
|
448
|
-
#
|
|
449
|
-
# @param description [String] The description of the function, including guidance on when and how
|
|
450
|
-
#
|
|
451
|
-
# @param name [String] The name of the function.
|
|
452
|
-
#
|
|
453
|
-
# @param parameters [Object] Parameters of the function in JSON Schema.
|
|
454
|
-
#
|
|
455
|
-
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::Type] The type of the tool, i.e. `function`.
|
|
573
|
+
# Use this option to force the model to call a specific function.
|
|
574
|
+
variant -> { OpenAI::Responses::ToolChoiceFunction }
|
|
456
575
|
|
|
457
|
-
#
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
576
|
+
# Use this option to force the model to call a specific tool on a remote MCP server.
|
|
577
|
+
variant -> { OpenAI::Responses::ToolChoiceMcp }
|
|
578
|
+
|
|
579
|
+
# @!method self.variants
|
|
580
|
+
# @return [Array(Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp)]
|
|
581
|
+
end
|
|
582
|
+
|
|
583
|
+
# Give the model access to additional tools via remote Model Context Protocol
|
|
584
|
+
# (MCP) servers.
|
|
585
|
+
# [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
|
586
|
+
module Tool
|
|
587
|
+
extend OpenAI::Internal::Type::Union
|
|
462
588
|
|
|
463
|
-
|
|
589
|
+
variant -> { OpenAI::Realtime::Models }
|
|
590
|
+
|
|
591
|
+
# Give the model access to additional tools via remote Model Context Protocol
|
|
592
|
+
# (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
|
593
|
+
variant -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool }
|
|
594
|
+
|
|
595
|
+
class McpTool < OpenAI::Internal::Type::BaseModel
|
|
596
|
+
# @!attribute server_label
|
|
597
|
+
# A label for this MCP server, used to identify it in tool calls.
|
|
598
|
+
#
|
|
599
|
+
# @return [String]
|
|
600
|
+
required :server_label, String
|
|
464
601
|
|
|
465
|
-
# @!
|
|
466
|
-
#
|
|
602
|
+
# @!attribute type
|
|
603
|
+
# The type of the MCP tool. Always `mcp`.
|
|
604
|
+
#
|
|
605
|
+
# @return [Symbol, :mcp]
|
|
606
|
+
required :type, const: :mcp
|
|
607
|
+
|
|
608
|
+
# @!attribute allowed_tools
|
|
609
|
+
# List of allowed tool names or a filter object.
|
|
610
|
+
#
|
|
611
|
+
# @return [Array<String>, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools::McpToolFilter, nil]
|
|
612
|
+
optional :allowed_tools,
|
|
613
|
+
union: -> {
|
|
614
|
+
OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools
|
|
615
|
+
},
|
|
616
|
+
nil?: true
|
|
617
|
+
|
|
618
|
+
# @!attribute authorization
|
|
619
|
+
# An OAuth access token that can be used with a remote MCP server, either with a
|
|
620
|
+
# custom MCP server URL or a service connector. Your application must handle the
|
|
621
|
+
# OAuth authorization flow and provide the token here.
|
|
622
|
+
#
|
|
623
|
+
# @return [String, nil]
|
|
624
|
+
optional :authorization, String
|
|
625
|
+
|
|
626
|
+
# @!attribute connector_id
|
|
627
|
+
# Identifier for service connectors, like those available in ChatGPT. One of
|
|
628
|
+
# `server_url` or `connector_id` must be provided. Learn more about service
|
|
629
|
+
# connectors
|
|
630
|
+
# [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
|
|
631
|
+
#
|
|
632
|
+
# Currently supported `connector_id` values are:
|
|
633
|
+
#
|
|
634
|
+
# - Dropbox: `connector_dropbox`
|
|
635
|
+
# - Gmail: `connector_gmail`
|
|
636
|
+
# - Google Calendar: `connector_googlecalendar`
|
|
637
|
+
# - Google Drive: `connector_googledrive`
|
|
638
|
+
# - Microsoft Teams: `connector_microsoftteams`
|
|
639
|
+
# - Outlook Calendar: `connector_outlookcalendar`
|
|
640
|
+
# - Outlook Email: `connector_outlookemail`
|
|
641
|
+
# - SharePoint: `connector_sharepoint`
|
|
642
|
+
#
|
|
643
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::ConnectorID, nil]
|
|
644
|
+
optional :connector_id,
|
|
645
|
+
enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::ConnectorID }
|
|
646
|
+
|
|
647
|
+
# @!attribute headers
|
|
648
|
+
# Optional HTTP headers to send to the MCP server. Use for authentication or other
|
|
649
|
+
# purposes.
|
|
650
|
+
#
|
|
651
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
652
|
+
optional :headers, OpenAI::Internal::Type::HashOf[String], nil?: true
|
|
653
|
+
|
|
654
|
+
# @!attribute require_approval
|
|
655
|
+
# Specify which of the MCP server's tools require approval.
|
|
656
|
+
#
|
|
657
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalSetting, nil]
|
|
658
|
+
optional :require_approval,
|
|
659
|
+
union: -> {
|
|
660
|
+
OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval
|
|
661
|
+
},
|
|
662
|
+
nil?: true
|
|
663
|
+
|
|
664
|
+
# @!attribute server_description
|
|
665
|
+
# Optional description of the MCP server, used to provide more context.
|
|
666
|
+
#
|
|
667
|
+
# @return [String, nil]
|
|
668
|
+
optional :server_description, String
|
|
669
|
+
|
|
670
|
+
# @!attribute server_url
|
|
671
|
+
# The URL for the MCP server. One of `server_url` or `connector_id` must be
|
|
672
|
+
# provided.
|
|
673
|
+
#
|
|
674
|
+
# @return [String, nil]
|
|
675
|
+
optional :server_url, String
|
|
676
|
+
|
|
677
|
+
# @!method initialize(server_label:, allowed_tools: nil, authorization: nil, connector_id: nil, headers: nil, require_approval: nil, server_description: nil, server_url: nil, type: :mcp)
|
|
678
|
+
# Some parameter documentations has been truncated, see
|
|
679
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool} for
|
|
680
|
+
# more details.
|
|
681
|
+
#
|
|
682
|
+
# Give the model access to additional tools via remote Model Context Protocol
|
|
683
|
+
# (MCP) servers.
|
|
684
|
+
# [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
|
685
|
+
#
|
|
686
|
+
# @param server_label [String] A label for this MCP server, used to identify it in tool calls.
|
|
687
|
+
#
|
|
688
|
+
# @param allowed_tools [Array<String>, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools::McpToolFilter, nil] List of allowed tool names or a filter object.
|
|
689
|
+
#
|
|
690
|
+
# @param authorization [String] An OAuth access token that can be used with a remote MCP server, either
|
|
691
|
+
#
|
|
692
|
+
# @param connector_id [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::ConnectorID] Identifier for service connectors, like those available in ChatGPT. One of
|
|
693
|
+
#
|
|
694
|
+
# @param headers [Hash{Symbol=>String}, nil] Optional HTTP headers to send to the MCP server. Use for authentication
|
|
695
|
+
#
|
|
696
|
+
# @param require_approval [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalSetting, nil] Specify which of the MCP server's tools require approval.
|
|
697
|
+
#
|
|
698
|
+
# @param server_description [String] Optional description of the MCP server, used to provide more context.
|
|
699
|
+
#
|
|
700
|
+
# @param server_url [String] The URL for the MCP server. One of `server_url` or `connector_id` must be
|
|
701
|
+
#
|
|
702
|
+
# @param type [Symbol, :mcp] The type of the MCP tool. Always `mcp`.
|
|
703
|
+
|
|
704
|
+
# List of allowed tool names or a filter object.
|
|
705
|
+
#
|
|
706
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool#allowed_tools
|
|
707
|
+
module AllowedTools
|
|
708
|
+
extend OpenAI::Internal::Type::Union
|
|
709
|
+
|
|
710
|
+
# A string array of allowed tool names
|
|
711
|
+
variant -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools::StringArray }
|
|
712
|
+
|
|
713
|
+
# A filter object to specify which tools are allowed.
|
|
714
|
+
variant -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools::McpToolFilter }
|
|
715
|
+
|
|
716
|
+
class McpToolFilter < OpenAI::Internal::Type::BaseModel
|
|
717
|
+
# @!attribute read_only
|
|
718
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
719
|
+
# is
|
|
720
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
721
|
+
# it will match this filter.
|
|
722
|
+
#
|
|
723
|
+
# @return [Boolean, nil]
|
|
724
|
+
optional :read_only, OpenAI::Internal::Type::Boolean
|
|
725
|
+
|
|
726
|
+
# @!attribute tool_names
|
|
727
|
+
# List of allowed tool names.
|
|
728
|
+
#
|
|
729
|
+
# @return [Array<String>, nil]
|
|
730
|
+
optional :tool_names, OpenAI::Internal::Type::ArrayOf[String]
|
|
731
|
+
|
|
732
|
+
# @!method initialize(read_only: nil, tool_names: nil)
|
|
733
|
+
# Some parameter documentations has been truncated, see
|
|
734
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools::McpToolFilter}
|
|
735
|
+
# for more details.
|
|
736
|
+
#
|
|
737
|
+
# A filter object to specify which tools are allowed.
|
|
738
|
+
#
|
|
739
|
+
# @param read_only [Boolean] Indicates whether or not a tool modifies data or is read-only. If an
|
|
740
|
+
#
|
|
741
|
+
# @param tool_names [Array<String>] List of allowed tool names.
|
|
742
|
+
end
|
|
743
|
+
|
|
744
|
+
# @!method self.variants
|
|
745
|
+
# @return [Array(Array<String>, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::AllowedTools::McpToolFilter)]
|
|
746
|
+
|
|
747
|
+
# @type [OpenAI::Internal::Type::Converter]
|
|
748
|
+
StringArray = OpenAI::Internal::Type::ArrayOf[String]
|
|
749
|
+
end
|
|
750
|
+
|
|
751
|
+
# Identifier for service connectors, like those available in ChatGPT. One of
|
|
752
|
+
# `server_url` or `connector_id` must be provided. Learn more about service
|
|
753
|
+
# connectors
|
|
754
|
+
# [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
|
|
755
|
+
#
|
|
756
|
+
# Currently supported `connector_id` values are:
|
|
757
|
+
#
|
|
758
|
+
# - Dropbox: `connector_dropbox`
|
|
759
|
+
# - Gmail: `connector_gmail`
|
|
760
|
+
# - Google Calendar: `connector_googlecalendar`
|
|
761
|
+
# - Google Drive: `connector_googledrive`
|
|
762
|
+
# - Microsoft Teams: `connector_microsoftteams`
|
|
763
|
+
# - Outlook Calendar: `connector_outlookcalendar`
|
|
764
|
+
# - Outlook Email: `connector_outlookemail`
|
|
765
|
+
# - SharePoint: `connector_sharepoint`
|
|
766
|
+
#
|
|
767
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool#connector_id
|
|
768
|
+
module ConnectorID
|
|
769
|
+
extend OpenAI::Internal::Type::Enum
|
|
770
|
+
|
|
771
|
+
CONNECTOR_DROPBOX = :connector_dropbox
|
|
772
|
+
CONNECTOR_GMAIL = :connector_gmail
|
|
773
|
+
CONNECTOR_GOOGLECALENDAR = :connector_googlecalendar
|
|
774
|
+
CONNECTOR_GOOGLEDRIVE = :connector_googledrive
|
|
775
|
+
CONNECTOR_MICROSOFTTEAMS = :connector_microsoftteams
|
|
776
|
+
CONNECTOR_OUTLOOKCALENDAR = :connector_outlookcalendar
|
|
777
|
+
CONNECTOR_OUTLOOKEMAIL = :connector_outlookemail
|
|
778
|
+
CONNECTOR_SHAREPOINT = :connector_sharepoint
|
|
779
|
+
|
|
780
|
+
# @!method self.values
|
|
781
|
+
# @return [Array<Symbol>]
|
|
782
|
+
end
|
|
783
|
+
|
|
784
|
+
# Specify which of the MCP server's tools require approval.
|
|
785
|
+
#
|
|
786
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool#require_approval
|
|
787
|
+
module RequireApproval
|
|
788
|
+
extend OpenAI::Internal::Type::Union
|
|
789
|
+
|
|
790
|
+
# Specify which of the MCP server's tools require approval. Can be
|
|
791
|
+
# `always`, `never`, or a filter object associated with tools
|
|
792
|
+
# that require approval.
|
|
793
|
+
variant -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter }
|
|
794
|
+
|
|
795
|
+
# Specify a single approval policy for all tools. One of `always` or
|
|
796
|
+
# `never`. When set to `always`, all tools will require approval. When
|
|
797
|
+
# set to `never`, all tools will not require approval.
|
|
798
|
+
variant enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalSetting }
|
|
799
|
+
|
|
800
|
+
class McpToolApprovalFilter < OpenAI::Internal::Type::BaseModel
|
|
801
|
+
# @!attribute always
|
|
802
|
+
# A filter object to specify which tools are allowed.
|
|
803
|
+
#
|
|
804
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Always, nil]
|
|
805
|
+
optional :always,
|
|
806
|
+
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Always }
|
|
807
|
+
|
|
808
|
+
# @!attribute never
|
|
809
|
+
# A filter object to specify which tools are allowed.
|
|
810
|
+
#
|
|
811
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Never, nil]
|
|
812
|
+
optional :never,
|
|
813
|
+
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Never }
|
|
814
|
+
|
|
815
|
+
# @!method initialize(always: nil, never: nil)
|
|
816
|
+
# Some parameter documentations has been truncated, see
|
|
817
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter}
|
|
818
|
+
# for more details.
|
|
819
|
+
#
|
|
820
|
+
# Specify which of the MCP server's tools require approval. Can be `always`,
|
|
821
|
+
# `never`, or a filter object associated with tools that require approval.
|
|
822
|
+
#
|
|
823
|
+
# @param always [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Always] A filter object to specify which tools are allowed.
|
|
824
|
+
#
|
|
825
|
+
# @param never [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Never] A filter object to specify which tools are allowed.
|
|
826
|
+
|
|
827
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter#always
|
|
828
|
+
class Always < OpenAI::Internal::Type::BaseModel
|
|
829
|
+
# @!attribute read_only
|
|
830
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
831
|
+
# is
|
|
832
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
833
|
+
# it will match this filter.
|
|
834
|
+
#
|
|
835
|
+
# @return [Boolean, nil]
|
|
836
|
+
optional :read_only, OpenAI::Internal::Type::Boolean
|
|
837
|
+
|
|
838
|
+
# @!attribute tool_names
|
|
839
|
+
# List of allowed tool names.
|
|
840
|
+
#
|
|
841
|
+
# @return [Array<String>, nil]
|
|
842
|
+
optional :tool_names, OpenAI::Internal::Type::ArrayOf[String]
|
|
843
|
+
|
|
844
|
+
# @!method initialize(read_only: nil, tool_names: nil)
|
|
845
|
+
# Some parameter documentations has been truncated, see
|
|
846
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Always}
|
|
847
|
+
# for more details.
|
|
848
|
+
#
|
|
849
|
+
# A filter object to specify which tools are allowed.
|
|
850
|
+
#
|
|
851
|
+
# @param read_only [Boolean] Indicates whether or not a tool modifies data or is read-only. If an
|
|
852
|
+
#
|
|
853
|
+
# @param tool_names [Array<String>] List of allowed tool names.
|
|
854
|
+
end
|
|
855
|
+
|
|
856
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter#never
|
|
857
|
+
class Never < OpenAI::Internal::Type::BaseModel
|
|
858
|
+
# @!attribute read_only
|
|
859
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
860
|
+
# is
|
|
861
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
862
|
+
# it will match this filter.
|
|
863
|
+
#
|
|
864
|
+
# @return [Boolean, nil]
|
|
865
|
+
optional :read_only, OpenAI::Internal::Type::Boolean
|
|
866
|
+
|
|
867
|
+
# @!attribute tool_names
|
|
868
|
+
# List of allowed tool names.
|
|
869
|
+
#
|
|
870
|
+
# @return [Array<String>, nil]
|
|
871
|
+
optional :tool_names, OpenAI::Internal::Type::ArrayOf[String]
|
|
872
|
+
|
|
873
|
+
# @!method initialize(read_only: nil, tool_names: nil)
|
|
874
|
+
# Some parameter documentations has been truncated, see
|
|
875
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter::Never}
|
|
876
|
+
# for more details.
|
|
877
|
+
#
|
|
878
|
+
# A filter object to specify which tools are allowed.
|
|
879
|
+
#
|
|
880
|
+
# @param read_only [Boolean] Indicates whether or not a tool modifies data or is read-only. If an
|
|
881
|
+
#
|
|
882
|
+
# @param tool_names [Array<String>] List of allowed tool names.
|
|
883
|
+
end
|
|
884
|
+
end
|
|
885
|
+
|
|
886
|
+
# Specify a single approval policy for all tools. One of `always` or `never`. When
|
|
887
|
+
# set to `always`, all tools will require approval. When set to `never`, all tools
|
|
888
|
+
# will not require approval.
|
|
889
|
+
module McpToolApprovalSetting
|
|
890
|
+
extend OpenAI::Internal::Type::Enum
|
|
891
|
+
|
|
892
|
+
ALWAYS = :always
|
|
893
|
+
NEVER = :never
|
|
894
|
+
|
|
895
|
+
# @!method self.values
|
|
896
|
+
# @return [Array<Symbol>]
|
|
897
|
+
end
|
|
898
|
+
|
|
899
|
+
# @!method self.variants
|
|
900
|
+
# @return [Array(OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool::RequireApproval::McpToolApprovalSetting)]
|
|
901
|
+
end
|
|
467
902
|
end
|
|
903
|
+
|
|
904
|
+
# @!method self.variants
|
|
905
|
+
# @return [Array(OpenAI::Models::Realtime::Models, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool)]
|
|
468
906
|
end
|
|
469
907
|
|
|
470
|
-
#
|
|
471
|
-
#
|
|
908
|
+
# Realtime API can write session traces to the
|
|
909
|
+
# [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once
|
|
910
|
+
# tracing is enabled for a session, the configuration cannot be modified.
|
|
472
911
|
#
|
|
473
912
|
# `auto` will create a trace for the session with default values for the workflow
|
|
474
913
|
# name, group id, and metadata.
|
|
@@ -486,21 +925,21 @@ module OpenAI
|
|
|
486
925
|
class TracingConfiguration < OpenAI::Internal::Type::BaseModel
|
|
487
926
|
# @!attribute group_id
|
|
488
927
|
# The group id to attach to this trace to enable filtering and grouping in the
|
|
489
|
-
#
|
|
928
|
+
# Traces Dashboard.
|
|
490
929
|
#
|
|
491
930
|
# @return [String, nil]
|
|
492
931
|
optional :group_id, String
|
|
493
932
|
|
|
494
933
|
# @!attribute metadata
|
|
495
|
-
# The arbitrary metadata to attach to this trace to enable filtering in the
|
|
496
|
-
#
|
|
934
|
+
# The arbitrary metadata to attach to this trace to enable filtering in the Traces
|
|
935
|
+
# Dashboard.
|
|
497
936
|
#
|
|
498
937
|
# @return [Object, nil]
|
|
499
938
|
optional :metadata, OpenAI::Internal::Type::Unknown
|
|
500
939
|
|
|
501
940
|
# @!attribute workflow_name
|
|
502
941
|
# The name of the workflow to attach to this trace. This is used to name the trace
|
|
503
|
-
# in the
|
|
942
|
+
# in the Traces Dashboard.
|
|
504
943
|
#
|
|
505
944
|
# @return [String, nil]
|
|
506
945
|
optional :workflow_name, String
|
|
@@ -523,53 +962,16 @@ module OpenAI
|
|
|
523
962
|
# @return [Array(Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration)]
|
|
524
963
|
end
|
|
525
964
|
|
|
526
|
-
#
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
#
|
|
532
|
-
# @return [Integer, nil]
|
|
533
|
-
optional :prefix_padding_ms, Integer
|
|
534
|
-
|
|
535
|
-
# @!attribute silence_duration_ms
|
|
536
|
-
# Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
|
|
537
|
-
# With shorter values the model will respond more quickly, but may jump in on
|
|
538
|
-
# short pauses from the user.
|
|
539
|
-
#
|
|
540
|
-
# @return [Integer, nil]
|
|
541
|
-
optional :silence_duration_ms, Integer
|
|
542
|
-
|
|
543
|
-
# @!attribute threshold
|
|
544
|
-
# Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
|
|
545
|
-
# threshold will require louder audio to activate the model, and thus might
|
|
546
|
-
# perform better in noisy environments.
|
|
547
|
-
#
|
|
548
|
-
# @return [Float, nil]
|
|
549
|
-
optional :threshold, Float
|
|
965
|
+
# The type of session to create. Always `realtime` for the Realtime API.
|
|
966
|
+
#
|
|
967
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#type
|
|
968
|
+
module Type
|
|
969
|
+
extend OpenAI::Internal::Type::Enum
|
|
550
970
|
|
|
551
|
-
|
|
552
|
-
# Type of turn detection, only `server_vad` is currently supported.
|
|
553
|
-
#
|
|
554
|
-
# @return [String, nil]
|
|
555
|
-
optional :type, String
|
|
971
|
+
REALTIME = :realtime
|
|
556
972
|
|
|
557
|
-
# @!method
|
|
558
|
-
#
|
|
559
|
-
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::TurnDetection} for
|
|
560
|
-
# more details.
|
|
561
|
-
#
|
|
562
|
-
# Configuration for turn detection. Can be set to `null` to turn off. Server VAD
|
|
563
|
-
# means that the model will detect the start and end of speech based on audio
|
|
564
|
-
# volume and respond at the end of user speech.
|
|
565
|
-
#
|
|
566
|
-
# @param prefix_padding_ms [Integer] Amount of audio to include before the VAD detected speech (in
|
|
567
|
-
#
|
|
568
|
-
# @param silence_duration_ms [Integer] Duration of silence to detect speech stop (in milliseconds). Defaults
|
|
569
|
-
#
|
|
570
|
-
# @param threshold [Float] Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
|
|
571
|
-
#
|
|
572
|
-
# @param type [String] Type of turn detection, only `server_vad` is currently supported.
|
|
973
|
+
# @!method self.values
|
|
974
|
+
# @return [Array<Symbol>]
|
|
573
975
|
end
|
|
574
976
|
end
|
|
575
977
|
end
|