-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Add Enum for agent types #2321
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
Add Enum for agent types #2321
Conversation
I'm sorry to be the bearer of bad news, but I need to inform you that... grep -r "zero-shot-react-description" docs/
|
Addressed the issue where hardcoded strings instead of the AgentType enums were still being used in some of the examples within the documentation. |
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.
this is awesome.
thinking about backwards compatibility - this will still work for people on the old version, right? because the string is still the same under the hood?
Yes, exactly. Due to the AgentType class inheriting from str, the underlying string representation is maintained, ensuring backwards compatibility for users on older versions. |
# Conflicts: # langchain/agents/initialize.py
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.
thanks!
This pull request adds an enum class for the various types of agents used in the project, located in the
agent_types.py
file. Currently, the project is using hardcoded strings for the initialization of these agents, which can lead to errors and make the code harder to maintain. With the introduction of the new enums, the code will be more readable and less error-prone.The new enum members include:
In this PR, I have also replaced the hardcoded strings with the appropriate enum members throughout the codebase, ensuring a smooth transition to the new approach.