Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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