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
|
@@ -11,10 +11,14 @@ module OpenAI
|
|
|
11
11
|
required :event_id, String
|
|
12
12
|
|
|
13
13
|
# @!attribute session
|
|
14
|
-
# A Realtime transcription session configuration
|
|
14
|
+
# A new Realtime transcription session configuration.
|
|
15
15
|
#
|
|
16
|
-
#
|
|
17
|
-
|
|
16
|
+
# When a session is created on the server via REST API, the session object also
|
|
17
|
+
# contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
|
|
18
|
+
# not present when a session is updated via the WebSocket API.
|
|
19
|
+
#
|
|
20
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse]
|
|
21
|
+
required :session, -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse }
|
|
18
22
|
|
|
19
23
|
# @!attribute type
|
|
20
24
|
# The event type, must be `transcription_session.updated`.
|
|
@@ -31,248 +35,9 @@ module OpenAI
|
|
|
31
35
|
#
|
|
32
36
|
# @param event_id [String] The unique ID of the server event.
|
|
33
37
|
#
|
|
34
|
-
# @param session [OpenAI::Models::Realtime::
|
|
38
|
+
# @param session [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse] A new Realtime transcription session configuration.
|
|
35
39
|
#
|
|
36
40
|
# @param type [Symbol, :"transcription_session.updated"] The event type, must be `transcription_session.updated`.
|
|
37
|
-
|
|
38
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent#session
|
|
39
|
-
class Session < OpenAI::Internal::Type::BaseModel
|
|
40
|
-
# @!attribute id
|
|
41
|
-
# Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
|
42
|
-
#
|
|
43
|
-
# @return [String, nil]
|
|
44
|
-
optional :id, String
|
|
45
|
-
|
|
46
|
-
# @!attribute audio
|
|
47
|
-
# Configuration for input audio for the session.
|
|
48
|
-
#
|
|
49
|
-
# @return [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio, nil]
|
|
50
|
-
optional :audio, -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio }
|
|
51
|
-
|
|
52
|
-
# @!attribute expires_at
|
|
53
|
-
# Expiration timestamp for the session, in seconds since epoch.
|
|
54
|
-
#
|
|
55
|
-
# @return [Integer, nil]
|
|
56
|
-
optional :expires_at, Integer
|
|
57
|
-
|
|
58
|
-
# @!attribute include
|
|
59
|
-
# Additional fields to include in server outputs.
|
|
60
|
-
#
|
|
61
|
-
# - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
|
|
62
|
-
# transcription.
|
|
63
|
-
#
|
|
64
|
-
# @return [Array<Symbol, OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Include>, nil]
|
|
65
|
-
optional :include,
|
|
66
|
-
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Include] }
|
|
67
|
-
|
|
68
|
-
# @!attribute object
|
|
69
|
-
# The object type. Always `realtime.transcription_session`.
|
|
70
|
-
#
|
|
71
|
-
# @return [String, nil]
|
|
72
|
-
optional :object, String
|
|
73
|
-
|
|
74
|
-
# @!method initialize(id: nil, audio: nil, expires_at: nil, include: nil, object: nil)
|
|
75
|
-
# Some parameter documentations has been truncated, see
|
|
76
|
-
# {OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session} for more
|
|
77
|
-
# details.
|
|
78
|
-
#
|
|
79
|
-
# A Realtime transcription session configuration object.
|
|
80
|
-
#
|
|
81
|
-
# @param id [String] Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
|
82
|
-
#
|
|
83
|
-
# @param audio [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio] Configuration for input audio for the session.
|
|
84
|
-
#
|
|
85
|
-
# @param expires_at [Integer] Expiration timestamp for the session, in seconds since epoch.
|
|
86
|
-
#
|
|
87
|
-
# @param include [Array<Symbol, OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Include>] Additional fields to include in server outputs.
|
|
88
|
-
#
|
|
89
|
-
# @param object [String] The object type. Always `realtime.transcription_session`.
|
|
90
|
-
|
|
91
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session#audio
|
|
92
|
-
class Audio < OpenAI::Internal::Type::BaseModel
|
|
93
|
-
# @!attribute input
|
|
94
|
-
#
|
|
95
|
-
# @return [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input, nil]
|
|
96
|
-
optional :input, -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input }
|
|
97
|
-
|
|
98
|
-
# @!method initialize(input: nil)
|
|
99
|
-
# Configuration for input audio for the session.
|
|
100
|
-
#
|
|
101
|
-
# @param input [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input]
|
|
102
|
-
|
|
103
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio#input
|
|
104
|
-
class Input < OpenAI::Internal::Type::BaseModel
|
|
105
|
-
# @!attribute format_
|
|
106
|
-
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
|
107
|
-
#
|
|
108
|
-
# @return [String, nil]
|
|
109
|
-
optional :format_, String, api_name: :format
|
|
110
|
-
|
|
111
|
-
# @!attribute noise_reduction
|
|
112
|
-
# Configuration for input audio noise reduction.
|
|
113
|
-
#
|
|
114
|
-
# @return [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction, nil]
|
|
115
|
-
optional :noise_reduction,
|
|
116
|
-
-> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction }
|
|
117
|
-
|
|
118
|
-
# @!attribute transcription
|
|
119
|
-
# Configuration of the transcription model.
|
|
120
|
-
#
|
|
121
|
-
# @return [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription, nil]
|
|
122
|
-
optional :transcription,
|
|
123
|
-
-> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription }
|
|
124
|
-
|
|
125
|
-
# @!attribute turn_detection
|
|
126
|
-
# Configuration for turn detection.
|
|
127
|
-
#
|
|
128
|
-
# @return [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::TurnDetection, nil]
|
|
129
|
-
optional :turn_detection,
|
|
130
|
-
-> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::TurnDetection }
|
|
131
|
-
|
|
132
|
-
# @!method initialize(format_: nil, noise_reduction: nil, transcription: nil, turn_detection: nil)
|
|
133
|
-
# Some parameter documentations has been truncated, see
|
|
134
|
-
# {OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input}
|
|
135
|
-
# for more details.
|
|
136
|
-
#
|
|
137
|
-
# @param format_ [String] The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
|
138
|
-
#
|
|
139
|
-
# @param noise_reduction [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction] Configuration for input audio noise reduction.
|
|
140
|
-
#
|
|
141
|
-
# @param transcription [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription] Configuration of the transcription model.
|
|
142
|
-
#
|
|
143
|
-
# @param turn_detection [OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::TurnDetection] Configuration for turn detection.
|
|
144
|
-
|
|
145
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input#noise_reduction
|
|
146
|
-
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
|
147
|
-
# @!attribute type
|
|
148
|
-
#
|
|
149
|
-
# @return [Symbol, OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction::Type, nil]
|
|
150
|
-
optional :type,
|
|
151
|
-
enum: -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction::Type }
|
|
152
|
-
|
|
153
|
-
# @!method initialize(type: nil)
|
|
154
|
-
# Configuration for input audio noise reduction.
|
|
155
|
-
#
|
|
156
|
-
# @param type [Symbol, OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction::Type]
|
|
157
|
-
|
|
158
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::NoiseReduction#type
|
|
159
|
-
module Type
|
|
160
|
-
extend OpenAI::Internal::Type::Enum
|
|
161
|
-
|
|
162
|
-
NEAR_FIELD = :near_field
|
|
163
|
-
FAR_FIELD = :far_field
|
|
164
|
-
|
|
165
|
-
# @!method self.values
|
|
166
|
-
# @return [Array<Symbol>]
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input#transcription
|
|
171
|
-
class Transcription < OpenAI::Internal::Type::BaseModel
|
|
172
|
-
# @!attribute language
|
|
173
|
-
# The language of the input audio. Supplying the input language in
|
|
174
|
-
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
175
|
-
# format will improve accuracy and latency.
|
|
176
|
-
#
|
|
177
|
-
# @return [String, nil]
|
|
178
|
-
optional :language, String
|
|
179
|
-
|
|
180
|
-
# @!attribute model
|
|
181
|
-
# The model to use for transcription. Can be `gpt-4o-transcribe`,
|
|
182
|
-
# `gpt-4o-mini-transcribe`, or `whisper-1`.
|
|
183
|
-
#
|
|
184
|
-
# @return [Symbol, OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription::Model, nil]
|
|
185
|
-
optional :model,
|
|
186
|
-
enum: -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription::Model }
|
|
187
|
-
|
|
188
|
-
# @!attribute prompt
|
|
189
|
-
# An optional text to guide the model's style or continue a previous audio
|
|
190
|
-
# segment. The
|
|
191
|
-
# [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
192
|
-
# should match the audio language.
|
|
193
|
-
#
|
|
194
|
-
# @return [String, nil]
|
|
195
|
-
optional :prompt, String
|
|
196
|
-
|
|
197
|
-
# @!method initialize(language: nil, model: nil, prompt: nil)
|
|
198
|
-
# Some parameter documentations has been truncated, see
|
|
199
|
-
# {OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription}
|
|
200
|
-
# for more details.
|
|
201
|
-
#
|
|
202
|
-
# Configuration of the transcription model.
|
|
203
|
-
#
|
|
204
|
-
# @param language [String] The language of the input audio. Supplying the input language in
|
|
205
|
-
#
|
|
206
|
-
# @param model [Symbol, OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription::Model] The model to use for transcription. Can be `gpt-4o-transcribe`, `gpt-4o-mini-tra
|
|
207
|
-
#
|
|
208
|
-
# @param prompt [String] An optional text to guide the model's style or continue a previous audio segment
|
|
209
|
-
|
|
210
|
-
# The model to use for transcription. Can be `gpt-4o-transcribe`,
|
|
211
|
-
# `gpt-4o-mini-transcribe`, or `whisper-1`.
|
|
212
|
-
#
|
|
213
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::Transcription#model
|
|
214
|
-
module Model
|
|
215
|
-
extend OpenAI::Internal::Type::Enum
|
|
216
|
-
|
|
217
|
-
GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
|
|
218
|
-
GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
|
|
219
|
-
WHISPER_1 = :"whisper-1"
|
|
220
|
-
|
|
221
|
-
# @!method self.values
|
|
222
|
-
# @return [Array<Symbol>]
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
# @see OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input#turn_detection
|
|
227
|
-
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
|
228
|
-
# @!attribute prefix_padding_ms
|
|
229
|
-
#
|
|
230
|
-
# @return [Integer, nil]
|
|
231
|
-
optional :prefix_padding_ms, Integer
|
|
232
|
-
|
|
233
|
-
# @!attribute silence_duration_ms
|
|
234
|
-
#
|
|
235
|
-
# @return [Integer, nil]
|
|
236
|
-
optional :silence_duration_ms, Integer
|
|
237
|
-
|
|
238
|
-
# @!attribute threshold
|
|
239
|
-
#
|
|
240
|
-
# @return [Float, nil]
|
|
241
|
-
optional :threshold, Float
|
|
242
|
-
|
|
243
|
-
# @!attribute type
|
|
244
|
-
# Type of turn detection, only `server_vad` is currently supported.
|
|
245
|
-
#
|
|
246
|
-
# @return [String, nil]
|
|
247
|
-
optional :type, String
|
|
248
|
-
|
|
249
|
-
# @!method initialize(prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
|
|
250
|
-
# Some parameter documentations has been truncated, see
|
|
251
|
-
# {OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::Audio::Input::TurnDetection}
|
|
252
|
-
# for more details.
|
|
253
|
-
#
|
|
254
|
-
# Configuration for turn detection.
|
|
255
|
-
#
|
|
256
|
-
# @param prefix_padding_ms [Integer]
|
|
257
|
-
#
|
|
258
|
-
# @param silence_duration_ms [Integer]
|
|
259
|
-
#
|
|
260
|
-
# @param threshold [Float]
|
|
261
|
-
#
|
|
262
|
-
# @param type [String] Type of turn detection, only `server_vad` is currently supported.
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
module Include
|
|
268
|
-
extend OpenAI::Internal::Type::Enum
|
|
269
|
-
|
|
270
|
-
ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = :"item.input_audio_transcription.logprobs"
|
|
271
|
-
|
|
272
|
-
# @!method self.values
|
|
273
|
-
# @return [Array<Symbol>]
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
41
|
end
|
|
277
42
|
end
|
|
278
43
|
end
|
|
@@ -7,12 +7,11 @@ module OpenAI
|
|
|
7
7
|
# Some parameter documentations has been truncated, see
|
|
8
8
|
# {OpenAI::Models::Realtime::ClientSecretCreateParams} for more details.
|
|
9
9
|
#
|
|
10
|
-
# Create a Realtime
|
|
11
|
-
# transcription.
|
|
10
|
+
# Create a Realtime client secret with an associated session configuration.
|
|
12
11
|
#
|
|
13
12
|
# @overload create(expires_after: nil, session: nil, request_options: {})
|
|
14
13
|
#
|
|
15
|
-
# @param expires_after [OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter] Configuration for the
|
|
14
|
+
# @param expires_after [OpenAI::Models::Realtime::ClientSecretCreateParams::ExpiresAfter] Configuration for the client secret expiration. Expiration refers to the time af
|
|
16
15
|
#
|
|
17
16
|
# @param session [OpenAI::Models::Realtime::RealtimeSessionCreateRequest, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest] Session configuration to use for the client secret. Choose either a realtime
|
|
18
17
|
#
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -380,6 +380,7 @@ require_relative "openai/models/moderation_model"
|
|
|
380
380
|
require_relative "openai/models/moderation_multi_modal_input"
|
|
381
381
|
require_relative "openai/models/moderation_text_input"
|
|
382
382
|
require_relative "openai/models/other_file_chunking_strategy_object"
|
|
383
|
+
require_relative "openai/models/realtime/audio_transcription"
|
|
383
384
|
require_relative "openai/models/realtime/client_secret_create_params"
|
|
384
385
|
require_relative "openai/models/realtime/client_secret_create_response"
|
|
385
386
|
require_relative "openai/models/realtime/conversation_created_event"
|
|
@@ -410,11 +411,16 @@ require_relative "openai/models/realtime/log_prob_properties"
|
|
|
410
411
|
require_relative "openai/models/realtime/mcp_list_tools_completed"
|
|
411
412
|
require_relative "openai/models/realtime/mcp_list_tools_failed"
|
|
412
413
|
require_relative "openai/models/realtime/mcp_list_tools_in_progress"
|
|
414
|
+
require_relative "openai/models/realtime/models"
|
|
415
|
+
require_relative "openai/models/realtime/noise_reduction_type"
|
|
413
416
|
require_relative "openai/models/realtime/output_audio_buffer_clear_event"
|
|
414
417
|
require_relative "openai/models/realtime/rate_limits_updated_event"
|
|
415
418
|
require_relative "openai/models/realtime/realtime_audio_config"
|
|
419
|
+
require_relative "openai/models/realtime/realtime_audio_config_input"
|
|
420
|
+
require_relative "openai/models/realtime/realtime_audio_config_output"
|
|
421
|
+
require_relative "openai/models/realtime/realtime_audio_formats"
|
|
422
|
+
require_relative "openai/models/realtime/realtime_audio_input_turn_detection"
|
|
416
423
|
require_relative "openai/models/realtime/realtime_client_event"
|
|
417
|
-
require_relative "openai/models/realtime/realtime_client_secret_config"
|
|
418
424
|
require_relative "openai/models/realtime/realtime_conversation_item_assistant_message"
|
|
419
425
|
require_relative "openai/models/realtime/realtime_conversation_item_function_call"
|
|
420
426
|
require_relative "openai/models/realtime/realtime_conversation_item_function_call_output"
|
|
@@ -430,20 +436,32 @@ require_relative "openai/models/realtime/realtime_mcp_protocol_error"
|
|
|
430
436
|
require_relative "openai/models/realtime/realtime_mcp_tool_call"
|
|
431
437
|
require_relative "openai/models/realtime/realtime_mcp_tool_execution_error"
|
|
432
438
|
require_relative "openai/models/realtime/realtime_response"
|
|
439
|
+
require_relative "openai/models/realtime/realtime_response_create_audio_output"
|
|
440
|
+
require_relative "openai/models/realtime/realtime_response_create_mcp_tool"
|
|
441
|
+
require_relative "openai/models/realtime/realtime_response_create_params"
|
|
433
442
|
require_relative "openai/models/realtime/realtime_response_status"
|
|
434
443
|
require_relative "openai/models/realtime/realtime_response_usage"
|
|
435
444
|
require_relative "openai/models/realtime/realtime_response_usage_input_token_details"
|
|
436
445
|
require_relative "openai/models/realtime/realtime_response_usage_output_token_details"
|
|
437
446
|
require_relative "openai/models/realtime/realtime_server_event"
|
|
438
447
|
require_relative "openai/models/realtime/realtime_session"
|
|
448
|
+
require_relative "openai/models/realtime/realtime_session_client_secret"
|
|
439
449
|
require_relative "openai/models/realtime/realtime_session_create_request"
|
|
440
450
|
require_relative "openai/models/realtime/realtime_session_create_response"
|
|
441
451
|
require_relative "openai/models/realtime/realtime_tool_choice_config"
|
|
442
452
|
require_relative "openai/models/realtime/realtime_tools_config"
|
|
443
453
|
require_relative "openai/models/realtime/realtime_tools_config_union"
|
|
444
454
|
require_relative "openai/models/realtime/realtime_tracing_config"
|
|
455
|
+
require_relative "openai/models/realtime/realtime_transcription_session_audio"
|
|
456
|
+
require_relative "openai/models/realtime/realtime_transcription_session_audio_input"
|
|
457
|
+
require_relative "openai/models/realtime/realtime_transcription_session_audio_input_turn_detection"
|
|
458
|
+
require_relative "openai/models/realtime/realtime_transcription_session_client_secret"
|
|
445
459
|
require_relative "openai/models/realtime/realtime_transcription_session_create_request"
|
|
460
|
+
require_relative "openai/models/realtime/realtime_transcription_session_create_response"
|
|
461
|
+
require_relative "openai/models/realtime/realtime_transcription_session_input_audio_transcription"
|
|
462
|
+
require_relative "openai/models/realtime/realtime_transcription_session_turn_detection"
|
|
446
463
|
require_relative "openai/models/realtime/realtime_truncation"
|
|
464
|
+
require_relative "openai/models/realtime/realtime_truncation_retention_ratio"
|
|
447
465
|
require_relative "openai/models/realtime/response_audio_delta_event"
|
|
448
466
|
require_relative "openai/models/realtime/response_audio_done_event"
|
|
449
467
|
require_relative "openai/models/realtime/response_audio_transcript_delta_event"
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Realtime
|
|
6
|
+
class AudioTranscription < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
OpenAI::Realtime::AudioTranscription,
|
|
11
|
+
OpenAI::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The language of the input audio. Supplying the input language in
|
|
16
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
17
|
+
# format will improve accuracy and latency.
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :language
|
|
20
|
+
|
|
21
|
+
sig { params(language: String).void }
|
|
22
|
+
attr_writer :language
|
|
23
|
+
|
|
24
|
+
# The model to use for transcription. Current options are `whisper-1`,
|
|
25
|
+
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, and `gpt-4o-transcribe`.
|
|
26
|
+
sig do
|
|
27
|
+
returns(
|
|
28
|
+
T.nilable(OpenAI::Realtime::AudioTranscription::Model::OrSymbol)
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
attr_reader :model
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
model: OpenAI::Realtime::AudioTranscription::Model::OrSymbol
|
|
36
|
+
).void
|
|
37
|
+
end
|
|
38
|
+
attr_writer :model
|
|
39
|
+
|
|
40
|
+
# An optional text to guide the model's style or continue a previous audio
|
|
41
|
+
# segment. For `whisper-1`, the
|
|
42
|
+
# [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
|
|
43
|
+
# For `gpt-4o-transcribe` models, the prompt is a free text string, for example
|
|
44
|
+
# "expect words related to technology".
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_reader :prompt
|
|
47
|
+
|
|
48
|
+
sig { params(prompt: String).void }
|
|
49
|
+
attr_writer :prompt
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
params(
|
|
53
|
+
language: String,
|
|
54
|
+
model: OpenAI::Realtime::AudioTranscription::Model::OrSymbol,
|
|
55
|
+
prompt: String
|
|
56
|
+
).returns(T.attached_class)
|
|
57
|
+
end
|
|
58
|
+
def self.new(
|
|
59
|
+
# The language of the input audio. Supplying the input language in
|
|
60
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
61
|
+
# format will improve accuracy and latency.
|
|
62
|
+
language: nil,
|
|
63
|
+
# The model to use for transcription. Current options are `whisper-1`,
|
|
64
|
+
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, and `gpt-4o-transcribe`.
|
|
65
|
+
model: nil,
|
|
66
|
+
# An optional text to guide the model's style or continue a previous audio
|
|
67
|
+
# segment. For `whisper-1`, the
|
|
68
|
+
# [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
|
|
69
|
+
# For `gpt-4o-transcribe` models, the prompt is a free text string, for example
|
|
70
|
+
# "expect words related to technology".
|
|
71
|
+
prompt: nil
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
sig do
|
|
76
|
+
override.returns(
|
|
77
|
+
{
|
|
78
|
+
language: String,
|
|
79
|
+
model: OpenAI::Realtime::AudioTranscription::Model::OrSymbol,
|
|
80
|
+
prompt: String
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
def to_hash
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# The model to use for transcription. Current options are `whisper-1`,
|
|
88
|
+
# `gpt-4o-transcribe-latest`, `gpt-4o-mini-transcribe`, and `gpt-4o-transcribe`.
|
|
89
|
+
module Model
|
|
90
|
+
extend OpenAI::Internal::Type::Enum
|
|
91
|
+
|
|
92
|
+
TaggedSymbol =
|
|
93
|
+
T.type_alias do
|
|
94
|
+
T.all(Symbol, OpenAI::Realtime::AudioTranscription::Model)
|
|
95
|
+
end
|
|
96
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
97
|
+
|
|
98
|
+
WHISPER_1 =
|
|
99
|
+
T.let(
|
|
100
|
+
:"whisper-1",
|
|
101
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
102
|
+
)
|
|
103
|
+
GPT_4O_TRANSCRIBE_LATEST =
|
|
104
|
+
T.let(
|
|
105
|
+
:"gpt-4o-transcribe-latest",
|
|
106
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
107
|
+
)
|
|
108
|
+
GPT_4O_MINI_TRANSCRIBE =
|
|
109
|
+
T.let(
|
|
110
|
+
:"gpt-4o-mini-transcribe",
|
|
111
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
GPT_4O_TRANSCRIBE =
|
|
114
|
+
T.let(
|
|
115
|
+
:"gpt-4o-transcribe",
|
|
116
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
sig do
|
|
120
|
+
override.returns(
|
|
121
|
+
T::Array[
|
|
122
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
123
|
+
]
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
def self.values
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -15,7 +15,10 @@ module OpenAI
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
# Configuration for the
|
|
18
|
+
# Configuration for the client secret expiration. Expiration refers to the time
|
|
19
|
+
# after which a client secret will no longer be valid for creating sessions. The
|
|
20
|
+
# session itself may continue after that time once started. A secret can be used
|
|
21
|
+
# to create multiple sessions until it expires.
|
|
19
22
|
sig do
|
|
20
23
|
returns(
|
|
21
24
|
T.nilable(OpenAI::Realtime::ClientSecretCreateParams::ExpiresAfter)
|
|
@@ -69,7 +72,10 @@ module OpenAI
|
|
|
69
72
|
).returns(T.attached_class)
|
|
70
73
|
end
|
|
71
74
|
def self.new(
|
|
72
|
-
# Configuration for the
|
|
75
|
+
# Configuration for the client secret expiration. Expiration refers to the time
|
|
76
|
+
# after which a client secret will no longer be valid for creating sessions. The
|
|
77
|
+
# session itself may continue after that time once started. A secret can be used
|
|
78
|
+
# to create multiple sessions until it expires.
|
|
73
79
|
expires_after: nil,
|
|
74
80
|
# Session configuration to use for the client secret. Choose either a realtime
|
|
75
81
|
# session or a transcription session.
|
|
@@ -104,8 +110,9 @@ module OpenAI
|
|
|
104
110
|
)
|
|
105
111
|
end
|
|
106
112
|
|
|
107
|
-
# The anchor point for the
|
|
108
|
-
#
|
|
113
|
+
# The anchor point for the client secret expiration, meaning that `seconds` will
|
|
114
|
+
# be added to the `created_at` time of the client secret to produce an expiration
|
|
115
|
+
# timestamp. Only `created_at` is currently supported.
|
|
109
116
|
sig do
|
|
110
117
|
returns(
|
|
111
118
|
T.nilable(
|
|
@@ -124,14 +131,18 @@ module OpenAI
|
|
|
124
131
|
attr_writer :anchor
|
|
125
132
|
|
|
126
133
|
# The number of seconds from the anchor point to the expiration. Select a value
|
|
127
|
-
# between `10` and `7200
|
|
134
|
+
# between `10` and `7200` (2 hours). This default to 600 seconds (10 minutes) if
|
|
135
|
+
# not specified.
|
|
128
136
|
sig { returns(T.nilable(Integer)) }
|
|
129
137
|
attr_reader :seconds
|
|
130
138
|
|
|
131
139
|
sig { params(seconds: Integer).void }
|
|
132
140
|
attr_writer :seconds
|
|
133
141
|
|
|
134
|
-
# Configuration for the
|
|
142
|
+
# Configuration for the client secret expiration. Expiration refers to the time
|
|
143
|
+
# after which a client secret will no longer be valid for creating sessions. The
|
|
144
|
+
# session itself may continue after that time once started. A secret can be used
|
|
145
|
+
# to create multiple sessions until it expires.
|
|
135
146
|
sig do
|
|
136
147
|
params(
|
|
137
148
|
anchor:
|
|
@@ -140,11 +151,13 @@ module OpenAI
|
|
|
140
151
|
).returns(T.attached_class)
|
|
141
152
|
end
|
|
142
153
|
def self.new(
|
|
143
|
-
# The anchor point for the
|
|
144
|
-
#
|
|
154
|
+
# The anchor point for the client secret expiration, meaning that `seconds` will
|
|
155
|
+
# be added to the `created_at` time of the client secret to produce an expiration
|
|
156
|
+
# timestamp. Only `created_at` is currently supported.
|
|
145
157
|
anchor: nil,
|
|
146
158
|
# The number of seconds from the anchor point to the expiration. Select a value
|
|
147
|
-
# between `10` and `7200
|
|
159
|
+
# between `10` and `7200` (2 hours). This default to 600 seconds (10 minutes) if
|
|
160
|
+
# not specified.
|
|
148
161
|
seconds: nil
|
|
149
162
|
)
|
|
150
163
|
end
|
|
@@ -161,8 +174,9 @@ module OpenAI
|
|
|
161
174
|
def to_hash
|
|
162
175
|
end
|
|
163
176
|
|
|
164
|
-
# The anchor point for the
|
|
165
|
-
#
|
|
177
|
+
# The anchor point for the client secret expiration, meaning that `seconds` will
|
|
178
|
+
# be added to the `created_at` time of the client secret to produce an expiration
|
|
179
|
+
# timestamp. Only `created_at` is currently supported.
|
|
166
180
|
module Anchor
|
|
167
181
|
extend OpenAI::Internal::Type::Enum
|
|
168
182
|
|