mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-24 07:38:14 +00:00
fixing tasks order
This commit is contained in:
@@ -70,7 +70,10 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
|
||||
self.log_error_after = 3
|
||||
self.have_forced_answer = False
|
||||
self.name_to_tool_map = {tool.name: tool for tool in self.tools}
|
||||
self.llm.stop = self.stop
|
||||
if self.llm.stop:
|
||||
self.llm.stop = list(set(self.llm.stop + self.stop))
|
||||
else:
|
||||
self.llm.stop = self.stop
|
||||
|
||||
def invoke(self, inputs: Dict[str, str]) -> Dict[str, Any]:
|
||||
if "system" in self.prompt:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from functools import wraps
|
||||
|
||||
from crewai.project.utils import memoize
|
||||
from crewai import Crew
|
||||
|
||||
|
||||
def task(func):
|
||||
@@ -72,7 +73,7 @@ def pipeline(func):
|
||||
return memoize(func)
|
||||
|
||||
|
||||
def crew(func):
|
||||
def crew(func) -> "Crew":
|
||||
def wrapper(self, *args, **kwargs):
|
||||
instantiated_tasks = []
|
||||
instantiated_agents = []
|
||||
|
||||
@@ -5,11 +5,8 @@ from typing import Any, Callable, Dict, Type, TypeVar
|
||||
import yaml
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from crewai.crew import Crew
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
T = TypeVar("T", bound=Type[Any])
|
||||
|
||||
|
||||
@@ -37,19 +34,6 @@ def CrewBase(cls: T) -> T:
|
||||
self.map_all_agent_variables()
|
||||
self.map_all_task_variables()
|
||||
|
||||
def crew(self) -> "Crew":
|
||||
agents = [
|
||||
getattr(self, name)()
|
||||
for name, func in self._get_all_functions().items()
|
||||
if hasattr(func, "is_agent")
|
||||
]
|
||||
tasks = [
|
||||
getattr(self, name)()
|
||||
for name, func in reversed(self._get_all_functions().items())
|
||||
if hasattr(func, "is_task")
|
||||
]
|
||||
return Crew(agents=agents, tasks=tasks)
|
||||
|
||||
@staticmethod
|
||||
def load_yaml(config_path: Path):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user