mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
修复ActionResponse为NOTFOUND时候卡住主线程的bug (#285)
修复ActionResponse为NOTFOUND时候卡住主线程的bug
This commit is contained in:
@@ -437,6 +437,9 @@ class ConnectionHandler:
|
|||||||
self.dialogue.put(Message(role="assistant", content=text))
|
self.dialogue.put(Message(role="assistant", content=text))
|
||||||
if result.action == Action.REQLLM: # 调用函数后再请求llm生成回复
|
if result.action == Action.REQLLM: # 调用函数后再请求llm生成回复
|
||||||
text = result.response
|
text = result.response
|
||||||
|
if result.action == Action.NOTFOUND:
|
||||||
|
text = result.response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _tts_priority_thread(self):
|
def _tts_priority_thread(self):
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ def handle_llm_function_call(conn, function_call_data):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.bind(tag=TAG).error(f"处理音乐意图错误: {e}")
|
logger.bind(tag=TAG).error(f"处理音乐意图错误: {e}")
|
||||||
else:
|
else:
|
||||||
return ActionResponse(action=Action.NOTFOUND, result="没有找到对应的函数", response="")
|
return ActionResponse(action=Action.NOTFOUND, result="没有找到对应的函数", response="没有找到对应的函数处理相对于的功能呢,你可以需要添加预设的对应函数处理呢")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.bind(tag=TAG).error(f"处理function call错误: {e}")
|
logger.bind(tag=TAG).error(f"处理function call错误: {e}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user