Files
agentic-studio/zipit/projekti_clean/crew.py
2026-04-12 18:48:14 +03:00

86 lines
2.2 KiB
Python

"""Todo-sovellus FastAPI + SQLite, CRUD-endpointit ja testit
CrewAI crew — generated by Kipinä Agentic Studio.
Run: crewai run
"""
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
@CrewBase
class ProjectCrew:
"""Todo-sovellus FastAPI + SQLite, CRUD-endpointit ja testit"""
agents_config = "agents.yaml"
tasks_config = "tasks.yaml"
@agent
def client(self) -> Agent:
return Agent(config=self.agents_config["client"])
@agent
def data(self) -> Agent:
return Agent(config=self.agents_config["data"])
@agent
def coder(self) -> Agent:
return Agent(config=self.agents_config["coder"])
@agent
def qa(self) -> Agent:
return Agent(config=self.agents_config["qa"])
@agent
def tester(self) -> Agent:
return Agent(config=self.agents_config["tester"])
@agent
def observer(self) -> Agent:
return Agent(config=self.agents_config["observer"])
@task
def step_0_requirements(self) -> Task:
return Task(config=self.tasks_config["step_0_requirements"])
@task
def step_1_models_py(self) -> Task:
return Task(config=self.tasks_config["step_1_models_py"])
@task
def step_2_schemas_py(self) -> Task:
return Task(config=self.tasks_config["step_2_schemas_py"])
@task
def step_3_main_py(self) -> Task:
return Task(config=self.tasks_config["step_3_main_py"])
@task
def step_4_pyproject_toml(self) -> Task:
return Task(config=self.tasks_config["step_4_pyproject_toml"])
@task
def step_5_review(self) -> Task:
return Task(config=self.tasks_config["step_5_review"])
@task
def step_6_test_main_py(self) -> Task:
return Task(config=self.tasks_config["step_6_test_main_py"])
@task
def step_7_dockerfile(self) -> Task:
return Task(config=self.tasks_config["step_7_dockerfile"])
@task
def step_8_readme_md(self) -> Task:
return Task(config=self.tasks_config["step_8_readme_md"])
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
)