fix:修复全模块时缺少prompt_template配置的问题

This commit is contained in:
3030332422
2025-10-31 20:36:55 +08:00
parent cc9d5306e6
commit 32ecbe55fc
3 changed files with 7 additions and 1 deletions
@@ -68,6 +68,9 @@ def get_config_from_api(config):
"vision_explain": config["server"].get("vision_explain", ""), "vision_explain": config["server"].get("vision_explain", ""),
"auth_key": config["server"].get("auth_key", ""), "auth_key": config["server"].get("auth_key", ""),
} }
# 如果服务器没有prompt_template,则从本地配置读取
if not config_data.get("prompt_template"):
config_data["prompt_template"] = config.get("prompt_template")
return config_data return config_data
+2
View File
@@ -23,3 +23,5 @@ manager-api:
url: http://127.0.0.1:8002/xiaozhi url: http://127.0.0.1:8002/xiaozhi
# 你的manager-api的token,就是刚才复制出来的server.secret # 你的manager-api的token,就是刚才复制出来的server.secret
secret: 你的server.secret值 secret: 你的server.secret值
# 默认系统提示词模板文件
prompt_template: agent-base-prompt.txt
@@ -225,6 +225,7 @@ class PromptManager:
weather_info=weather_info, weather_info=weather_info,
emojiList=EMOJI_List, emojiList=EMOJI_List,
device_id=device_id, device_id=device_id,
client_ip=client_ip,
*args, **kwargs *args, **kwargs
) )
device_cache_key = f"device_prompt:{device_id}" device_cache_key = f"device_prompt:{device_id}"