mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
feat: fix type checking
This commit is contained in:
@@ -150,7 +150,7 @@ class Flow(Generic[T], metaclass=FlowMeta):
|
||||
initial_state: Union[Type[T], T, None] = None
|
||||
|
||||
def __class_getitem__(cls, item: Type[T]) -> Type["Flow"]:
|
||||
class _FlowGeneric(cls):
|
||||
class _FlowGeneric(cls): # type: ignore # Variable "cls" is not valid as a type
|
||||
_initial_state_T: Type[T] = item
|
||||
|
||||
_FlowGeneric.__name__ = f"{cls.__name__}[{item.__name__}]"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from functools import wraps
|
||||
from typing import Any, Callable
|
||||
|
||||
from crewai.project.utils import memoize
|
||||
from crewai import Crew
|
||||
from crewai.project.utils import memoize
|
||||
|
||||
|
||||
def task(func):
|
||||
@@ -73,8 +74,8 @@ def pipeline(func):
|
||||
return memoize(func)
|
||||
|
||||
|
||||
def crew(func) -> "Crew":
|
||||
def wrapper(self, *args, **kwargs):
|
||||
def crew(func) -> Callable[..., "Crew"]:
|
||||
def wrapper(self, *args: Any, **kwargs: Any) -> "Crew":
|
||||
instantiated_tasks = []
|
||||
instantiated_agents = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user