Spaces:
Running
Running
Update tasks.py
Browse files
tasks.py
CHANGED
@@ -1,66 +1,51 @@
|
|
1 |
from crewai import Task
|
2 |
|
3 |
-
from agents import
|
4 |
|
5 |
-
def
|
6 |
-
# Task for Data Analyst Agent: Analyze Market Data
|
7 |
return Task(
|
8 |
description=(
|
9 |
-
"
|
10 |
-
|
11 |
-
"
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
"
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
19 |
)
|
20 |
|
21 |
-
def
|
22 |
-
# Task for Trading Strategy Agent: Develop Trading Strategies
|
23 |
return Task(
|
24 |
description=(
|
25 |
-
"
|
26 |
-
|
27 |
-
"
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
35 |
)
|
36 |
|
37 |
-
def
|
38 |
-
# Task for Trade Advisor Agent: Plan Trade Execution
|
39 |
return Task(
|
40 |
-
description=(
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
"execute trades for {stock_selection}."
|
48 |
-
),
|
49 |
-
agent=get_execution_agent(),
|
50 |
-
)
|
51 |
-
|
52 |
-
def get_risk_assessment_task():
|
53 |
-
# Task for Risk Advisor Agent: Assess Trading Risks
|
54 |
-
return Task(
|
55 |
-
description=(
|
56 |
-
"Evaluate the risks associated with the proposed trading "
|
57 |
-
"strategies and execution plans for {stock_selection}. "
|
58 |
-
"Provide a detailed analysis of potential risks "
|
59 |
-
"and suggest mitigation strategies."
|
60 |
-
),
|
61 |
-
expected_output=(
|
62 |
-
"A comprehensive risk analysis report detailing potential "
|
63 |
-
"risks and mitigation recommendations for {stock_selection}."
|
64 |
-
),
|
65 |
-
agent=get_risk_management_agent(),
|
66 |
)
|
|
|
1 |
from crewai import Task
|
2 |
|
3 |
+
from agents import get_planner, get_writer, get_editor
|
4 |
|
5 |
+
def get_plan_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=get_planner(),
|
20 |
)
|
21 |
|
22 |
+
def get_write_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=get_writer(),
|
40 |
)
|
41 |
|
42 |
+
def get_edit_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=get_editor()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
)
|