mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-28 17:48:13 +00:00
Fix Crewai alias implementation to preserve type checking
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -1398,16 +1398,17 @@ class Crew(BaseModel):
|
|||||||
raise RuntimeError(f"Failed to reset {name} memory") from e
|
raise RuntimeError(f"Failed to reset {name} memory") from e
|
||||||
|
|
||||||
|
|
||||||
def _get_crewai():
|
class Crewai(Crew):
|
||||||
warnings.warn(
|
"""Alias for Crew class to provide backward compatibility.
|
||||||
"Crewai is deprecated, use Crew instead.",
|
|
||||||
DeprecationWarning,
|
This class inherits from Crew and provides the same functionality,
|
||||||
stacklevel=2
|
but emits a deprecation warning when used.
|
||||||
)
|
"""
|
||||||
return Crew
|
|
||||||
|
def __new__(cls, *args, **kwargs):
|
||||||
class _CrewaiDescriptor:
|
warnings.warn(
|
||||||
def __get__(self, obj, objtype=None):
|
"Crewai is deprecated, use Crew instead.",
|
||||||
return _get_crewai()
|
DeprecationWarning,
|
||||||
|
stacklevel=2
|
||||||
sys.modules[__name__].__dict__['Crewai'] = _get_crewai()
|
)
|
||||||
|
return super().__new__(cls)
|
||||||
|
|||||||
Reference in New Issue
Block a user