知识库工具的下拉列表改为动态获取,不必重启服务。 (#4126)

* 1、知识库工具的下拉列表改为动态获取,不必重启服务。
This commit is contained in:
srszzw 2024-06-03 16:46:59 +08:00 committed by GitHub
parent e941310775
commit a84221cecc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -724,6 +724,7 @@ def update_search_local_knowledgebase_tool():
search_local_knowledgebase_tool=tools_registry._TOOLS_REGISTRY.get("search_local_knowledgebase")
if search_local_knowledgebase_tool:
search_local_knowledgebase_tool.description = " ".join(re.split(r"\n+\s*", template_knowledge))
search_local_knowledgebase_tool.args["database"]["choices"]=[kb.kb_name for kb in kbs]
def get_tool(name: str = None) -> Union[BaseTool, Dict[str, BaseTool]]:

View File

@ -106,7 +106,7 @@ def clear_conv(name: str = None):
chat_box.reset_history(name=name or None)
@st.cache_data
# @st.cache_data
def list_tools(_api: ApiRequest):
return _api.list_tools()