mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Fix #2500: Add Crewai alias for backward compatibility
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -1384,3 +1384,6 @@ class Crew(BaseModel):
|
||||
memory_system.reset()
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Failed to reset {name} memory") from e
|
||||
|
||||
|
||||
Crewai = Crew
|
||||
|
||||
17
tests/test_crewai_alias.py
Normal file
17
tests/test_crewai_alias.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import unittest
|
||||
|
||||
class TestCrewaiAlias(unittest.TestCase):
|
||||
"""Test the Crewai alias for backward compatibility."""
|
||||
|
||||
def test_crewai_alias_import(self):
|
||||
"""Test that Crewai can be imported from crewai.crew."""
|
||||
try:
|
||||
from crewai.crew import Crewai
|
||||
from crewai.crew import Crew
|
||||
|
||||
self.assertEqual(Crewai, Crew)
|
||||
except ImportError:
|
||||
self.fail("Failed to import Crewai from crewai.crew")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user