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

[Bug]: LLMCompiler fails with Tool{tool_name} not found value error #13484

Open
shaon-chowdhury opened this issue May 14, 2024 · 3 comments
Open
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized

Comments

@shaon-chowdhury
Copy link

Bug Description

Tool names cannot be found when agent.chat is called even though the plan is created.

Version

0.10.34

Steps to Reproduce

  1. Use any tool (using duckduckgo search as an example)
    tools = DuckDuckGoSearchToolSpec().to_tool_list()

  2. Create LLM model and agent

llm = Ollama(model="phi3", request_timeout=30.0, temperature=0.9)
callback_manager = llm.callback_manager
agent_worker = LLMCompilerAgentWorker.from_tools(
    tools, llm=llm, verbose=True, memory=chat_memory, callback_manager=callback_manager
)
agent = AgentRunner(agent_worker, callback_manager=callback_manager)

Relevant Logs/Tracbacks

File "/Users/user/Library/Python/3.9/lib/python/site-packages/llama_index/agent/llm_compiler/utils.py", line 85, in instantiate_new_step
    tool = _find_tool(tool_name, tools)
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/llama_index/agent/llm_compiler/utils.py", line 55, in _find_tool
    raise ValueError(f"Tool {tool_name} not found.")
ValueError: Tool search not found.
@shaon-chowdhury shaon-chowdhury added bug Something isn't working triage Issue needs to be triaged/prioritized labels May 14, 2024
Copy link

dosubot bot commented May 14, 2024

It looks like the issue you're encountering, ValueError: Tool search not found., is due to the LLMCompiler not being able to locate the DuckDuckGoSearchToolSpec in the provided tools sequence. To resolve this, ensure the following:

  1. Correctly import the DuckDuckGoSearchToolSpec from the llama_index.tools.duckduckgo package:
from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
  1. Verify that the DuckDuckGoSearchToolSpec is correctly instantiated and included in your tools sequence.

  2. Check that the tool's metadata.name matches the tool_name you are using, which should likely be "search".

  3. Confirm the tool is correctly passed to the instantiate_new_step function or wherever the LLMCompiler expects to find it.

Additionally, ensure the duckduckgo_search package is installed in your environment:

pip install duckduckgo_search

For further details, you might want to look into the LlamaIndex repository, specifically the files related to the LLMCompiler utilities and the DuckDuckGoSearchToolSpec.

If you've followed these steps and the issue persists, there might be a missing step or configuration in your setup based on the LlamaIndex documentation.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@logan-markewich
Copy link
Collaborator

The LLM is predicting a tool name that doesn't exist is my guess? I'm not sure what your tool names/descriptions look like, but try to make them unique and descriptive

@shaon-chowdhury
Copy link
Author

For the example I provided the tool names are ['duckduckgo_instant_search', 'duckduckgo_full_search'] (can be found using [tool.metadata.name for tool in tools]). Strangely though the error is ValueError: Tool search not found.. I came up with a small hotfix where I check equality of the name and also whether the tool_name is in the names of the tools in the _find_tools function. Ok if I send up a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized
Projects
None yet
Development

No branches or pull requests

2 participants