chore: snapshot current state before cleanup
This commit is contained in:
parent
db4ce8b14f
commit
94e62c9456
14 changed files with 489 additions and 3929 deletions
15
voice_rtc.py
15
voice_rtc.py
|
|
@ -1045,7 +1045,7 @@ class WebRTCVoiceSession:
|
|||
|
||||
if self._stt_worker_task:
|
||||
self._stt_worker_task.cancel()
|
||||
with contextlib.suppress(asyncio.CancelledError):
|
||||
with contextlib.suppress(asyncio.CancelledError, RuntimeError):
|
||||
await self._stt_worker_task
|
||||
self._stt_worker_task = None
|
||||
|
||||
|
|
@ -1313,10 +1313,15 @@ class WebRTCVoiceSession:
|
|||
await self._gateway.bus.publish(
|
||||
WisperEvent(role="wisper", text=f"voice transcript: {transcript}")
|
||||
)
|
||||
await self._gateway.send_user_message(
|
||||
transcript,
|
||||
metadata=dict(self._active_message_metadata),
|
||||
)
|
||||
try:
|
||||
await self._gateway.send_user_message(
|
||||
transcript,
|
||||
metadata=dict(self._active_message_metadata),
|
||||
)
|
||||
except RuntimeError as exc:
|
||||
if self._closed:
|
||||
return
|
||||
await self._publish_system(f"Could not deliver voice transcript: {exc}")
|
||||
|
||||
async def _close_peer_connection(self) -> None:
|
||||
self._dc = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue