forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.py
More file actions
42 lines (35 loc) · 1.2 KB
/
Copy pathagent.py
File metadata and controls
42 lines (35 loc) · 1.2 KB
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
"""Example: Agno Agent with Finance tools
This example shows how to create an Agno Agent with tools (YFinanceTools) and expose it in an AG-UI compatible way.
To run the example:
1. Install the dependencies:
```bash
pip install agno openai yfinance
```
2. Run the example:
```bash
python agent.py
```
"""
from agno.agent.agent import Agent
from agno.app.agui.app import AGUIApp
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[
YFinanceTools(
stock_price=True, analyst_recommendations=True, stock_fundamentals=True
)
],
description="You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",
instructions="Format your response using markdown and use tables to display data where possible.",
)
agui_app = AGUIApp(
agent=agent,
name="Investment Analyst",
app_id="investment_analyst",
description="An investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",
)
app = agui_app.get_app()
if __name__ == "__main__":
agui_app.serve(app="agent:app", port=8000, reload=True)