mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
fixing annotations
This commit is contained in:
@@ -76,22 +76,24 @@ def crew(func) -> Callable[..., Crew]:
|
|||||||
instantiated_agents = []
|
instantiated_agents = []
|
||||||
agent_roles = set()
|
agent_roles = set()
|
||||||
|
|
||||||
# Collect methods from crew in order
|
# Collect methods from crew instance (not class)
|
||||||
all_functions = [
|
all_functions = [
|
||||||
(name, getattr(self, name))
|
(name, getattr(self, name))
|
||||||
for name, attr in self.__class__.__dict__.items()
|
for name in dir(self)
|
||||||
if callable(attr)
|
if callable(getattr(self, name)) and not name.startswith("__")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Filter tasks and agents
|
||||||
tasks = [
|
tasks = [
|
||||||
(name, method)
|
(name, method)
|
||||||
for name, method in all_functions
|
for name, method in all_functions
|
||||||
if hasattr(method, "is_task")
|
if hasattr(method, "is_task") and method.is_task
|
||||||
]
|
]
|
||||||
|
|
||||||
agents = [
|
agents = [
|
||||||
(name, method)
|
(name, method)
|
||||||
for name, method in all_functions
|
for name, method in all_functions
|
||||||
if hasattr(method, "is_agent")
|
if hasattr(method, "is_agent") and method.is_agent
|
||||||
]
|
]
|
||||||
|
|
||||||
# Instantiate tasks in order
|
# Instantiate tasks in order
|
||||||
|
|||||||
Reference in New Issue
Block a user