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