mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 00:53:54 +08:00
增加关闭聊天的功能
明确的退出命令可以直接关闭聊天 LLM检测到的结束聊天意图则在LLM回复后关闭聊天
This commit is contained in:
@@ -68,6 +68,12 @@ class ConnectionHandler:
|
||||
self.tts_start_speak_time = None
|
||||
self.tts_duration = 0
|
||||
|
||||
self.cmd_exit = self.config["CMD_exit"]
|
||||
self.max_cmd_lenth = 0
|
||||
for cmd in self.cmd_exit:
|
||||
if len(cmd) > self.max_cmd_lenth:
|
||||
self.max_cmd_lenth = len(cmd)
|
||||
|
||||
async def handle_connection(self, ws):
|
||||
try:
|
||||
# 获取并验证headers
|
||||
|
||||
Reference in New Issue
Block a user