From 59572fc58b9a976fc9c45f7583288b4b3ffa9df2 Mon Sep 17 00:00:00 2001 From: Jad Date: Wed, 12 Mar 2025 22:55:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=80=E5=87=BA=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复指令text包含标点的情况下,无法正确识别退出指令的问题 --- main/xiaozhi-server/core/handle/intentHandler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/xiaozhi-server/core/handle/intentHandler.py b/main/xiaozhi-server/core/handle/intentHandler.py index d651cc05e..349e16d7c 100644 --- a/main/xiaozhi-server/core/handle/intentHandler.py +++ b/main/xiaozhi-server/core/handle/intentHandler.py @@ -2,6 +2,7 @@ from config.logger import setup_logging import json from core.handle.sendAudioHandle import send_stt_message from core.utils.dialogue import Message +from core.utils.util import remove_punctuation_and_length from config.functionCallConfig import FunctionCallConfig import asyncio from enum import Enum @@ -105,6 +106,7 @@ async def handle_user_intent(conn, text): async def check_direct_exit(conn, text): """检查是否有明确的退出命令""" + _, text = remove_punctuation_and_length(text) cmd_exit = conn.cmd_exit for cmd in cmd_exit: if text == cmd: