Skip to content

[BUG] Groq API fails to call tools for ToolCallingAgents #1119

Description

@Isaac4real

Describe the bug
E.g.: for the deep research example where the the search_agent is a ToolCallingAgent, the groq api (via litellm) fails with:

 Error in generating tool call with model:
litellm.BadRequestError: GroqException - {"error":{"message":"Failed to call a 
function. Please adjust your prompt. See 'failed_generation' for more 
details.","type":"invalid_request_error","code":"tool_use_failed","failed_genera
tion":"web_search{\"query\": \"SPFMV and SPCSV in the Pearl Of Africa 2016\", 
\"filter_year\": 2016}\u003c/function\u003e"}}

Code to reproduce the error
Run deep research example

Error logs (if any)
Error in generating tool call with model: litellm.BadRequestError: GroqException - {"error":{"message":"Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.","type":"invalid_request_error","code":"tool_use_failed","failed_genera tion":"web_search{\"query\": \"SPFMV and SPCSV in the Pearl Of Africa 2016\", \"filter_year\": 2016}\u003c/function\u003e"}}

Expected behavior
A clear and concise description of what you expected to happen.

Packages version:
Run pip freeze | grep smolagents and paste it here.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions