update: 更新了进入沉默模式的功能
This commit is contained in:
1 parent
76c7adc1b5
commit
34f3fd62f5
4 files changed
+34
No files matched your search
@@ -221,6 +221,12 @@ async def streaming_chat(ws: WebSocket,db=Depends(get_db)):
|
||||
agent.recorder.output_text = llm_text
|
||||
agent.save()
|
||||
logger.debug("音频保存成功")
|
||||
except EnterSlienceMode:
|
||||
tts_audio = agent.synthetize(assistant, "已进入沉默模式", db)
|
||||
await ws.send_bytes(agent.encode("已进入沉默模式", tts_audio))
|
||||
await ws.send_text(json.dumps({"type":"info","code":201,"msg":"进入沉默模式"}, ensure_ascii=False))
|
||||
except SlienceMode:
|
||||
await ws.send_text(json.dumps({"type":"info","code":201,"msg":"处于沉默模式"}, ensure_ascii=False))
|
||||
except AsrResultNoneError:
|
||||
await ws.send_text(json.dumps({"type":"error","code":501,"msg":"asr结果为空"}, ensure_ascii=False))
|
||||
except AbnormalLLMFrame as e:
|
||||
|
||||
Reference in new issue
Block a user