feat(search): Add a tool for each unified search provider available in Nextcloud#120
feat(search): Add a tool for each unified search provider available in Nextcloud#120
Conversation
…n Nextcloud Signed-off-by: Marcel Klehr <mklehr@gmx.net>
There was a problem hiding this comment.
Pull request overview
Adds a new tool module that exposes Nextcloud Unified Search providers as LangChain tools, enabling the agent to run provider-specific searches via the Nextcloud OCS search APIs.
Changes:
- Introduce
ex_app/lib/all_tools/search.pyto dynamically fetch unified search providers and generate one tool per provider. - Add a new “Unified Search” tool category for the UI/tool grouping.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
|
The tests seem to use the "search_the_web" tool. Is that a tool? Shouldn't it use "youtube_search"? Although I guess that is already with another tool, which is a big problem. This does add all Search providers, even if their added or taken care of elsewhere, which can confuse the LLM on which tool to use. |
|
mmh, but we do have a youtube_search tool, as well. In my tests the tools were not confusing the llm, but maybe in this case here the context window is too small to fit the tool descriptions of all tools? |
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
|
Speaking of tool descriptions, how are those passed? |
|
I just had a great idea (I think). |
|
The tools are passed to the Chat with Tools task provider in nextcloud which gives them either to the openAI server or to the llm2 instance, where they are stringified. The descriptions for each tool are the doc strings. |
|
The problem might be the youtube_search description: "Nextcloud" is not a person, so it tries a hallucinated tool, I guess? |
Use get_folder_tree instead of youtube_search Signed-off-by: Marcel Klehr <mklehr@gmx.net>
|
What did you think of my idea for reducing the needed context? |
|
@TheBest-Name it's a good idea in general to reduce the tokens needed for explaining tools to the llm. In this case I'm not sure how well it would have worked and if the benefits outweigh the risks of the llm not getting how to use this tandem of tools. |
|
We have a new approach to tools in mind however that will greatly reduce the tokens needed for explaining tools. |
Thanks to @TheBest-Name