-
Notifications
You must be signed in to change notification settings - Fork 4
/
stock_analysis_agents.py
125 lines (113 loc) · 4.11 KB
/
stock_analysis_agents.py
1
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
from crewai import Agent
from tools.brap_tools import *
from tools.calculator_tools import CalculatorTools
from crewai_tools import (
SerperDevTool,
WebsiteSearchTool
)
quote_tool = QuoteTool()
search_tool = SerperDevTool()
web_rag_tool = WebsiteSearchTool()
calculator_tool = CalculatorTools.calculate
balance_tool = BalanceTools()
dividends_tool = DividendsTools()
income_tool = IncomeStatementTool()
financial_data_tool = FinancialDataTool()
key_stats_tool = DefaultKeyStatisticsTool()
class StockAnalysisAgents:
def financial_analyst(self):
return Agent(
role='The Best Financial Analyst',
goal="""Impress all customers with your financial data
and market trends analysis""",
backstory="""The most seasoned financial analyst with
lots of expertise in stock market analysis and investment
strategies that is working for a super important customer.""",
verbose=True,
max_iter=100,
tools=[
quote_tool,
search_tool,
web_rag_tool,
calculator_tool,
balance_tool,
dividends_tool,
income_tool,
financial_data_tool,
key_stats_tool
],
memory=True
)
def fundamental_analysis_agent(self):
return Agent(
role='Expert Financial Analyst',
goal='Conduct comprehensive fundamental analyses to uncover investment opportunities and risks',
backstory=(
"With years of experience in financial markets and a deep understanding of "
"economic indicators, you excel at dissecting company reports, assessing "
"financial health, and identifying undervalued stocks. Your insights "
"inform investment strategies, guiding stakeholders toward sound financial "
"decisions. Equipped with a meticulous approach to data, you navigate through "
"complex financial landscapes, turning intricate details into actionable "
"investment advice."
),
verbose=True,
tools=[
quote_tool,
search_tool,
web_rag_tool,
calculator_tool,
balance_tool,
dividends_tool,
income_tool,
financial_data_tool,
key_stats_tool
],
memory=True
)
def research_analyst(self):
return Agent(
role='Staff Research Analyst',
goal="""Being the best at gather, interpret data and amaze
your customer with it""",
backstory="""Known as the BEST research analyst, you're
skilled in sifting through news, company announcements,
and market sentiments. Now you're working on a super
important customer""",
verbose=True,
tools=[
quote_tool,
search_tool,
web_rag_tool,
calculator_tool,
balance_tool,
dividends_tool,
income_tool,
financial_data_tool,
key_stats_tool
],
memory=True
)
def investment_advisor(self):
return Agent(
role='Private Investment Advisor',
goal="""Impress your customers with full analyses over stocks
and completer investment recommendations""",
backstory="""You're the most experienced investment advisor
and you combine various analytical insights to formulate
strategic investment advice. You are now working for
a super important customer you need to impress.""",
verbose=True,
tools=[
quote_tool,
search_tool,
web_rag_tool,
calculator_tool,
balance_tool,
dividends_tool,
income_tool,
financial_data_tool,
key_stats_tool
],
memory=True
)