mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Pr branch (#2312)
* Adjust checking for callable crew object. Changes back to how it was being done before. Fixes #2307 * Fix specific memory reset errors. When not initiated, the function should raise the "memory system is not initialized" RuntimeError. * Remove print statement * Fixes test case --------- Co-authored-by: Carlos Souza <carloshrsouza@gmail.com>
This commit is contained in:
@@ -273,11 +273,9 @@ 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:
|
||||
if isinstance(attr, Crew) and hasattr(attr, "kickoff"):
|
||||
print(
|
||||
f"Found valid crew object in attribute '{attr_name}' at {crew_os_path}."
|
||||
)
|
||||
return attr
|
||||
if callable(attr) and hasattr(attr, "crew"):
|
||||
crew_instance = attr().crew()
|
||||
return crew_instance
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error processing attribute {attr_name}: {e}")
|
||||
|
||||
Reference in New Issue
Block a user