forked from syrom/crewAI_for_party_program
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
60 lines (56 loc) · 2.57 KB
/
tasks.py
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
from textwrap import dedent
from crewai import Task
class PoliticalProgramTasks():
def research_task(self, agent, participants, context):
return Task(
description=dedent(f"""\
Conduct comprehensive research on each typical domain of interest in the context
of municipal elections. Gather information on needs, known problems and recent developments
in the respective domains.
Participants: {participants}
Political Program Context: {context}"""),
expected_output=dedent("""\
A detailed report summarizing key findings about each domain,
highlighting information that could be relevant for the election program."""),
async_execution=True,
agent=agent
)
def priority_analysis_task(self, agent, participants, context):
return Task(
description=dedent(f"""\
Analyze the current trends, challenges, and opportunities
of European urban politics for large cities. Consider recent
developments and expert opinions to provide a priortiy list covering
all domains of urban politics that dominate the public discussion in Europe.
Participants: {participants}
Political Program Context: {context}"""),
expected_output=dedent("""\
A list of 8 domains of urban politics that rank high
in public discussion."""),
async_execution=True,
agent=agent
)
def political_strategy_task(self, agent, context, objective):
return Task(
description=dedent(f"""\
Formulate concrete political demands for the domains identified through the priortiy analysis.
The demands must aligning with the liberal views of participants.
Political Program Context: {context}
Political Program Objective: {objective}"""),
expected_output=dedent("""\
Provide a list of concrete political demands for each domain to draft a comprehensive
municipal election program that reflects the liberal views of Paricipants."""),
agent=agent
)
def draft_task(self, agent, context, objective):
return Task(
description=dedent(f"""\
Fuse the policitcal demands per domain to create a comprehensive municipal election program.
Ensure the municipal election program is easy to digest and the tone of voice resonates well with liberally minded citizens.
Political Program Context: {context}
Political Program Objective: {objective}"""),
expected_output=dedent("""\
A liberal municipal election program that is structured with one sections for each identified municipal policy domain,
listing the political demands associated with the respective domain."""),
agent=agent
)