Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
fix missing config (#1557)
Brandon Hancock (bhancock_ai)e856359e2333
diff --git a/src/crewai/cli/add_crew_to_flow.py b/src/crewai/cli/add_crew_to_flow.pyindex e4901fa89..ef693a22b 100644--- a/src/crewai/cli/add_crew_to_flow.py+++ b/src/crewai/cli/add_crew_to_flow.py@@ -54,7 +54,7 @@ def create_embedded_crew(crew_name: str, parent_folder: Path) -> None:templates_dir = Path(__file__).parent / "templates" / "crew"config_template_files = ["agents.yaml", "tasks.yaml"]- crew_template_file = f"{folder_name}_crew.py" # Updated file name+ crew_template_file = f"{folder_name}.py" # Updated file namefor file_name in config_template_files:src_file = templates_dir / "config" / file_namediff --git a/src/crewai/cli/templates/crew/crew.py b/src/crewai/cli/templates/crew/crew.pyindex 392e29edd..c47315415 100644--- a/src/crewai/cli/templates/crew/crew.py+++ b/src/crewai/cli/templates/crew/crew.py@@ -8,9 +8,12 @@ from crewai.project import CrewBase, agent, crew, task# from crewai_tools import SerperDevTool@CrewBase-class {{crew_name}}Crew():+class {{crew_name}}():"""{{crew_name}} crew"""+ agents_config = 'config/agents.yaml'+ tasks_config = 'config/tasks.yaml'+@agentdef researcher(self) -> Agent:return Agent(diff --git a/src/crewai/cli/templates/crew/main.py b/src/crewai/cli/templates/crew/main.pyindex d441fa0fa..d5224edcf 100644--- a/src/crewai/cli/templates/crew/main.py+++ b/src/crewai/cli/templates/crew/main.py@@ -2,7 +2,7 @@import sysimport warnings-from {{folder_name}}.crew import {{crew_name}}Crew+from {{folder_name}}.crew import {{crew_name}}warnings.filterwarnings("ignore", category=SyntaxWarning, module="pysbd")@@ -18,7 +18,7 @@ def run():inputs = {'topic': 'AI LLMs'}- {{crew_name}}Crew().crew().kickoff(inputs=inputs)+ {{crew_name}}().crew().kickoff(inputs=inputs)def train():@@ -29,7 +29,7 @@ def train():"topic": "AI LLMs"}try:- {{crew_name}}Crew().crew().train(n_iterations=int(sys.argv[1]), filename=sys.argv[2], inputs=inputs)+ {{crew_name}}().crew().train(n_iterations=int(sys.argv[1]), filename=sys.argv[2], inputs=inputs)except Exception as e:raise Exception(f"An error occurred while training the crew: {e}")@@ -39,7 +39,7 @@ def replay():Replay the crew execution from a specific task."""try:- {{crew_name}}Crew().crew().replay(task_id=sys.argv[1])+ {{crew_name}}().crew().replay(task_id=sys.argv[1])except Exception as e:raise Exception(f"An error occurred while replaying the crew: {e}")@@ -52,7 +52,7 @@ def test():"topic": "AI LLMs"}try:- {{crew_name}}Crew().crew().test(n_iterations=int(sys.argv[1]), openai_model_name=sys.argv[2], inputs=inputs)+ {{crew_name}}().crew().test(n_iterations=int(sys.argv[1]), openai_model_name=sys.argv[2], inputs=inputs)except Exception as e:raise Exception(f"An error occurred while replaying the crew: {e}")