Ability to integrate external agents into the framework#246
Ability to integrate external agents into the framework#246ZmeiGorynych wants to merge 10 commits into
Conversation
…ternal_agents # Conflicts: # src/crewai/agent.py
|
looking forward to merge of this PR into main for our use cases |
|
If you want to mix and match CrewAI agents with any other ones (Langchain, LllamaIndex, and Autogen so far, happy to add more), take a look at motleycrew :) |
| self, | ||
| task: Any, | ||
| context: Optional[str] = None, | ||
| context: Optional[List[str]] = None, |
There was a problem hiding this comment.
Isn't this breaking anything in terms of retro-compatibility? Not an issue, per se, but I wonder if there's any way around if that's the case.
There was a problem hiding this comment.
I just thought that the natural kind of context is a list of past messages in a conversation, and it's more natural to pass that through as a list instead of squashing it into a str
There was a problem hiding this comment.
I love it. It makes sense! My concern is the breaking change. What if we moved it to an str | List[str] | None type?
|
|
||
| @property | ||
| def i18n(self) -> I18N: | ||
| if hasattr(self, "_agent") and hasattr(self._agent, "i18n"): |
There was a problem hiding this comment.
Could we prevent this kind of indirection by using some sort of interface? We are moving fast to become a strongly-typed library and this makes it very hard to make sure things are working properly.
There was a problem hiding this comment.
If an offician AgentInterface existed, this could be part of it :)
There was a problem hiding this comment.
Wanna draft something here?
| from crewai.utilities import I18N | ||
|
|
||
|
|
||
| class AgentWrapperParent(ABC, BaseModel): |
There was a problem hiding this comment.
Really loved the generic agent interface. In a perfect world, this would be the only way the engine would refer to agents, right!? Should we call it AgentInterface, like the file name? #namingishard
There was a problem hiding this comment.
Just to make it clear, the dream here is that even Agent respects AgentInterface, then anything that complies to the interface would be able to be an agent.
There was a problem hiding this comment.
Good suggestion, that was exactly the idea :)
|
Looking forward to this as well. We'd use this to connect Agent components to CrewAI components in Langflow. |
|
#776 this PR address this letting you bring your agents by extending the BaseAgent class |
As discussed in #228
Example usage in https://github.com/joaomdmoura/crewAI-examples/pull/52/files