Spaces:
Running
Running
Update tasks.py
Browse files
tasks.py
CHANGED
@@ -1,62 +1,51 @@
|
|
1 |
from crewai import Task
|
2 |
|
3 |
-
from agents import
|
4 |
|
5 |
-
def
|
6 |
return Task(
|
7 |
description=(
|
8 |
-
"
|
9 |
-
|
10 |
-
"
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
"
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
18 |
)
|
19 |
|
20 |
-
def
|
21 |
return Task(
|
22 |
description=(
|
23 |
-
"
|
24 |
-
|
25 |
-
"
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
)
|
34 |
|
35 |
-
def
|
36 |
return Task(
|
37 |
-
description=(
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
"execute trades for {stock_selection}."
|
45 |
-
),
|
46 |
-
agent=get_execution_agent(),
|
47 |
-
)
|
48 |
-
|
49 |
-
def get_risk_management_task():
|
50 |
-
return Task(
|
51 |
-
description=(
|
52 |
-
"Evaluate the risks associated with the proposed trading "
|
53 |
-
"strategies and execution plans for {stock_selection}. "
|
54 |
-
"Provide a detailed analysis of potential risks "
|
55 |
-
"and suggest mitigation strategies."
|
56 |
-
),
|
57 |
-
expected_output=(
|
58 |
-
"A comprehensive risk analysis report detailing potential "
|
59 |
-
"risks and mitigation recommendations for {stock_selection}."
|
60 |
-
),
|
61 |
-
agent=get_risk_management_agent(),
|
62 |
)
|
|
|
1 |
from crewai import Task
|
2 |
|
3 |
+
from agents import get_content_planner_agent, get_content_writer_agent, get_editor_agent
|
4 |
|
5 |
+
def get_content_planning_task():
|
6 |
return Task(
|
7 |
description=(
|
8 |
+
"1. Prioritize the latest trends, key players, "
|
9 |
+
"and noteworthy news on {topic}.\n"
|
10 |
+
"2. Identify the target audience, considering "
|
11 |
+
"their interests and pain points.\n"
|
12 |
+
"3. Develop a detailed content outline including "
|
13 |
+
"an introduction, key points, and a call to action.\n"
|
14 |
+
"4. Include SEO keywords and relevant data or sources."
|
15 |
+
),
|
16 |
+
expected_output="A comprehensive content plan document "
|
17 |
+
"with an outline, audience analysis, "
|
18 |
+
"SEO keywords, and resources.",
|
19 |
+
agent=planner,
|
20 |
)
|
21 |
|
22 |
+
def get_content_writing_task():
|
23 |
return Task(
|
24 |
description=(
|
25 |
+
"1. Use the content plan to craft a compelling "
|
26 |
+
"blog post on {topic}.\n"
|
27 |
+
"2. Incorporate SEO keywords naturally.\n"
|
28 |
+
"3. Sections/Subtitles are properly named "
|
29 |
+
"in an engaging manner.\n"
|
30 |
+
"4. Ensure the post is structured with an "
|
31 |
+
"engaging introduction, insightful body, "
|
32 |
+
"and a summarizing conclusion.\n"
|
33 |
+
"5. Proofread for grammatical errors and "
|
34 |
+
"alignment with the brand's voice.\n"
|
35 |
+
),
|
36 |
+
expected_output="A well-written blog post "
|
37 |
+
"in markdown format, ready for publication, "
|
38 |
+
"each section should have 2 or 3 paragraphs.",
|
39 |
+
agent=writer,
|
40 |
)
|
41 |
|
42 |
+
def get_editing_task():
|
43 |
return Task(
|
44 |
+
description=("Proofread the given blog post for "
|
45 |
+
"grammatical errors and "
|
46 |
+
"alignment with the brand's voice."),
|
47 |
+
expected_output="A well-written blog post in markdown format, "
|
48 |
+
"ready for publication, "
|
49 |
+
"each section should have 2 or 3 paragraphs.",
|
50 |
+
agent=editor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
)
|