You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
MultiStepAgent silently overwrites the parameter-provided FinalAnswerTool.
The agent receives a list of tools trough its constructor, which may include a 'FinalAnswerTool' that terminates the Thought-Action-Observation cycle of the agent.
However agent.py, in line 255 silently overrides a user-provided FinalAnswerTool by instantiating the default implementation.
self.tools["final_answer"] = FinalAnswerTool()
This behavior violates the Principle of Least Surprise and can lead to hard to track bugs. It also creates a hard dependency on the library-povided FinalAnswerTool class and makes it impossible to provide a modified FinalAnswerTool by a user of the API.
Release v. 1.9.2
Additional context
Originally reported by user Julien in the huggingface Discord.
The text was updated successfully, but these errors were encountered:
I guess that PR partially solves the issue, because it allows to customize "final_answer" after instantiation. Maybe we should also support customize "final_answer" at instantiation, as we already do with the rest of the tools.
Describe the bug
MultiStepAgent silently overwrites the parameter-provided FinalAnswerTool.
The agent receives a list of tools trough its constructor, which may include a 'FinalAnswerTool' that terminates the Thought-Action-Observation cycle of the agent.
However
agent.py
, in line 255 silently overrides a user-provided FinalAnswerTool by instantiating the default implementation.This behavior violates the Principle of Least Surprise and can lead to hard to track bugs. It also creates a hard dependency on the library-povided
FinalAnswerTool
class and makes it impossible to provide a modifiedFinalAnswerTool
by a user of the API.Release v. 1.9.2
Additional context
Originally reported by user Julien in the huggingface Discord.
The text was updated successfully, but these errors were encountered: