From 2586843654ee5bf962df7f6ed2ae0b871977a25d Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Wed, 28 May 2025 21:34:21 +0800 Subject: [PATCH] =?UTF-8?q?update:=E4=BF=AE=E5=A4=8D=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=8D=A1=E5=A3=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/connection.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index f66c42e0..04c352bf 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -597,7 +597,7 @@ class ConnectionHandler: text_index = 0 for response in llm_responses: - if self.intent_type == "function_call": + if functions is not None: content, tools_call = response if "content" in response: content = response["content"] @@ -852,16 +852,6 @@ class ConnectionHandler: if self.stop_event: self.stop_event.set() - # 等待上报队列处理完成 - if hasattr(self, "report_queue"): - try: - # 添加毒丸对象 - self.report_queue.put(None) - # 等待队列处理完成 - self.report_queue.join() - except Exception as e: - self.logger.bind(tag=TAG).error(f"等待上报队列处理完成时出错: {e}") - # 清空任务队列 self.clear_queues() @@ -888,7 +878,11 @@ class ConnectionHandler: ) # 使用非阻塞方式清空队列 - for q in [self.tts.tts_text_queue, self.tts.tts_audio_queue]: + for q in [ + self.tts.tts_text_queue, + self.tts.tts_audio_queue, + self.report_queue, + ]: if not q: continue while True: