Spaces:
Sleeping
Sleeping
File size: 1,714 Bytes
1aa5be2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
from crewai.agents.agent_builder.base_agent import BaseAgent
from typing import List
@CrewBase
class DebateContest():
"""DebateContest crew"""
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
@agent
def debator_contestant1(self) -> Agent:
return Agent(
config = self.agents_config['debator_contestant1'],
verbose = True
)
@agent
def debator_contestant2(self)-> Agent:
return Agent(
config = self.agents_config['debator_contestant2'],
verbose = True
)
@agent
def judge(self) -> Agent:
return Agent(
config = self.agents_config['judge'],
verbose = True
)
@task
def propose_motion(self) -> Task:
return Task(
config = self.tasks_config['propose_motion']
)
@task
def oppose_motion(self) -> Task:
return Task(
config = self.tasks_config['oppose_motion']
)
@task
def review(self) -> Task:
return Task(
config = self.tasks_config['review']
)
@crew
def crew(self) -> Crew:
"""Creates the DebateContest crew"""
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
)
|