File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class SpanError(TypedDict):
22
22
message: A human-readable error description
23
23
data: Optional dictionary containing additional error context
24
24
"""
25
+
25
26
message : str
26
27
data : dict [str , Any ] | None
27
28
Original file line number Diff line number Diff line change @@ -163,11 +163,16 @@ async def _configure_session(self) -> None:
163
163
await self ._websocket .send (
164
164
json .dumps (
165
165
{
166
- "type" : "transcription_session .update" ,
166
+ "type" : "session .update" ,
167
167
"session" : {
168
- "input_audio_format" : "pcm16" ,
169
- "input_audio_transcription" : {"model" : self ._model },
170
- "turn_detection" : self ._turn_detection ,
168
+ "type" : "transcription" ,
169
+ "audio" : {
170
+ "input" : {
171
+ "format" : {"type" : "audio/pcm" , "rate" : 24000 },
172
+ "transcription" : {"model" : self ._model },
173
+ "turn_detection" : self ._turn_detection ,
174
+ }
175
+ },
171
176
},
172
177
}
173
178
)
Original file line number Diff line number Diff line change @@ -115,10 +115,10 @@ async def test_session_connects_and_configures_successfully():
115
115
assert headers .get ("OpenAI-Beta" ) is None
116
116
assert headers .get ("OpenAI-Log-Session" ) == "1"
117
117
118
- # Check that we sent a 'transcription_session .update' message
118
+ # Check that we sent a 'session .update' message
119
119
sent_messages = [call .args [0 ] for call in mock_ws .send .call_args_list ]
120
- assert any ('"type": "transcription_session .update"' in msg for msg in sent_messages ), (
121
- f"Expected 'transcription_session .update' in { sent_messages } "
120
+ assert any ('"type": "session .update"' in msg for msg in sent_messages ), (
121
+ f"Expected 'session .update' in { sent_messages } "
122
122
)
123
123
124
124
await session .close ()
You can’t perform that action at this time.
0 commit comments