Skip to content
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

Ability to integrate external agents into the framework #246

Closed
wants to merge 10 commits into from

Conversation

ZmeiGorynych
Copy link

@sameermahajan
Copy link

looking forward to merge of this PR into main for our use cases

@ZmeiGorynych
Copy link
Author

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 :)
I started it after the above PR was put on ice, and it's all about nice orchestration, while allowing you to use any agents and tools of your choice, conveniently.

@@ -131,7 +131,7 @@ def check_agent_executor(self) -> "Agent":
def execute_task(
self,
task: Any,
context: Optional[str] = None,
context: Optional[List[str]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an offician AgentInterface existed, this could be part of it :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanna draft something here?

from crewai.utilities import I18N


class AgentWrapperParent(ABC, BaseModel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, that was exactly the idea :)

@ogabrielluiz
Copy link

Looking forward to this as well. We'd use this to connect Agent components to CrewAI components in Langflow.

@lorenzejay
Copy link
Collaborator

#776 this PR address this letting you bring your agents by extending the BaseAgent class

@lorenzejay lorenzejay closed this Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants