-
Notifications
You must be signed in to change notification settings - Fork 461
feat(agent-interface): introduce AgentBase abstract class as the interface for agent classes to implement #1126
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
…rface for agent classes to implement
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
🥳
Just calling out here if anyone looks back
- structured_output() is deprecated so it wasn't added
- Direct tool calling also was not added
| from .state import AgentState | ||
|
|
||
|
|
||
| class AgentBase(ABC): |
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.
should we use Protocol instead?
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.
@pgrayy has also called out that Protocols should be preferred in general over base-classes; it would also enable us to specify the properties as normal fields instead of getters
|
nit: How would this relate to |
| from .state import AgentState | ||
|
|
||
|
|
||
| class AgentBase(ABC): |
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.
@pgrayy has also called out that Protocols should be preferred in general over base-classes; it would also enable us to specify the properties as normal fields instead of getters
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.
Can you update the PR description indicating the purpose of the base class - e.g. is it just for agents or is it meant to represent things in-place of an agent (like humans) as the tracking issue #573 calls out.
Specifically, if we were starting fresh, what would implement this? MultiAgent primitives? A2AAgent, etc?
| self, | ||
| prompt: AgentInput = None, | ||
| *, | ||
| invocation_state: dict[str, Any] | None = None, |
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.
For the use-cases that we're targeting, will invocation_state and structured_output_model be supported? For instance, for multi-agent, I think structured_output is not supported but invocation_state is?
Description
feat(agent-interface): introduce AgentBase abstract class as the interface for agent classes to implement
Related Issues
#573
Documentation PR
TODO
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.