mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
@@ -597,7 +597,7 @@ class ConnectionHandler:
|
|||||||
text_index = 0
|
text_index = 0
|
||||||
|
|
||||||
for response in llm_responses:
|
for response in llm_responses:
|
||||||
if self.intent_type == "function_call":
|
if functions is not None:
|
||||||
content, tools_call = response
|
content, tools_call = response
|
||||||
if "content" in response:
|
if "content" in response:
|
||||||
content = response["content"]
|
content = response["content"]
|
||||||
@@ -852,16 +852,6 @@ class ConnectionHandler:
|
|||||||
if self.stop_event:
|
if self.stop_event:
|
||||||
self.stop_event.set()
|
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()
|
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:
|
if not q:
|
||||||
continue
|
continue
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user