feat: fix type checking

This commit is contained in:
Eduardo Chiarotti
2024-10-08 17:49:17 -03:00
parent dc1902ff44
commit 8467cda1fa
2 changed files with 5 additions and 4 deletions

View File

@@ -150,7 +150,7 @@ class Flow(Generic[T], metaclass=FlowMeta):
initial_state: Union[Type[T], T, None] = None initial_state: Union[Type[T], T, None] = None
def __class_getitem__(cls, item: Type[T]) -> Type["Flow"]: 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 _initial_state_T: Type[T] = item
_FlowGeneric.__name__ = f"{cls.__name__}[{item.__name__}]" _FlowGeneric.__name__ = f"{cls.__name__}[{item.__name__}]"

View File

@@ -1,7 +1,8 @@
from functools import wraps from functools import wraps
from typing import Any, Callable
from crewai.project.utils import memoize
from crewai import Crew from crewai import Crew
from crewai.project.utils import memoize
def task(func): def task(func):
@@ -73,8 +74,8 @@ def pipeline(func):
return memoize(func) return memoize(func)
def crew(func) -> "Crew": def crew(func) -> Callable[..., "Crew"]:
def wrapper(self, *args, **kwargs): def wrapper(self, *args: Any, **kwargs: Any) -> "Crew":
instantiated_tasks = [] instantiated_tasks = []
instantiated_agents = [] instantiated_agents = []