-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: Allow Agent to run with no tools #9230
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 14472404591Details
💛 - Coveralls |
--- | ||
fixes: | ||
- | | ||
Now when you call an Agent with no tools it acts like a ChatGenerator which means it returns a ChatMessage based on a user input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can update the Agent's docstring to also highlight this update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG! Just a small comment.
Sorry, one general question for the current behavior: So the current So even |
Good catch. That is the intended behavior. The Agent component was set up in a way that the Tools should be provided to the Agent's init params and not the ChatGenerators. But you're right we should make that more explicit that the tools defined in the underlying ChatGenerator will be ignored. |
haystack/components/agents/agent.py
Outdated
When you call an Agent without any tools it acts like a ChatGenerator. It will exit after generating a text | ||
response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dfokina Could you give this docstring a review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to order it a bit: "When you call an Agent without tools, it acts as a ChatGenerator, produces one response, then exits."
Related Issues
Proposed Changes:
Updates the init and run logic of Agent to truly allow Tools to be optional. This means an Agent can be run with no Tools now which makes it act like a normal ChatGenerator.
How did you test it?
Added a test
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
and added!
in case the PR includes breaking changes.