Spaces:
Paused
Paused
Update chat_session/websocket_manager.py
Browse files
chat_session/websocket_manager.py
CHANGED
|
@@ -462,10 +462,20 @@ class WebSocketManager:
|
|
| 462 |
|
| 463 |
async def _handle_stt_stopped(self, event: Event):
|
| 464 |
"""Send STT stopped signal to client"""
|
| 465 |
-
|
|
|
|
|
|
|
|
|
|
| 466 |
"type": "stt_stopped",
|
| 467 |
-
"message": "STT stopped,
|
| 468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 469 |
|
| 470 |
async def _handle_stt_result(self, event: Event):
|
| 471 |
"""Send STT result to client"""
|
|
|
|
| 462 |
|
| 463 |
async def _handle_stt_stopped(self, event: Event):
|
| 464 |
"""Send STT stopped signal to client"""
|
| 465 |
+
session_id = event.session_id
|
| 466 |
+
stop_recording = event.data.get("stop_recording", False)
|
| 467 |
+
|
| 468 |
+
message = {
|
| 469 |
"type": "stt_stopped",
|
| 470 |
+
"message": "STT stopped",
|
| 471 |
+
"stop_recording": stop_recording
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
if stop_recording:
|
| 475 |
+
message["message"] = "STT stopped, please stop sending audio immediately"
|
| 476 |
+
log_info(f"📤 Sending stop recording command to frontend", session_id=session_id)
|
| 477 |
+
|
| 478 |
+
await self.send_message(session_id, message)
|
| 479 |
|
| 480 |
async def _handle_stt_result(self, event: Event):
|
| 481 |
"""Send STT result to client"""
|