-
Notifications
You must be signed in to change notification settings - Fork 0
/
personal_finance_agent.py
50 lines (43 loc) · 1.26 KB
/
personal_finance_agent.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
from phi.agent import Agent
from phi.model.groq import Groq
from phi.tools.yfinance import YFinanceTools
from phi.tools.duckduckgo import DuckDuckGo
import os
from dotenv import load_dotenv
load_dotenv()
# web search agent
web_search_agent = Agent(
name="Web search Agent",
role="Search the web for the information",
model=Groq(id="llama3-groq-70b-8192-tool-use-preview"),
tools=[DuckDuckGo()],
instructions=["Always include sources"],
show_tool_calls=True,
markdown=True,
)
# Financial agent
finance_agent = Agent(
name="Finance AI agent",
model=Groq(id="llama3-groq-70b-8192-tool-use-preview"),
tools=[
YFinanceTools(
stock_price=True,
analyst_recommendations=True,
stock_fundamentals=True,
company_news=True,
)
],
instructions=["Use tables to display the data"],
show_tool_calls=True,
markdown=True,
)
multi_ai_agent = Agent(
team=[web_search_agent, finance_agent],
model=Groq(id="llama-3.3-70b-versatile"),
instructions=["Always include sources", "Use tables to display the data"],
show_tool_calls=True,
markdown=True,
)
multi_ai_agent.print_response(
"Summarize analyst recommendations and share the latest news for Apple Inc. (AAPL)."
)