Skip to content

🐛 Notebook agent_rag.ipynb : Unexpected keyword argument 'verbose' for ToolCallingAgent #290

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

alexkolo
Copy link
Contributor

@alexkolo alexkolo commented Mar 5, 2025

Tested on smolagents==1.9.2

Error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 4
      1 model = HfApiModel()  # model_id="meta-llama/Llama-3.1-70B-Instruct")
      3 retriever_tool = RetrieverTool(vectordb=vectordb)
----> 4 agent = ToolCallingAgent(tools=[retriever_tool], model=model, verbose=True)
      5 agent.visualize()

File ~/repos/hf_nlp_course/venv/lib/python3.11/site-packages/smolagents/agents.py:1051, in ToolCallingAgent.__init__(self, tools, model, prompt_templates, planning_interval, **kwargs)
   1040 def __init__(
   1041     self,
   1042     tools: List[Tool],
   (...)
   1046     **kwargs,
   1047 ):
   1048     prompt_templates = prompt_templates or yaml.safe_load(
   1049         importlib.resources.files("smolagents.prompts").joinpath("toolcalling_agent.yaml").read_text()
   1050     )
-> 1051     super().__init__(
   1052         tools=tools,
   1053         model=model,
   1054         prompt_templates=prompt_templates,
   1055         planning_interval=planning_interval,
   1056         **kwargs,
   1057     )

TypeError: MultiStepAgent.__init__() got an unexpected keyword argument 'verbose'

What does this PR do?

Fixes # (issue)

Who can review?

Feel free to tag members/contributors who may be interested in your PR.

Tested on `smolagents==1.9.2`

```python
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 4
      1 model = HfApiModel()  # model_id="meta-llama/Llama-3.1-70B-Instruct")
      3 retriever_tool = RetrieverTool(vectordb=vectordb)
----> 4 agent = ToolCallingAgent(tools=[retriever_tool], model=model, verbose=True)
      5 agent.visualize()

File ~/repos/hf_nlp_course/venv/lib/python3.11/site-packages/smolagents/agents.py:1051, in ToolCallingAgent.__init__(self, tools, model, prompt_templates, planning_interval, **kwargs)
   1040 def __init__(
   1041     self,
   1042     tools: List[Tool],
   (...)
   1046     **kwargs,
   1047 ):
   1048     prompt_templates = prompt_templates or yaml.safe_load(
   1049         importlib.resources.files("smolagents.prompts").joinpath("toolcalling_agent.yaml").read_text()
   1050     )
-> 1051     super().__init__(
   1052         tools=tools,
   1053         model=model,
   1054         prompt_templates=prompt_templates,
   1055         planning_interval=planning_interval,
   1056         **kwargs,
   1057     )

TypeError: MultiStepAgent.__init__() got an unexpected keyword argument 'verbose'
```
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@alexkolo alexkolo changed the title ToolCallingAgent: Unexpected keyword argument 'verbose' Notebook agent_rag.ipynb : Unexpected keyword argument 'verbose' for ToolCallingAgent Mar 5, 2025
@alexkolo alexkolo changed the title Notebook agent_rag.ipynb : Unexpected keyword argument 'verbose' for ToolCallingAgent 🐛 Notebook agent_rag.ipynb : Unexpected keyword argument 'verbose' for ToolCallingAgent Mar 5, 2025
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in ToolCallingAgent indeed but the parent class has verbosity_level it seems, can you try that? otherwise LGTM

@alexkolo
Copy link
Contributor Author

alexkolo commented Mar 7, 2025

not in ToolCallingAgent indeed but the parent class has verbosity_level it seems, can you try that? otherwise LGTM

Thanks for your feedback @merveenoyan
Indeed, it does come from the superclass, but for me, it was more about the class used in the notebook, as this is what the user sees.
I honestly don't know why the keyword verbose was there in the first place, but I don't see the need to change the verbose_level from its default value (LogLevel.INFO). So I'm suggesting to just remove verbose without any replacement.

@alexkolo
Copy link
Contributor Author

alexkolo commented Mar 7, 2025

@merveenoyan It seems that I do not have permission to merge this PR, as I do not see a merge button, despite your approval of the PR. So I guess someone else will have to do it. Sorry for the inconvenience.

@merveenoyan merveenoyan merged commit 9cd571b into huggingface:main Mar 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants