Spaces:
Sleeping
Sleeping
Update tasks.py
Browse files
tasks.py
CHANGED
@@ -1,51 +1,62 @@
|
|
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 |
-
"SEO keywords, and resources.",
|
19 |
-
agent=get_content_planner_agent()
|
20 |
)
|
21 |
|
22 |
-
def
|
23 |
return Task(
|
24 |
description=(
|
25 |
-
"
|
26 |
-
|
27 |
-
"
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
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_content_writer_agent()
|
40 |
)
|
41 |
|
42 |
-
def
|
43 |
return Task(
|
44 |
-
description=(
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
)
|
|
|
1 |
from crewai import Task
|
2 |
|
3 |
+
from agents import get_data_analyst_agent, get_trading_strategy_agent, get_execution_agent, get_risk_management_agent
|
4 |
|
5 |
+
def get_data_analysis_task():
|
6 |
return Task(
|
7 |
description=(
|
8 |
+
"Continuously monitor and analyze market data for "
|
9 |
+
"the selected stock ({stock_selection}). "
|
10 |
+
"Use statistical modeling and machine learning to "
|
11 |
+
"identify trends and predict market movements."
|
12 |
+
),
|
13 |
+
expected_output=(
|
14 |
+
"Insights and alerts about significant market "
|
15 |
+
"opportunities or threats for {stock_selection}."
|
16 |
+
),
|
17 |
+
agent=get_data_analyst_agent(),
|
|
|
|
|
18 |
)
|
19 |
|
20 |
+
def get_trading_strategy_task():
|
21 |
return Task(
|
22 |
description=(
|
23 |
+
"Develop and refine trading strategies based on "
|
24 |
+
"the insights from the Data Analyst and "
|
25 |
+
"user-defined risk tolerance ({risk_tolerance}). "
|
26 |
+
"Consider trading preferences ({trading_strategy_preference})."
|
27 |
+
),
|
28 |
+
expected_output=(
|
29 |
+
"A set of potential trading strategies for {stock_selection} "
|
30 |
+
"that align with the user's risk tolerance."
|
31 |
+
),
|
32 |
+
agent=get_trading_strategy_agent(),
|
|
|
|
|
|
|
|
|
|
|
33 |
)
|
34 |
|
35 |
+
def get_execution_task():
|
36 |
return Task(
|
37 |
+
description=(
|
38 |
+
"Analyze approved trading strategies to determine the "
|
39 |
+
"best execution methods for {stock_selection}, "
|
40 |
+
"considering current market conditions and optimal pricing."
|
41 |
+
),
|
42 |
+
expected_output=(
|
43 |
+
"Detailed execution plans suggesting how and when to "
|
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 |
)
|