diff --git a/libs/chatchat-server/chatchat/server/agent/tools_factory/search_local_knowledgebase.py b/libs/chatchat-server/chatchat/server/agent/tools_factory/search_local_knowledgebase.py index 926db1b..cf5a371 100644 --- a/libs/chatchat-server/chatchat/server/agent/tools_factory/search_local_knowledgebase.py +++ b/libs/chatchat-server/chatchat/server/agent/tools_factory/search_local_knowledgebase.py @@ -16,11 +16,11 @@ from chatchat.server.utils import get_tool_config # "this knowledge use this tool. The 'database' should be one of the above [{key}]." # ) template = ( - "使用本地知识库里\n{KB_info}\n去查与大模型技术栈相关的问题时,只有当用户的问题在本地知识库里时才使用这个工具查询" - "'database' 应该是上面的 [{key}] 之一." +"使用本地知识库里\n{KB_info}\n查国家电网各部门规章制度、安徽送变电规章制度等相关的问题时,只有当用户的问题在本地知识库里时才使用这个工具查询" +"'database' 应该是上面的 [{key}] 之一." ) KB_info_str = "\n".join([f"{key}: {value}" for key, value in Settings.kb_settings.KB_INFO.items()]) -template_knowledge = template.format(KB_info=KB_info_str, key="samples") +template_knowledge = template.format(KB_info=KB_info_str, key="test") print(f"template_knowledge 模版:{template_knowledge}") diff --git a/libs/chatchat-server/chatchat/server/utils.py b/libs/chatchat-server/chatchat/server/utils.py index c916c65..2f2e46d 100644 --- a/libs/chatchat-server/chatchat/server/utils.py +++ b/libs/chatchat-server/chatchat/server/utils.py @@ -865,7 +865,7 @@ def update_search_local_knowledgebase_tool(): kbs = list_kbs_from_db() #template = "Use local knowledgebase from one or more of these:\n{KB_info}\n to get information,Only local data on this knowledge use this tool. The 'database' should be one of the above [{key}]." - template = "使用本地知识库里\n{KB_info}\n去查与大模型技术栈相关的问题时,只有当用户的问题在本地知识库里时才使用这个工具查询.'database' 应该是上面的 [{key}] 之一" + template = "使用本地知识库里\n{KB_info}\n去查1)国家电网各部门规章制度、安全生产、合同管控等 2)安徽送变电规章制度、安全生产、合同管控等 3)国网基建数字化管理 4)国网输变电工程管理等相关的问题时,只有当用户的问题在本地知识库里时才使用这个工具查询.'database' 应该是上面的 [{key}] 之一" KB_info_str = "\n".join([f"{kb.kb_name}: {kb.kb_info}" for kb in kbs]) KB_name_info_str = "\n".join([f"{kb.kb_name}" for kb in kbs]) template_knowledge = template.format(KB_info=KB_info_str, key=KB_name_info_str)