diff --git a/docs/concepts/memory.mdx b/docs/concepts/memory.mdx index d571f6691..298e8814c 100644 --- a/docs/concepts/memory.mdx +++ b/docs/concepts/memory.mdx @@ -530,7 +530,7 @@ Note: To use the cli command you need to have your crew in a file called crew.py ### Resetting Memory via crew object -```python code +```python my_crew = Crew( agents=[...], @@ -560,7 +560,6 @@ my_crew.reset_memories(command_type = 'all') # Resets all the memory | `knowledge` | Reset KNOWLEDGE memory. | | `all` | Reset ALL memories. | -Note: To use the cli command you need to have your crew in a file called crew.py in the same directory. ## Benefits of Using CrewAI's Memory System diff --git a/src/crewai/cli/utils.py b/src/crewai/cli/utils.py index f7f2f65c9..c495225dc 100644 --- a/src/crewai/cli/utils.py +++ b/src/crewai/cli/utils.py @@ -273,7 +273,7 @@ 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 not callable(attr) and hasattr(attr, "kickoff"): + if isinstance(attr, Crew) and hasattr(attr, "kickoff"): print(f"Found valid crew object in attribute '{attr_name}'.") return attr