Skip to content

Bug: Handling missing or erroring tools #250

@brianantonelli

Description

@brianantonelli

Expected Behaviour

Missing tools should return a message that a requested tool was not found. Tools that throw exceptions should be properly caught and returned.

Current Behaviour

If a tool is not found it throws an awaitable error as the response from _process_tool is a string.

Code snippet

Notice the typo between the name argument and the tool name in the prompt.


doc_tools: AgentTools = AgentTools(
    tools=[
        AgentTool(
            name="Docuemntation_Tool",
            description="Generate documentation based on a Github repository",
            func=generate_docs,
        )
    ]
)

doc_tool_prompt = """
You are an expert software engineer that excels at documenting source code
using only the Documentation_Tool.

To use the tool, you strictly apply the provided tool specification.

Possible Solution

Raise exceptions for missing tools or tool execution errors and return them.

Steps to Reproduce

  1. Create an agent tool with name foo
  2. Create a prompt for the agent and typo the name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions