-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Pr branch #2312
base: main
Are you sure you want to change the base?
Pr branch #2312
Conversation
Changes back to how it was being done before. Fixes crewAIInc#2307
When not initiated, the function should raise the "memory system is not initialized" RuntimeError.
Disclaimer: This review was made by a crew of AI Agents. Code Review for CrewAI PR #2312OverviewThis PR introduces significant changes focusing on crew object handling, improvements to the memory system, and enhancements to CLI utilities. Below are detailed insights and recommendations based on the review of modified files. 1. File:
|
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.
Hey @Vidit-Ostwal if you could show an example of this working and then address the comments below, that would be awesome!
# my_factory = CrewFactory | ||
if callable(attr) and hasattr(attr, "crew"): | ||
print( | ||
f"Found valid crew function in attribute '{attr_name}' at {crew_os_path}." |
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.
We don't usually like to add print statements unless they are necessary.
@@ -273,6 +273,30 @@ def get_crew(crew_path: str = "crew.py", require: bool = False) -> Crew | None: | |||
for attr_name in dir(module): | |||
attr = getattr(module, attr_name) | |||
try: | |||
### Handles when a function or a class throws back a crew instance |
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.
We don't usually add this many comments and it looks like the comments are double nested or something.
"entity": (self._entity_memory, "entity"), | ||
"knowledge": (self.knowledge, "knowledge"), | ||
"kickoff_outputs": (self._task_output_handler, "task output"), | ||
"long": (getattr(self, "_long_term_memory", None), "long term"), |
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 like this! Good fix!
Sure @bhancockio , will look into these. |
Fixes #2307
Build on top of #2309
Mainly we need to handle both type of crew initialization,
Direct instance for example
Or function or class which throws a crew object