mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 09:33:55 +08:00
Merge branch 'xinnan-tech:main' into main
This commit is contained in:
@@ -218,6 +218,15 @@ class IntentProvider(IntentProviderBase):
|
|||||||
f"llm 识别到意图: {function_name}, 参数: {function_args}"
|
f"llm 识别到意图: {function_name}, 参数: {function_args}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 如果是继续聊天,清理工具调用相关的历史消息
|
||||||
|
if function_name == "continue_chat":
|
||||||
|
# 保留非工具相关的消息
|
||||||
|
clean_history = [
|
||||||
|
msg for msg in conn.dialogue.dialogue
|
||||||
|
if msg.role not in ["tool", "function"]
|
||||||
|
]
|
||||||
|
conn.dialogue.dialogue = clean_history
|
||||||
|
|
||||||
# 添加到缓存
|
# 添加到缓存
|
||||||
self.intent_cache[cache_key] = {
|
self.intent_cache[cache_key] = {
|
||||||
"intent": intent,
|
"intent": intent,
|
||||||
|
|||||||
Reference in New Issue
Block a user