openai 0.22.0 → 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 +18 -0
- data/README.md +1 -1
- data/lib/openai/internal/stream.rb +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
@@ -28,14 +28,19 @@ module OpenAI
|
|
28
28
|
# {OpenAI::Models::Realtime::InputAudioBufferAppendEvent} for more details.
|
29
29
|
#
|
30
30
|
# Send this event to append audio bytes to the input audio buffer. The audio
|
31
|
-
# buffer is temporary storage you can write to and later commit.
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
31
|
+
# buffer is temporary storage you can write to and later commit. A "commit" will
|
32
|
+
# create a new user message item in the conversation history from the buffer
|
33
|
+
# content and clear the buffer. Input audio transcription (if enabled) will be
|
34
|
+
# generated when the buffer is committed.
|
35
|
+
#
|
36
|
+
# If VAD is enabled the audio buffer is used to detect speech and the server will
|
37
|
+
# decide when to commit. When Server VAD is disabled, you must commit the audio
|
38
|
+
# buffer manually. Input audio noise reduction operates on writes to the audio
|
39
|
+
# buffer.
|
35
40
|
#
|
36
41
|
# The client may choose how much audio to place in each event up to a maximum of
|
37
42
|
# 15 MiB, for example streaming smaller chunks from the client may allow the VAD
|
38
|
-
# to be more responsive. Unlike
|
43
|
+
# to be more responsive. Unlike most other client events, the server will not send
|
39
44
|
# a confirmation response to this event.
|
40
45
|
#
|
41
46
|
# @param audio [String] Base64-encoded audio bytes. This must be in the format specified by the
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class Models < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute description
|
8
|
+
# The description of the function, including guidance on when and how to call it,
|
9
|
+
# and guidance about what to tell the user when calling (if anything).
|
10
|
+
#
|
11
|
+
# @return [String, nil]
|
12
|
+
optional :description, String
|
13
|
+
|
14
|
+
# @!attribute name
|
15
|
+
# The name of the function.
|
16
|
+
#
|
17
|
+
# @return [String, nil]
|
18
|
+
optional :name, String
|
19
|
+
|
20
|
+
# @!attribute parameters
|
21
|
+
# Parameters of the function in JSON Schema.
|
22
|
+
#
|
23
|
+
# @return [Object, nil]
|
24
|
+
optional :parameters, OpenAI::Internal::Type::Unknown
|
25
|
+
|
26
|
+
# @!attribute type
|
27
|
+
# The type of the tool, i.e. `function`.
|
28
|
+
#
|
29
|
+
# @return [Symbol, OpenAI::Models::Realtime::Models::Type, nil]
|
30
|
+
optional :type, enum: -> { OpenAI::Realtime::Models::Type }
|
31
|
+
|
32
|
+
# @!method initialize(description: nil, name: nil, parameters: nil, type: nil)
|
33
|
+
# Some parameter documentations has been truncated, see
|
34
|
+
# {OpenAI::Models::Realtime::Models} for more details.
|
35
|
+
#
|
36
|
+
# @param description [String] The description of the function, including guidance on when and how
|
37
|
+
#
|
38
|
+
# @param name [String] The name of the function.
|
39
|
+
#
|
40
|
+
# @param parameters [Object] Parameters of the function in JSON Schema.
|
41
|
+
#
|
42
|
+
# @param type [Symbol, OpenAI::Models::Realtime::Models::Type] The type of the tool, i.e. `function`.
|
43
|
+
|
44
|
+
# The type of the tool, i.e. `function`.
|
45
|
+
#
|
46
|
+
# @see OpenAI::Models::Realtime::Models#type
|
47
|
+
module Type
|
48
|
+
extend OpenAI::Internal::Type::Enum
|
49
|
+
|
50
|
+
FUNCTION = :function
|
51
|
+
|
52
|
+
# @!method self.values
|
53
|
+
# @return [Array<Symbol>]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
7
|
+
# headphones, `far_field` is for far-field microphones such as laptop or
|
8
|
+
# conference room microphones.
|
9
|
+
module NoiseReductionType
|
10
|
+
extend OpenAI::Internal::Type::Enum
|
11
|
+
|
12
|
+
NEAR_FIELD = :near_field
|
13
|
+
FAR_FIELD = :far_field
|
14
|
+
|
15
|
+
# @!method self.values
|
16
|
+
# @return [Array<Symbol>]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -6,440 +6,19 @@ module OpenAI
|
|
6
6
|
class RealtimeAudioConfig < OpenAI::Internal::Type::BaseModel
|
7
7
|
# @!attribute input
|
8
8
|
#
|
9
|
-
# @return [OpenAI::Models::Realtime::
|
10
|
-
optional :input, -> { OpenAI::Realtime::
|
9
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioConfigInput, nil]
|
10
|
+
optional :input, -> { OpenAI::Realtime::RealtimeAudioConfigInput }
|
11
11
|
|
12
12
|
# @!attribute output
|
13
13
|
#
|
14
|
-
# @return [OpenAI::Models::Realtime::
|
15
|
-
optional :output, -> { OpenAI::Realtime::
|
14
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioConfigOutput, nil]
|
15
|
+
optional :output, -> { OpenAI::Realtime::RealtimeAudioConfigOutput }
|
16
16
|
|
17
17
|
# @!method initialize(input: nil, output: nil)
|
18
18
|
# Configuration for input and output audio.
|
19
19
|
#
|
20
|
-
# @param input [OpenAI::Models::Realtime::
|
21
|
-
# @param output [OpenAI::Models::Realtime::
|
22
|
-
|
23
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig#input
|
24
|
-
class Input < OpenAI::Internal::Type::BaseModel
|
25
|
-
# @!attribute format_
|
26
|
-
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
|
27
|
-
# `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
|
28
|
-
# (mono), and little-endian byte order.
|
29
|
-
#
|
30
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Format, nil]
|
31
|
-
optional :format_,
|
32
|
-
enum: -> {
|
33
|
-
OpenAI::Realtime::RealtimeAudioConfig::Input::Format
|
34
|
-
},
|
35
|
-
api_name: :format
|
36
|
-
|
37
|
-
# @!attribute noise_reduction
|
38
|
-
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
39
|
-
# off. Noise reduction filters audio added to the input audio buffer before it is
|
40
|
-
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
41
|
-
# detection accuracy (reducing false positives) and model performance by improving
|
42
|
-
# perception of the input audio.
|
43
|
-
#
|
44
|
-
# @return [OpenAI::Models::Realtime::RealtimeAudioConfig::Input::NoiseReduction, nil]
|
45
|
-
optional :noise_reduction, -> { OpenAI::Realtime::RealtimeAudioConfig::Input::NoiseReduction }
|
46
|
-
|
47
|
-
# @!attribute transcription
|
48
|
-
# Configuration for input audio transcription, defaults to off and can be set to
|
49
|
-
# `null` to turn off once on. Input audio transcription is not native to the
|
50
|
-
# model, since the model consumes audio directly. Transcription runs
|
51
|
-
# asynchronously through
|
52
|
-
# [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
|
53
|
-
# and should be treated as guidance of input audio content rather than precisely
|
54
|
-
# what the model heard. The client can optionally set the language and prompt for
|
55
|
-
# transcription, these offer additional guidance to the transcription service.
|
56
|
-
#
|
57
|
-
# @return [OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Transcription, nil]
|
58
|
-
optional :transcription, -> { OpenAI::Realtime::RealtimeAudioConfig::Input::Transcription }
|
59
|
-
|
60
|
-
# @!attribute turn_detection
|
61
|
-
# Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
62
|
-
# set to `null` to turn off, in which case the client must manually trigger model
|
63
|
-
# response. Server VAD means that the model will detect the start and end of
|
64
|
-
# speech based on audio volume and respond at the end of user speech. Semantic VAD
|
65
|
-
# is more advanced and uses a turn detection model (in conjunction with VAD) to
|
66
|
-
# semantically estimate whether the user has finished speaking, then dynamically
|
67
|
-
# sets a timeout based on this probability. For example, if user audio trails off
|
68
|
-
# with "uhhm", the model will score a low probability of turn end and wait longer
|
69
|
-
# for the user to continue speaking. This can be useful for more natural
|
70
|
-
# conversations, but may have a higher latency.
|
71
|
-
#
|
72
|
-
# @return [OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection, nil]
|
73
|
-
optional :turn_detection, -> { OpenAI::Realtime::RealtimeAudioConfig::Input::TurnDetection }
|
74
|
-
|
75
|
-
# @!method initialize(format_: nil, noise_reduction: nil, transcription: nil, turn_detection: nil)
|
76
|
-
# Some parameter documentations has been truncated, see
|
77
|
-
# {OpenAI::Models::Realtime::RealtimeAudioConfig::Input} for more details.
|
78
|
-
#
|
79
|
-
# @param format_ [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Format] The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
80
|
-
#
|
81
|
-
# @param noise_reduction [OpenAI::Models::Realtime::RealtimeAudioConfig::Input::NoiseReduction] Configuration for input audio noise reduction. This can be set to `null` to turn
|
82
|
-
#
|
83
|
-
# @param transcription [OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Transcription] Configuration for input audio transcription, defaults to off and can be set to `
|
84
|
-
#
|
85
|
-
# @param turn_detection [OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection] Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
86
|
-
|
87
|
-
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
|
88
|
-
# `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
|
89
|
-
# (mono), and little-endian byte order.
|
90
|
-
#
|
91
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input#format_
|
92
|
-
module Format
|
93
|
-
extend OpenAI::Internal::Type::Enum
|
94
|
-
|
95
|
-
PCM16 = :pcm16
|
96
|
-
G711_ULAW = :g711_ulaw
|
97
|
-
G711_ALAW = :g711_alaw
|
98
|
-
|
99
|
-
# @!method self.values
|
100
|
-
# @return [Array<Symbol>]
|
101
|
-
end
|
102
|
-
|
103
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input#noise_reduction
|
104
|
-
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
105
|
-
# @!attribute type
|
106
|
-
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
107
|
-
# headphones, `far_field` is for far-field microphones such as laptop or
|
108
|
-
# conference room microphones.
|
109
|
-
#
|
110
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::NoiseReduction::Type, nil]
|
111
|
-
optional :type, enum: -> { OpenAI::Realtime::RealtimeAudioConfig::Input::NoiseReduction::Type }
|
112
|
-
|
113
|
-
# @!method initialize(type: nil)
|
114
|
-
# Some parameter documentations has been truncated, see
|
115
|
-
# {OpenAI::Models::Realtime::RealtimeAudioConfig::Input::NoiseReduction} for more
|
116
|
-
# details.
|
117
|
-
#
|
118
|
-
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
119
|
-
# off. Noise reduction filters audio added to the input audio buffer before it is
|
120
|
-
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
121
|
-
# detection accuracy (reducing false positives) and model performance by improving
|
122
|
-
# perception of the input audio.
|
123
|
-
#
|
124
|
-
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::NoiseReduction::Type] Type of noise reduction. `near_field` is for close-talking microphones such as h
|
125
|
-
|
126
|
-
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
127
|
-
# headphones, `far_field` is for far-field microphones such as laptop or
|
128
|
-
# conference room microphones.
|
129
|
-
#
|
130
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input::NoiseReduction#type
|
131
|
-
module Type
|
132
|
-
extend OpenAI::Internal::Type::Enum
|
133
|
-
|
134
|
-
NEAR_FIELD = :near_field
|
135
|
-
FAR_FIELD = :far_field
|
136
|
-
|
137
|
-
# @!method self.values
|
138
|
-
# @return [Array<Symbol>]
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input#transcription
|
143
|
-
class Transcription < OpenAI::Internal::Type::BaseModel
|
144
|
-
# @!attribute language
|
145
|
-
# The language of the input audio. Supplying the input language in
|
146
|
-
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
147
|
-
# format will improve accuracy and latency.
|
148
|
-
#
|
149
|
-
# @return [String, nil]
|
150
|
-
optional :language, String
|
151
|
-
|
152
|
-
# @!attribute model
|
153
|
-
# The model to use for transcription. Current options are `whisper-1`,
|
154
|
-
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, `gpt-4o-transcribe`, and
|
155
|
-
# `gpt-4o-transcribe-diarize`.
|
156
|
-
#
|
157
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Transcription::Model, nil]
|
158
|
-
optional :model, enum: -> { OpenAI::Realtime::RealtimeAudioConfig::Input::Transcription::Model }
|
159
|
-
|
160
|
-
# @!attribute prompt
|
161
|
-
# An optional text to guide the model's style or continue a previous audio
|
162
|
-
# segment. For `whisper-1`, the
|
163
|
-
# [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
|
164
|
-
# For `gpt-4o-transcribe` models, the prompt is a free text string, for example
|
165
|
-
# "expect words related to technology".
|
166
|
-
#
|
167
|
-
# @return [String, nil]
|
168
|
-
optional :prompt, String
|
169
|
-
|
170
|
-
# @!method initialize(language: nil, model: nil, prompt: nil)
|
171
|
-
# Some parameter documentations has been truncated, see
|
172
|
-
# {OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Transcription} for more
|
173
|
-
# details.
|
174
|
-
#
|
175
|
-
# Configuration for input audio transcription, defaults to off and can be set to
|
176
|
-
# `null` to turn off once on. Input audio transcription is not native to the
|
177
|
-
# model, since the model consumes audio directly. Transcription runs
|
178
|
-
# asynchronously through
|
179
|
-
# [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
|
180
|
-
# and should be treated as guidance of input audio content rather than precisely
|
181
|
-
# what the model heard. The client can optionally set the language and prompt for
|
182
|
-
# transcription, these offer additional guidance to the transcription service.
|
183
|
-
#
|
184
|
-
# @param language [String] The language of the input audio. Supplying the input language in
|
185
|
-
#
|
186
|
-
# @param model [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Transcription::Model] The model to use for transcription. Current options are
|
187
|
-
#
|
188
|
-
# @param prompt [String] An optional text to guide the model's style or continue a previous audio
|
189
|
-
|
190
|
-
# The model to use for transcription. Current options are `whisper-1`,
|
191
|
-
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, `gpt-4o-transcribe`, and
|
192
|
-
# `gpt-4o-transcribe-diarize`.
|
193
|
-
#
|
194
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input::Transcription#model
|
195
|
-
module Model
|
196
|
-
extend OpenAI::Internal::Type::Enum
|
197
|
-
|
198
|
-
WHISPER_1 = :"whisper-1"
|
199
|
-
GPT_4O_TRANSCRIBE_LATEST = :"gpt-4o-transcribe-latest"
|
200
|
-
GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
|
201
|
-
GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
|
202
|
-
GPT_4O_TRANSCRIBE_DIARIZE = :"gpt-4o-transcribe-diarize"
|
203
|
-
|
204
|
-
# @!method self.values
|
205
|
-
# @return [Array<Symbol>]
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input#turn_detection
|
210
|
-
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
211
|
-
# @!attribute create_response
|
212
|
-
# Whether or not to automatically generate a response when a VAD stop event
|
213
|
-
# occurs.
|
214
|
-
#
|
215
|
-
# @return [Boolean, nil]
|
216
|
-
optional :create_response, OpenAI::Internal::Type::Boolean
|
217
|
-
|
218
|
-
# @!attribute eagerness
|
219
|
-
# Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
|
220
|
-
# will wait longer for the user to continue speaking, `high` will respond more
|
221
|
-
# quickly. `auto` is the default and is equivalent to `medium`.
|
222
|
-
#
|
223
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection::Eagerness, nil]
|
224
|
-
optional :eagerness, enum: -> { OpenAI::Realtime::RealtimeAudioConfig::Input::TurnDetection::Eagerness }
|
225
|
-
|
226
|
-
# @!attribute idle_timeout_ms
|
227
|
-
# Optional idle timeout after which turn detection will auto-timeout when no
|
228
|
-
# additional audio is received.
|
229
|
-
#
|
230
|
-
# @return [Integer, nil]
|
231
|
-
optional :idle_timeout_ms, Integer, nil?: true
|
232
|
-
|
233
|
-
# @!attribute interrupt_response
|
234
|
-
# Whether or not to automatically interrupt any ongoing response with output to
|
235
|
-
# the default conversation (i.e. `conversation` of `auto`) when a VAD start event
|
236
|
-
# occurs.
|
237
|
-
#
|
238
|
-
# @return [Boolean, nil]
|
239
|
-
optional :interrupt_response, OpenAI::Internal::Type::Boolean
|
240
|
-
|
241
|
-
# @!attribute prefix_padding_ms
|
242
|
-
# Used only for `server_vad` mode. Amount of audio to include before the VAD
|
243
|
-
# detected speech (in milliseconds). Defaults to 300ms.
|
244
|
-
#
|
245
|
-
# @return [Integer, nil]
|
246
|
-
optional :prefix_padding_ms, Integer
|
247
|
-
|
248
|
-
# @!attribute silence_duration_ms
|
249
|
-
# Used only for `server_vad` mode. Duration of silence to detect speech stop (in
|
250
|
-
# milliseconds). Defaults to 500ms. With shorter values the model will respond
|
251
|
-
# more quickly, but may jump in on short pauses from the user.
|
252
|
-
#
|
253
|
-
# @return [Integer, nil]
|
254
|
-
optional :silence_duration_ms, Integer
|
255
|
-
|
256
|
-
# @!attribute threshold
|
257
|
-
# Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
|
258
|
-
# defaults to 0.5. A higher threshold will require louder audio to activate the
|
259
|
-
# model, and thus might perform better in noisy environments.
|
260
|
-
#
|
261
|
-
# @return [Float, nil]
|
262
|
-
optional :threshold, Float
|
263
|
-
|
264
|
-
# @!attribute type
|
265
|
-
# Type of turn detection.
|
266
|
-
#
|
267
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection::Type, nil]
|
268
|
-
optional :type, enum: -> { OpenAI::Realtime::RealtimeAudioConfig::Input::TurnDetection::Type }
|
269
|
-
|
270
|
-
# @!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)
|
271
|
-
# Some parameter documentations has been truncated, see
|
272
|
-
# {OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection} for more
|
273
|
-
# details.
|
274
|
-
#
|
275
|
-
# Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
276
|
-
# set to `null` to turn off, in which case the client must manually trigger model
|
277
|
-
# response. Server VAD means that the model will detect the start and end of
|
278
|
-
# speech based on audio volume and respond at the end of user speech. Semantic VAD
|
279
|
-
# is more advanced and uses a turn detection model (in conjunction with VAD) to
|
280
|
-
# semantically estimate whether the user has finished speaking, then dynamically
|
281
|
-
# sets a timeout based on this probability. For example, if user audio trails off
|
282
|
-
# with "uhhm", the model will score a low probability of turn end and wait longer
|
283
|
-
# for the user to continue speaking. This can be useful for more natural
|
284
|
-
# conversations, but may have a higher latency.
|
285
|
-
#
|
286
|
-
# @param create_response [Boolean] Whether or not to automatically generate a response when a VAD stop event occurs
|
287
|
-
#
|
288
|
-
# @param eagerness [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection::Eagerness] Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
|
289
|
-
#
|
290
|
-
# @param idle_timeout_ms [Integer, nil] Optional idle timeout after which turn detection will auto-timeout when
|
291
|
-
#
|
292
|
-
# @param interrupt_response [Boolean] Whether or not to automatically interrupt any ongoing response with output to th
|
293
|
-
#
|
294
|
-
# @param prefix_padding_ms [Integer] Used only for `server_vad` mode. Amount of audio to include before the VAD detec
|
295
|
-
#
|
296
|
-
# @param silence_duration_ms [Integer] Used only for `server_vad` mode. Duration of silence to detect speech stop (in m
|
297
|
-
#
|
298
|
-
# @param threshold [Float] Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
|
299
|
-
#
|
300
|
-
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection::Type] Type of turn detection.
|
301
|
-
|
302
|
-
# Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
|
303
|
-
# will wait longer for the user to continue speaking, `high` will respond more
|
304
|
-
# quickly. `auto` is the default and is equivalent to `medium`.
|
305
|
-
#
|
306
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection#eagerness
|
307
|
-
module Eagerness
|
308
|
-
extend OpenAI::Internal::Type::Enum
|
309
|
-
|
310
|
-
LOW = :low
|
311
|
-
MEDIUM = :medium
|
312
|
-
HIGH = :high
|
313
|
-
AUTO = :auto
|
314
|
-
|
315
|
-
# @!method self.values
|
316
|
-
# @return [Array<Symbol>]
|
317
|
-
end
|
318
|
-
|
319
|
-
# Type of turn detection.
|
320
|
-
#
|
321
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Input::TurnDetection#type
|
322
|
-
module Type
|
323
|
-
extend OpenAI::Internal::Type::Enum
|
324
|
-
|
325
|
-
SERVER_VAD = :server_vad
|
326
|
-
SEMANTIC_VAD = :semantic_vad
|
327
|
-
|
328
|
-
# @!method self.values
|
329
|
-
# @return [Array<Symbol>]
|
330
|
-
end
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig#output
|
335
|
-
class Output < OpenAI::Internal::Type::BaseModel
|
336
|
-
# @!attribute format_
|
337
|
-
# The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
338
|
-
# For `pcm16`, output audio is sampled at a rate of 24kHz.
|
339
|
-
#
|
340
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Format, nil]
|
341
|
-
optional :format_,
|
342
|
-
enum: -> {
|
343
|
-
OpenAI::Realtime::RealtimeAudioConfig::Output::Format
|
344
|
-
},
|
345
|
-
api_name: :format
|
346
|
-
|
347
|
-
# @!attribute speed
|
348
|
-
# The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
|
349
|
-
# minimum speed. 1.5 is the maximum speed. This value can only be changed in
|
350
|
-
# between model turns, not while a response is in progress.
|
351
|
-
#
|
352
|
-
# @return [Float, nil]
|
353
|
-
optional :speed, Float
|
354
|
-
|
355
|
-
# @!attribute voice
|
356
|
-
# The voice the model uses to respond. Voice cannot be changed during the session
|
357
|
-
# once the model has responded with audio at least once. Current voice options are
|
358
|
-
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
|
359
|
-
# and `cedar`.
|
360
|
-
#
|
361
|
-
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice, nil]
|
362
|
-
optional :voice, union: -> { OpenAI::Realtime::RealtimeAudioConfig::Output::Voice }
|
363
|
-
|
364
|
-
# @!method initialize(format_: nil, speed: nil, voice: nil)
|
365
|
-
# Some parameter documentations has been truncated, see
|
366
|
-
# {OpenAI::Models::Realtime::RealtimeAudioConfig::Output} for more details.
|
367
|
-
#
|
368
|
-
# @param format_ [Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Format] The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
369
|
-
#
|
370
|
-
# @param speed [Float] The speed of the model's spoken response. 1.0 is the default speed. 0.25 is
|
371
|
-
#
|
372
|
-
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice] The voice the model uses to respond. Voice cannot be changed during the
|
373
|
-
|
374
|
-
# The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
375
|
-
# For `pcm16`, output audio is sampled at a rate of 24kHz.
|
376
|
-
#
|
377
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Output#format_
|
378
|
-
module Format
|
379
|
-
extend OpenAI::Internal::Type::Enum
|
380
|
-
|
381
|
-
PCM16 = :pcm16
|
382
|
-
G711_ULAW = :g711_ulaw
|
383
|
-
G711_ALAW = :g711_alaw
|
384
|
-
|
385
|
-
# @!method self.values
|
386
|
-
# @return [Array<Symbol>]
|
387
|
-
end
|
388
|
-
|
389
|
-
# The voice the model uses to respond. Voice cannot be changed during the session
|
390
|
-
# once the model has responded with audio at least once. Current voice options are
|
391
|
-
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
|
392
|
-
# and `cedar`.
|
393
|
-
#
|
394
|
-
# @see OpenAI::Models::Realtime::RealtimeAudioConfig::Output#voice
|
395
|
-
module Voice
|
396
|
-
extend OpenAI::Internal::Type::Union
|
397
|
-
|
398
|
-
variant String
|
399
|
-
|
400
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::ALLOY }
|
401
|
-
|
402
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::ASH }
|
403
|
-
|
404
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::BALLAD }
|
405
|
-
|
406
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::CORAL }
|
407
|
-
|
408
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::ECHO }
|
409
|
-
|
410
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::SAGE }
|
411
|
-
|
412
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::SHIMMER }
|
413
|
-
|
414
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::VERSE }
|
415
|
-
|
416
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::MARIN }
|
417
|
-
|
418
|
-
variant const: -> { OpenAI::Models::Realtime::RealtimeAudioConfig::Output::Voice::CEDAR }
|
419
|
-
|
420
|
-
# @!method self.variants
|
421
|
-
# @return [Array(String, Symbol)]
|
422
|
-
|
423
|
-
define_sorbet_constant!(:Variants) do
|
424
|
-
T.type_alias { T.any(String, OpenAI::Realtime::RealtimeAudioConfig::Output::Voice::TaggedSymbol) }
|
425
|
-
end
|
426
|
-
|
427
|
-
# @!group
|
428
|
-
|
429
|
-
ALLOY = :alloy
|
430
|
-
ASH = :ash
|
431
|
-
BALLAD = :ballad
|
432
|
-
CORAL = :coral
|
433
|
-
ECHO = :echo
|
434
|
-
SAGE = :sage
|
435
|
-
SHIMMER = :shimmer
|
436
|
-
VERSE = :verse
|
437
|
-
MARIN = :marin
|
438
|
-
CEDAR = :cedar
|
439
|
-
|
440
|
-
# @!endgroup
|
441
|
-
end
|
442
|
-
end
|
20
|
+
# @param input [OpenAI::Models::Realtime::RealtimeAudioConfigInput]
|
21
|
+
# @param output [OpenAI::Models::Realtime::RealtimeAudioConfigOutput]
|
443
22
|
end
|
444
23
|
end
|
445
24
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeAudioConfigInput < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute format_
|
8
|
+
# The format of the input audio.
|
9
|
+
#
|
10
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA, nil]
|
11
|
+
optional :format_, union: -> { OpenAI::Realtime::RealtimeAudioFormats }, api_name: :format
|
12
|
+
|
13
|
+
# @!attribute noise_reduction
|
14
|
+
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
15
|
+
# off. Noise reduction filters audio added to the input audio buffer before it is
|
16
|
+
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
17
|
+
# detection accuracy (reducing false positives) and model performance by improving
|
18
|
+
# perception of the input audio.
|
19
|
+
#
|
20
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioConfigInput::NoiseReduction, nil]
|
21
|
+
optional :noise_reduction, -> { OpenAI::Realtime::RealtimeAudioConfigInput::NoiseReduction }
|
22
|
+
|
23
|
+
# @!attribute transcription
|
24
|
+
# Configuration for input audio transcription, defaults to off and can be set to
|
25
|
+
# `null` to turn off once on. Input audio transcription is not native to the
|
26
|
+
# model, since the model consumes audio directly. Transcription runs
|
27
|
+
# asynchronously through
|
28
|
+
# [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
|
29
|
+
# and should be treated as guidance of input audio content rather than precisely
|
30
|
+
# what the model heard. The client can optionally set the language and prompt for
|
31
|
+
# transcription, these offer additional guidance to the transcription service.
|
32
|
+
#
|
33
|
+
# @return [OpenAI::Models::Realtime::AudioTranscription, nil]
|
34
|
+
optional :transcription, -> { OpenAI::Realtime::AudioTranscription }
|
35
|
+
|
36
|
+
# @!attribute turn_detection
|
37
|
+
# Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
38
|
+
# set to `null` to turn off, in which case the client must manually trigger model
|
39
|
+
# response. Server VAD means that the model will detect the start and end of
|
40
|
+
# speech based on audio volume and respond at the end of user speech. Semantic VAD
|
41
|
+
# is more advanced and uses a turn detection model (in conjunction with VAD) to
|
42
|
+
# semantically estimate whether the user has finished speaking, then dynamically
|
43
|
+
# sets a timeout based on this probability. For example, if user audio trails off
|
44
|
+
# with "uhhm", the model will score a low probability of turn end and wait longer
|
45
|
+
# for the user to continue speaking. This can be useful for more natural
|
46
|
+
# conversations, but may have a higher latency.
|
47
|
+
#
|
48
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioInputTurnDetection, nil]
|
49
|
+
optional :turn_detection, -> { OpenAI::Realtime::RealtimeAudioInputTurnDetection }
|
50
|
+
|
51
|
+
# @!method initialize(format_: nil, noise_reduction: nil, transcription: nil, turn_detection: nil)
|
52
|
+
# Some parameter documentations has been truncated, see
|
53
|
+
# {OpenAI::Models::Realtime::RealtimeAudioConfigInput} for more details.
|
54
|
+
#
|
55
|
+
# @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The format of the input audio.
|
56
|
+
#
|
57
|
+
# @param noise_reduction [OpenAI::Models::Realtime::RealtimeAudioConfigInput::NoiseReduction] Configuration for input audio noise reduction. This can be set to `null` to turn
|
58
|
+
#
|
59
|
+
# @param transcription [OpenAI::Models::Realtime::AudioTranscription] Configuration for input audio transcription, defaults to off and can be set to `
|
60
|
+
#
|
61
|
+
# @param turn_detection [OpenAI::Models::Realtime::RealtimeAudioInputTurnDetection] Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
|
62
|
+
|
63
|
+
# @see OpenAI::Models::Realtime::RealtimeAudioConfigInput#noise_reduction
|
64
|
+
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
65
|
+
# @!attribute type
|
66
|
+
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
67
|
+
# headphones, `far_field` is for far-field microphones such as laptop or
|
68
|
+
# conference room microphones.
|
69
|
+
#
|
70
|
+
# @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
|
71
|
+
optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
|
72
|
+
|
73
|
+
# @!method initialize(type: nil)
|
74
|
+
# Some parameter documentations has been truncated, see
|
75
|
+
# {OpenAI::Models::Realtime::RealtimeAudioConfigInput::NoiseReduction} for more
|
76
|
+
# details.
|
77
|
+
#
|
78
|
+
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
79
|
+
# off. Noise reduction filters audio added to the input audio buffer before it is
|
80
|
+
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
81
|
+
# detection accuracy (reducing false positives) and model performance by improving
|
82
|
+
# perception of the input audio.
|
83
|
+
#
|
84
|
+
# @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType] Type of noise reduction. `near_field` is for close-talking microphones such as h
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|