From fabd55b1cab29b3d41d8e3a1475adef4602d9a3f Mon Sep 17 00:00:00 2001 From: Volodymyr Fesko Date: Tue, 13 Oct 2026 09:39:31 +0300 Subject: [PATCH] fix(search): name unified search tools after the provider id Each unified search tool was named after the provider's display name, which is translated into the user's language, with every character outside [A-Za-z0-9_-] replaced. For languages written in a non-Latin script the names collapse: in Ukrainian 21 of 24 providers became the same tool, `search__`, so the model called the wrong provider or none. Name the tool after the provider id, which is stable and ASCII, and mention the id in the tool's description as well, so the model can tell e.g. the full-text provider from the file name search even when the display name says little about it. Signed-off-by: Volodymyr Fesko --- ex_app/lib/all_tools/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ex_app/lib/all_tools/search.py b/ex_app/lib/all_tools/search.py index 1761aa7a..62ebbc2e 100644 --- a/ex_app/lib/all_tools/search.py +++ b/ex_app/lib/all_tools/search.py @@ -20,9 +20,9 @@ async def tool(search_query: dict[str, str]): return tool tool_func = make_tool(provider) - tool_func.__name__ = re.sub(r"[^a-zA-Z0-9_-]+", '_', "search_" + provider['name'].lower()) + tool_func.__name__ = re.sub(r"[^a-zA-Z0-9_-]+", '_', "search_" + provider['id'].lower()) tool_func.__doc__ = ( - f"Searches {provider['name']} in Nextcloud.\n" + f"Searches {provider['name']} (search provider '{provider['id']}') in Nextcloud.\n" f":param search_query: A mapping of filter names to filter values to use for the search. " f"Choose filters from {json.dumps(provider['filters'])}. (The 'person' filter, if available, takes a userID. Use find_person_in_users to obtain it.)" 'For example: {"term": "hans", ...}\n'