This commit is contained in:
Classic298 2026-10-13 14:43:55 +02:00 • committed by GitHub
commit 4d5257dc2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -462,6 +462,17 @@ async def realtime_call(ws: WebSocket):
if kind.startswith(('response.', 'conversation.item.', 'input_audio_buffer.')):
async with asyncio.timeout(5):
await ws.send_json(event)
if (
kind
in {
'conversation.item.input_audio_transcription.completed',
'conversation.item.input_audio_transcription.failed',
}
and event['item_id'] not in protocol.transcripts
):
# Keep noise that produced no words out of the voice model's context.
async with asyncio.timeout(5):
await upstream.send_json({'type': 'conversation.item.delete', 'item_id': event['item_id']})
raise ValueError('Voice provider connection closed')
async def check_auth():