Skip to content

Commit f6901f7

Browse files
committed
Update Agno Version
1 parent 5648c62 commit f6901f7

14 files changed

+782
-7
lines changed

api/routes/playground.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,34 @@
44

55
from agents.sage import get_sage
66
from agents.scholar import get_scholar
7+
from teams.finance_researcher_team import get_finance_researcher_team
8+
from teams.multi_language_team import get_multi_language_team
9+
from workflows.blog_post_generator import get_blog_post_generator
10+
from workflows.investment_report_generator import get_investment_report_generator
711
from workspace.dev_resources import dev_fastapi
812

913
######################################################
1014
## Router for the Playground Interface
1115
######################################################
1216

17+
# Agents
1318
sage_agent = get_sage(debug_mode=True)
1419
scholar_agent = get_scholar(debug_mode=True)
1520

21+
# Teams
22+
finance_researcher_team = get_finance_researcher_team(debug_mode=True)
23+
multi_language_team = get_multi_language_team(debug_mode=True)
24+
25+
# Workflows
26+
blog_post_generator = get_blog_post_generator(debug_mode=True)
27+
investment_report_generator = get_investment_report_generator(debug_mode=True)
28+
1629
# Create a playground instance
17-
playground = Playground(agents=[sage_agent, scholar_agent])
30+
playground = Playground(
31+
agents=[sage_agent, scholar_agent],
32+
teams=[finance_researcher_team, multi_language_team],
33+
workflows=[blog_post_generator, investment_report_generator],
34+
)
1835

1936
# Register the endpoint where playground routes are served with agno.com
2037
if getenv("RUNTIME_ENV") == "dev":

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ readme = "README.md"
66
authors = [{ name = "Agno", email = "hello@agno.com" }]
77

88
dependencies = [
9-
"agno[aws]==1.2.4",
9+
"agno[aws]==1.3.5",
1010
"alembic",
1111
"beautifulsoup4",
1212
"duckduckgo-search",
1313
"exa_py",
1414
"fastapi[standard]",
15+
"googlesearch-python",
16+
"lxml_html_clean",
17+
"newspaper4k",
1518
"openai",
1619
"pgvector",
1720
"psycopg[binary]",
21+
"pycountry",
1822
"sqlalchemy",
1923
"streamlit",
2024
"tiktoken",
2125
"typer",
26+
"yfinance",
2227
]
2328

2429
[project.optional-dependencies]

requirements.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file was autogenerated by uv via the following command:
2-
# ./scripts/generate_requirements.sh upgrade
3-
agno==1.2.4
2+
# ./scripts/generate_requirements.sh
3+
agno==1.3.5
44
agno-aws==0.0.1
55
agno-docker==0.0.1
66
alembic==1.15.1
@@ -25,8 +25,12 @@ email-validator==2.2.0
2525
exa-py==1.9.1
2626
fastapi==0.115.12
2727
fastapi-cli==0.0.7
28+
feedparser==6.0.11
29+
filelock==3.18.0
30+
frozendict==2.4.6
2831
gitdb==4.0.12
2932
gitpython==3.1.44
33+
googlesearch-python==1.3.0
3034
h11==0.14.0
3135
httpcore==1.0.7
3236
httptools==0.6.4
@@ -36,26 +40,34 @@ iniconfig==2.1.0
3640
jinja2==3.1.6
3741
jiter==0.9.0
3842
jmespath==1.0.1
43+
joblib==1.4.2
3944
jsonschema==4.23.0
4045
jsonschema-specifications==2024.10.1
4146
lxml==5.3.1
47+
lxml-html-clean==0.4.2
4248
mako==1.3.9
4349
markdown-it-py==3.0.0
4450
markupsafe==3.0.2
4551
mdurl==0.1.2
52+
multitasking==0.0.11
4653
narwhals==1.32.0
54+
newspaper4k==0.9.3.1
55+
nltk==3.9.1
4756
numpy==2.2.4
4857
openai==1.68.2
4958
packaging==24.2
5059
pandas==2.2.3
60+
peewee==3.17.9
5161
pgvector==0.4.0
5262
pillow==11.1.0
63+
platformdirs==4.3.7
5364
pluggy==1.5.0
5465
primp==0.14.0
5566
protobuf==5.29.4
5667
psycopg==3.2.6
5768
psycopg-binary==3.2.6
5869
pyarrow==19.0.1
70+
pycountry==24.6.1
5971
pydantic==2.10.6
6072
pydantic-core==2.27.2
6173
pydantic-settings==2.8.1
@@ -71,10 +83,12 @@ pyyaml==6.0.2
7183
referencing==0.36.2
7284
regex==2024.11.6
7385
requests==2.32.3
86+
requests-file==2.1.0
7487
rich==13.9.4
7588
rich-toolkit==0.13.2
7689
rpds-py==0.23.1
7790
s3transfer==0.11.4
91+
sgmllib3k==1.0.0
7892
shellingham==1.5.4
7993
six==1.17.0
8094
smmap==5.0.2
@@ -85,6 +99,7 @@ starlette==0.46.1
8599
streamlit==1.43.2
86100
tenacity==9.0.0
87101
tiktoken==0.9.0
102+
tldextract==5.2.0
88103
toml==0.10.2
89104
tomli==2.2.1
90105
tornado==6.4.2
@@ -97,3 +112,4 @@ uvicorn==0.34.0
97112
uvloop==0.21.0
98113
watchfiles==1.0.4
99114
websockets==15.0.1
115+
yfinance==0.2.55

teams/__init__.py

Whitespace-only changes.

teams/finance_researcher_team.py

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
from textwrap import dedent
2+
3+
from agno.agent import Agent
4+
from agno.models.openai import OpenAIChat
5+
from agno.storage.postgres import PostgresStorage
6+
from agno.team.team import Team
7+
from agno.tools.duckduckgo import DuckDuckGoTools
8+
from agno.tools.yfinance import YFinanceTools
9+
10+
from db.session import db_url
11+
from teams.settings import team_settings
12+
13+
finance_agent = Agent(
14+
name="Finance Agent",
15+
role="Analyze financial data",
16+
agent_id="finance-agent",
17+
model=OpenAIChat(
18+
id=team_settings.gpt_4,
19+
max_tokens=team_settings.default_max_completion_tokens,
20+
temperature=team_settings.default_temperature,
21+
),
22+
tools=[YFinanceTools(enable_all=True, cache_results=True)],
23+
instructions=dedent("""\
24+
You are a seasoned Wall Street analyst with deep expertise in market analysis! 📊
25+
26+
Follow these steps for comprehensive financial analysis:
27+
1. Market Overview
28+
- Latest stock price
29+
- 52-week high and low
30+
2. Financial Deep Dive
31+
- Key metrics (P/E, Market Cap, EPS)
32+
3. Professional Insights
33+
- Analyst recommendations breakdown
34+
- Recent rating changes
35+
36+
4. Market Context
37+
- Industry trends and positioning
38+
- Competitive analysis
39+
- Market sentiment indicators
40+
41+
Your reporting style:
42+
- Begin with an executive summary
43+
- Use tables for data presentation
44+
- Include clear section headers
45+
- Add emoji indicators for trends (📈 📉)
46+
- Highlight key insights with bullet points
47+
- Compare metrics to industry averages
48+
- Include technical term explanations
49+
- End with a forward-looking analysis
50+
51+
Risk Disclosure:
52+
- Always highlight potential risk factors
53+
- Note market uncertainties
54+
- Mention relevant regulatory concerns
55+
"""),
56+
storage=PostgresStorage(table_name="finance_agent", db_url=db_url, auto_upgrade_schema=True),
57+
add_history_to_messages=True,
58+
num_history_responses=5,
59+
add_datetime_to_instructions=True,
60+
markdown=True,
61+
)
62+
63+
web_agent = Agent(
64+
name="Web Agent",
65+
role="Search the web for information",
66+
model=OpenAIChat(id=team_settings.gpt_4),
67+
tools=[DuckDuckGoTools(cache_results=True)],
68+
agent_id="web-agent",
69+
instructions=[
70+
"You are an experienced web researcher and news analyst!",
71+
],
72+
show_tool_calls=True,
73+
markdown=True,
74+
storage=PostgresStorage(table_name="web_agent", db_url=db_url, auto_upgrade_schema=True),
75+
)
76+
77+
78+
def get_finance_researcher_team(debug_mode: bool = False):
79+
return Team(
80+
name="Finance Researcher Team",
81+
team_id="financial-researcher-team",
82+
mode="route",
83+
members=[web_agent, finance_agent],
84+
instructions=[
85+
"You are a team of finance researchers!",
86+
],
87+
description="You are a team of finance researchers!",
88+
model=OpenAIChat(id=team_settings.gpt_4),
89+
success_criteria="A good financial research report.",
90+
enable_agentic_context=True,
91+
expected_output="A good financial research report.",
92+
storage=PostgresStorage(
93+
table_name="finance_researcher_team",
94+
db_url=db_url,
95+
mode="team",
96+
auto_upgrade_schema=True,
97+
),
98+
debug_mode=debug_mode,
99+
)

teams/multi_language_team.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
from agno.agent import Agent
2+
from agno.models.openai import OpenAIChat
3+
from agno.storage.postgres import PostgresStorage
4+
from agno.team.team import Team
5+
6+
from db.session import db_url
7+
from teams.settings import team_settings
8+
9+
japanese_agent = Agent(
10+
name="Japanese Agent",
11+
agent_id="japanese-agent",
12+
role="You only answer in Japanese",
13+
model=OpenAIChat(id="gpt-4o"),
14+
)
15+
chinese_agent = Agent(
16+
name="Chinese Agent",
17+
agent_id="chinese-agent",
18+
role="You only answer in Chinese",
19+
model=OpenAIChat(id="gpt-4o"),
20+
)
21+
spanish_agent = Agent(
22+
name="Spanish Agent",
23+
agent_id="spanish-agent",
24+
role="You only answer in Spanish",
25+
model=OpenAIChat(id="gpt-4o"),
26+
)
27+
french_agent = Agent(
28+
name="French Agent",
29+
agent_id="french-agent",
30+
role="You only answer in French",
31+
model=OpenAIChat(id="gpt-4o"),
32+
)
33+
german_agent = Agent(
34+
name="German Agent",
35+
agent_id="german-agent",
36+
role="You only answer in German",
37+
model=OpenAIChat(id="gpt-4o"),
38+
)
39+
40+
41+
def get_multi_language_team(debug_mode: bool = False):
42+
return Team(
43+
name="Multi Language Team",
44+
mode="route",
45+
team_id="multi-language-team",
46+
model=OpenAIChat(id=team_settings.gpt_4),
47+
members=[
48+
spanish_agent,
49+
japanese_agent,
50+
french_agent,
51+
german_agent,
52+
chinese_agent,
53+
],
54+
description="You are a language router that directs questions to the appropriate language agent.",
55+
instructions=[
56+
"Identify the language of the user's question and direct it to the appropriate language agent.",
57+
"Let the language agent answer the question in the language of the user's question.",
58+
"The the user asks a question in English, respond directly in English with:",
59+
"If the user asks in a language that is not English or your don't have a member agent for that language, respond in English with:",
60+
"'I only answer in the following languages: English, Spanish, Japanese, Chinese, French and German. Please ask your question in one of these languages.'",
61+
"Always check the language of the user's input before routing to an agent.",
62+
"For unsupported languages like Italian, respond in English with the above message.",
63+
],
64+
markdown=True,
65+
show_tool_calls=True,
66+
show_members_responses=True,
67+
storage=PostgresStorage(
68+
table_name="multi_language_team",
69+
db_url=db_url,
70+
mode="team",
71+
auto_upgrade_schema=True,
72+
),
73+
debug_mode=debug_mode,
74+
)

teams/settings.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from pydantic_settings import BaseSettings
2+
3+
4+
class TeamSettings(BaseSettings):
5+
"""Team settings that can be set using environment variables.
6+
7+
Reference: https://pydantic-docs.helpmanual.io/usage/settings/
8+
"""
9+
10+
gpt_4_mini: str = "gpt-4o-mini"
11+
gpt_4: str = "gpt-4o"
12+
embedding_model: str = "text-embedding-3-small"
13+
default_max_completion_tokens: int = 16000
14+
default_temperature: float = 0
15+
16+
17+
# Create an TeamSettings object
18+
team_settings = TeamSettings()

workflows/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)