mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
fix: 在模型和工具调用期间进行打断后说完话错误退出问题
This commit is contained in:
@@ -9,6 +9,7 @@ TAG = __name__
|
||||
async def handleAbortMessage(conn: "ConnectionHandler"):
|
||||
conn.logger.bind(tag=TAG).info("Abort message received")
|
||||
# 设置成打断状态,会自动打断llm、tts任务
|
||||
conn.close_after_chat = False
|
||||
conn.client_abort = True
|
||||
conn.clear_queues()
|
||||
# 打断客户端说话状态
|
||||
|
||||
@@ -35,7 +35,8 @@ def handle_exit_intent(conn: "ConnectionHandler", say_goodbye: str | None = None
|
||||
try:
|
||||
if say_goodbye is None:
|
||||
say_goodbye = "再见,祝您生活愉快!"
|
||||
conn.close_after_chat = True
|
||||
if not conn.close_after_chat:
|
||||
conn.close_after_chat = True
|
||||
logger.bind(tag=TAG).info(f"退出意图已处理:{say_goodbye}")
|
||||
return ActionResponse(
|
||||
action=Action.RESPONSE, result="退出意图已处理", response=say_goodbye
|
||||
|
||||
Reference in New Issue
Block a user