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):
2222 message: A human-readable error description
2323 data: Optional dictionary containing additional error context
2424 """
25+
2526 message : str
2627 data : dict [str , Any ] | None
2728
Original file line number Diff line number Diff line change @@ -163,11 +163,16 @@ async def _configure_session(self) -> None:
163163 await self ._websocket .send (
164164 json .dumps (
165165 {
166- "type" : "transcription_session .update" ,
166+ "type" : "session .update" ,
167167 "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+ },
171176 },
172177 }
173178 )
Original file line number Diff line number Diff line change @@ -115,10 +115,10 @@ async def test_session_connects_and_configures_successfully():
115115 assert headers .get ("OpenAI-Beta" ) is None
116116 assert headers .get ("OpenAI-Log-Session" ) == "1"
117117
118- # Check that we sent a 'transcription_session .update' message
118+ # Check that we sent a 'session .update' message
119119 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 } "
122122 )
123123
124124 await session .close ()
You can’t perform that action at this time.
0 commit comments