forked from Shubhamsaboo/awesome-llm-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxai_finance_agent.py
More file actions
22 lines (19 loc) · 827 Bytes
/
Copy pathxai_finance_agent.py
File metadata and controls
22 lines (19 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# import necessary python libraries
from agno.agent import Agent
from agno.models.xai import xAI
from agno.tools.yfinance import YFinanceTools
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.playground import Playground, serve_playground_app
# create the AI finance agent
agent = Agent(
name="xAI Finance Agent",
model = xAI(id="grok-beta"),
tools=[DuckDuckGoTools(), YFinanceTools(stock_price=True, analyst_recommendations=True, stock_fundamentals=True)],
instructions = ["Always use tables to display financial/numerical data. For text data use bullet points and small paragrpahs."],
show_tool_calls = True,
markdown = True,
)
# UI for finance agent
app = Playground(agents=[agent]).get_app()
if __name__ == "__main__":
serve_playground_app("xai_finance_agent:app", reload=True)