Skip to content

Commit

Permalink
知识库工具的下拉列表改为动态获取,不必重启服务。 (#4126)
Browse files Browse the repository at this point in the history
* 1、知识库工具的下拉列表改为动态获取,不必重启服务。
  • Loading branch information
srszzw committed Jun 3, 2024
1 parent e941310 commit a84221c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/chatchat-server/chatchat/server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit a84221c

Please sign in to comment.