Skip to content
Merged
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
3 changes: 2 additions & 1 deletion ex_app/lib/all_tools/search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
import json
import re

from langchain_core.tools import tool
from nc_py_api import AsyncNextcloudApp
Expand All @@ -19,7 +20,7 @@ async def tool(search_query: dict[str, str]):
return tool

tool_func = make_tool(provider)
tool_func.__name__ = "search_" + provider['name'].lower()
tool_func.__name__ = re.sub(r"[^a-zA-Z0-9_-]+", '_', "search_" + provider['name'].lower())
tool_func.__doc__ = (
f"Searches {provider['name']} in Nextcloud.\n"
f":param search_query: A mapping of filter names to filter values to use for the search. "
Expand Down
Loading