mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Convert tab to spaces on crew.py template (#2190)
Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
This commit is contained in:
@@ -1,62 +1,62 @@
|
|||||||
from crewai import Agent, Crew, Process, Task
|
from crewai import Agent, Crew, Process, Task
|
||||||
from crewai.project import CrewBase, agent, crew, task
|
from crewai.project import CrewBase, agent, crew, task
|
||||||
|
|
||||||
# If you want to run a snippet of code before or after the crew starts,
|
# If you want to run a snippet of code before or after the crew starts,
|
||||||
# you can use the @before_kickoff and @after_kickoff decorators
|
# you can use the @before_kickoff and @after_kickoff decorators
|
||||||
# https://docs.crewai.com/concepts/crews#example-crew-class-with-decorators
|
# https://docs.crewai.com/concepts/crews#example-crew-class-with-decorators
|
||||||
|
|
||||||
@CrewBase
|
@CrewBase
|
||||||
class {{crew_name}}():
|
class {{crew_name}}():
|
||||||
"""{{crew_name}} crew"""
|
"""{{crew_name}} crew"""
|
||||||
|
|
||||||
# Learn more about YAML configuration files here:
|
# Learn more about YAML configuration files here:
|
||||||
# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
|
# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
|
||||||
# Tasks: https://docs.crewai.com/concepts/tasks#yaml-configuration-recommended
|
# Tasks: https://docs.crewai.com/concepts/tasks#yaml-configuration-recommended
|
||||||
agents_config = 'config/agents.yaml'
|
agents_config = 'config/agents.yaml'
|
||||||
tasks_config = 'config/tasks.yaml'
|
tasks_config = 'config/tasks.yaml'
|
||||||
|
|
||||||
# If you would like to add tools to your agents, you can learn more about it here:
|
# If you would like to add tools to your agents, you can learn more about it here:
|
||||||
# https://docs.crewai.com/concepts/agents#agent-tools
|
# https://docs.crewai.com/concepts/agents#agent-tools
|
||||||
@agent
|
@agent
|
||||||
def researcher(self) -> Agent:
|
def researcher(self) -> Agent:
|
||||||
return Agent(
|
return Agent(
|
||||||
config=self.agents_config['researcher'],
|
config=self.agents_config['researcher'],
|
||||||
verbose=True
|
verbose=True
|
||||||
)
|
)
|
||||||
|
|
||||||
@agent
|
@agent
|
||||||
def reporting_analyst(self) -> Agent:
|
def reporting_analyst(self) -> Agent:
|
||||||
return Agent(
|
return Agent(
|
||||||
config=self.agents_config['reporting_analyst'],
|
config=self.agents_config['reporting_analyst'],
|
||||||
verbose=True
|
verbose=True
|
||||||
)
|
)
|
||||||
|
|
||||||
# To learn more about structured task outputs,
|
# To learn more about structured task outputs,
|
||||||
# task dependencies, and task callbacks, check out the documentation:
|
# task dependencies, and task callbacks, check out the documentation:
|
||||||
# https://docs.crewai.com/concepts/tasks#overview-of-a-task
|
# https://docs.crewai.com/concepts/tasks#overview-of-a-task
|
||||||
@task
|
@task
|
||||||
def research_task(self) -> Task:
|
def research_task(self) -> Task:
|
||||||
return Task(
|
return Task(
|
||||||
config=self.tasks_config['research_task'],
|
config=self.tasks_config['research_task'],
|
||||||
)
|
)
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def reporting_task(self) -> Task:
|
def reporting_task(self) -> Task:
|
||||||
return Task(
|
return Task(
|
||||||
config=self.tasks_config['reporting_task'],
|
config=self.tasks_config['reporting_task'],
|
||||||
output_file='report.md'
|
output_file='report.md'
|
||||||
)
|
)
|
||||||
|
|
||||||
@crew
|
@crew
|
||||||
def crew(self) -> Crew:
|
def crew(self) -> Crew:
|
||||||
"""Creates the {{crew_name}} crew"""
|
"""Creates the {{crew_name}} crew"""
|
||||||
# To learn how to add knowledge sources to your crew, check out the documentation:
|
# To learn how to add knowledge sources to your crew, check out the documentation:
|
||||||
# https://docs.crewai.com/concepts/knowledge#what-is-knowledge
|
# https://docs.crewai.com/concepts/knowledge#what-is-knowledge
|
||||||
|
|
||||||
return Crew(
|
return Crew(
|
||||||
agents=self.agents, # Automatically created by the @agent decorator
|
agents=self.agents, # Automatically created by the @agent decorator
|
||||||
tasks=self.tasks, # Automatically created by the @task decorator
|
tasks=self.tasks, # Automatically created by the @task decorator
|
||||||
process=Process.sequential,
|
process=Process.sequential,
|
||||||
verbose=True,
|
verbose=True,
|
||||||
# process=Process.hierarchical, # In case you wanna use that instead https://docs.crewai.com/how-to/Hierarchical/
|
# process=Process.hierarchical, # In case you wanna use that instead https://docs.crewai.com/how-to/Hierarchical/
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user