Spaces:
Running
Running
Update agents.py
Browse files
agents.py
CHANGED
@@ -1,61 +1,62 @@
|
|
1 |
from crewai import Agent, Task, Crew
|
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 |
-
|
|
|
|
1 |
from crewai import Agent, Task, Crew
|
2 |
|
3 |
+
class Agents:
|
4 |
+
def get_data_analyst_agent():
|
5 |
+
return Agent(
|
6 |
+
role="Data Analyst",
|
7 |
+
goal="Monitor and analyze market data in real-time "
|
8 |
+
"to identify trends and predict market movements.",
|
9 |
+
backstory="Specializing in financial markets, this agent "
|
10 |
+
"uses statistical modeling and machine learning "
|
11 |
+
"to provide crucial insights. With a knack for data, "
|
12 |
+
"the Data Analyst Agent is the cornerstone for "
|
13 |
+
"informing trading decisions.",
|
14 |
+
verbose=True,
|
15 |
+
allow_delegation=True,
|
16 |
+
tools = [scrape_tool, search_tool]
|
17 |
+
)
|
18 |
+
|
19 |
+
def get_trading_strategy_agent():
|
20 |
+
return Agent(
|
21 |
+
role="Trading Strategy Developer",
|
22 |
+
goal="Develop and test various trading strategies based "
|
23 |
+
"on insights from the Data Analyst Agent.",
|
24 |
+
backstory="Equipped with a deep understanding of financial "
|
25 |
+
"markets and quantitative analysis, this agent "
|
26 |
+
"devises and refines trading strategies. It evaluates "
|
27 |
+
"the performance of different approaches to determine "
|
28 |
+
"the most profitable and risk-averse options.",
|
29 |
+
verbose=True,
|
30 |
+
allow_delegation=True,
|
31 |
+
tools = [scrape_tool, search_tool]
|
32 |
+
)
|
33 |
+
|
34 |
+
def get_execution_agent():
|
35 |
+
return Agent(
|
36 |
+
role="Trade Advisor",
|
37 |
+
goal="Suggest optimal trade execution strategies "
|
38 |
+
"based on approved trading strategies.",
|
39 |
+
backstory="This agent specializes in analyzing the timing, price, "
|
40 |
+
"and logistical details of potential trades. By evaluating "
|
41 |
+
"these factors, it provides well-founded suggestions for "
|
42 |
+
"when and how trades should be executed to maximize "
|
43 |
+
"efficiency and adherence to strategy.",
|
44 |
+
verbose=True,
|
45 |
+
allow_delegation=True,
|
46 |
+
tools = [scrape_tool, search_tool]
|
47 |
+
)
|
48 |
+
|
49 |
+
def get_risk_management_agent():
|
50 |
+
return Agent(
|
51 |
+
role="Risk Advisor",
|
52 |
+
goal="Evaluate and provide insights on the risks "
|
53 |
+
"associated with potential trading activities.",
|
54 |
+
backstory="Armed with a deep understanding of risk assessment models "
|
55 |
+
"and market dynamics, this agent scrutinizes the potential "
|
56 |
+
"risks of proposed trades. It offers a detailed analysis of "
|
57 |
+
"risk exposure and suggests safeguards to ensure that "
|
58 |
+
"trading activities align with the firm’s risk tolerance.",
|
59 |
+
verbose=True,
|
60 |
+
allow_delegation=True,
|
61 |
+
tools = [scrape_tool, search_tool]
|
62 |
+
)
|