mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-03 06:08:15 +00:00
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
from crewai import Agent, Crew, Process, Task
|
|
from crewai.project import CrewBase, agent, crew, task
|
|
from crewai.agents.agent_builder.base_agent import BaseAgent
|
|
|
|
|
|
@CrewBase
|
|
class {{crew_name}}():
|
|
"""{{crew_name}} crew"""
|
|
|
|
agents: list[BaseAgent]
|
|
tasks: list[Task]
|
|
|
|
@agent
|
|
def researcher(self) -> Agent:
|
|
return Agent(
|
|
config=self.agents_config['researcher'], # type: ignore[index]
|
|
verbose=True
|
|
)
|
|
|
|
@agent
|
|
def reporting_analyst(self) -> Agent:
|
|
return Agent(
|
|
config=self.agents_config['reporting_analyst'], # type: ignore[index]
|
|
verbose=True
|
|
)
|
|
|
|
@task
|
|
def research_task(self) -> Task:
|
|
return Task(
|
|
config=self.tasks_config['research_task'], # type: ignore[index]
|
|
)
|
|
|
|
@task
|
|
def reporting_task(self) -> Task:
|
|
return Task(
|
|
config=self.tasks_config['reporting_task'], # type: ignore[index]
|
|
output_file='report.md'
|
|
)
|
|
|
|
@crew
|
|
def crew(self) -> Crew:
|
|
"""Creates the {{crew_name}} crew"""
|
|
return Crew(
|
|
agents=self.agents,
|
|
tasks=self.tasks,
|
|
process=Process.sequential,
|
|
verbose=True,
|
|
)
|