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