Skip to content

Commit 484de97

Browse files
committed
v2.5.0a11
1 parent cf2a52b commit 484de97

25 files changed

+183
-197
lines changed

.github/workflows/validate.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ jobs:
2626
cache: "pip"
2727
- name: Install dependencies
2828
run: |
29-
python -m pip install -U \
30-
pip setuptools wheel \
31-
mypy ruff
29+
python -m pip install -U uv \
3230
pip install --no-deps -r requirements.txt
3331
- name: Format with ruff
3432
run: |
@@ -39,3 +37,6 @@ jobs:
3937
- name: Type-check with mypy
4038
run: |
4139
mypy .
40+
# - name: Test with pytest
41+
# run: |
42+
# pytest .

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM phidata/python:3.11.5
1+
FROM phidata/python:3.12
22

33
ARG USER=app
44
ARG APP_DIR=${USER_LOCAL_DIR}/${USER}
@@ -12,16 +12,15 @@ RUN groupadd -g 61000 ${USER} \
1212

1313
WORKDIR ${APP_DIR}
1414

15-
# Update pip
16-
RUN pip install --upgrade pip
17-
# Copy pinned requirements
18-
COPY requirements.txt .
19-
# Install pinned requirements
20-
RUN pip install -r requirements.txt
15+
# Copy requirements and install
16+
COPY requirements.txt pyproject.toml ./
17+
RUN --mount=type=cache,target=/root/.cache/uv \
18+
uv pip sync requirements.txt --system
2119

2220
# Copy project files
2321
COPY . .
2422

2523
COPY scripts /scripts
24+
USER ${USER}
2625
ENTRYPOINT ["/scripts/entrypoint.sh"]
2726
CMD ["chill"]

agents/calculator.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from typing import Optional
2+
3+
from phi.agent import Agent
4+
from phi.model.openai import OpenAIChat
5+
from phi.tools.calculator import Calculator
6+
7+
from agents.settings import agent_settings
8+
9+
10+
def get_calculator_agent(
11+
user_id: Optional[str] = None,
12+
session_id: Optional[str] = None,
13+
debug_mode: bool = False,
14+
) -> Agent:
15+
return Agent(
16+
name="Calculator Agent",
17+
agent_id="calculator-agent",
18+
session_id=session_id,
19+
user_id=user_id,
20+
model=OpenAIChat(
21+
model=agent_settings.gpt_4,
22+
max_tokens=agent_settings.default_max_completion_tokens,
23+
temperature=agent_settings.default_temperature,
24+
),
25+
instructions=["Use the calculator tool for comparisons."],
26+
tools=[Calculator(enable_all=True)],
27+
markdown=True,
28+
show_tool_calls=True,
29+
# Enable monitoring on phidata.app
30+
monitoring=True,
31+
debug_mode=debug_mode,
32+
)
File renamed without changes.

agents/test/finance_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from agents.finance_agent import get_finance_agent
1+
from agents.finance import get_finance_agent
22

33
finance_agent = get_finance_agent()
44

api/routes/playground.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from os import getenv
22
from phi.playground import Playground
33

4-
from agents.finance_agent import get_finance_agent
4+
from agents.finance import get_finance_agent
55

66
######################################################
77
## Router for the agent playground

pyproject.toml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
[project]
22
name = "demo-agents"
33
version = "0.1.0"
4-
requires-python = ">3.7"
4+
requires-python = ">=3.9"
55
readme = "README.md"
66
authors = [{ name = "Phidata Team", email = "[email protected]" }]
77

88
dependencies = [
9-
# Api server Libraries
10-
"fastapi",
11-
"typer",
12-
"uvicorn",
13-
# Database Libraries
149
"alembic",
10+
"beautifulsoup4",
11+
"duckdb",
12+
"exa_py",
13+
"fastapi[standard]",
14+
"mypy",
15+
"openai",
1516
"pgvector",
17+
"phidata[aws]==2.5.0a11",
1618
"psycopg[binary]",
17-
"sqlalchemy",
18-
# Project libraries
19-
"openai",
2019
"pypdf",
21-
"exa_py",
22-
"yfinance",
23-
"duckdb",
24-
"tiktoken",
25-
"beautifulsoup4",
26-
"types-beautifulsoup4",
27-
# Type checking
28-
"mypy",
29-
# Testing
3020
"pytest",
31-
# Linting and Formatting
3221
"ruff",
33-
# phidata
34-
"phidata[aws]==2.5.0a9"
22+
"sqlalchemy",
23+
"tiktoken",
24+
"typer",
25+
"types-beautifulsoup4",
26+
"yfinance",
3527
]
3628

3729
[build-system]
@@ -61,3 +53,9 @@ exclude = ["aienv*", ".venv*"]
6153
[[tool.mypy.overrides]]
6254
module = ["pgvector.*", "setuptools.*"]
6355
ignore_missing_imports = true
56+
57+
[tool.uv.pip]
58+
no-annotate = true
59+
60+
[tool.pytest.ini_options]
61+
log_cli = true

requirements.txt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
#
2-
# This file is autogenerated by pip-compile with Python 3.9
3-
# by the following command:
4-
#
5-
# ./scripts/upgrade.sh all
6-
#
1+
# This file was autogenerated by uv via the following command:
2+
# ./scripts/generate_requirements.sh
73
alembic==1.13.3
84
annotated-types==0.7.0
95
anyio==4.6.0
106
beautifulsoup4==4.12.3
11-
boto3==1.35.35
12-
botocore==1.35.35
7+
boto3==1.35.37
8+
botocore==1.35.37
139
certifi==2024.8.30
14-
charset-normalizer==3.3.2
10+
charset-normalizer==3.4.0
1511
click==8.1.7
1612
distro==1.9.0
13+
dnspython==2.7.0
1714
docker==7.1.0
1815
duckdb==1.1.1
16+
email-validator==2.2.0
1917
exa-py==1.4.0
20-
exceptiongroup==1.2.2
2118
fastapi==0.115.0
19+
fastapi-cli==0.0.5
2220
frozendict==2.4.5
2321
gitdb==4.0.11
2422
gitpython==3.1.43
2523
h11==0.14.0
2624
html5lib==1.1
2725
httpcore==1.0.6
26+
httptools==0.6.1
2827
httpx==0.27.2
2928
idna==3.10
3029
iniconfig==2.0.0
30+
jinja2==3.1.4
3131
jiter==0.6.1
3232
jmespath==1.0.1
3333
lxml==5.3.0
3434
mako==1.3.5
3535
markdown-it-py==3.0.0
36-
markupsafe==3.0.0
36+
markupsafe==3.0.1
3737
mdurl==0.1.2
3838
multitasking==0.0.11
3939
mypy==1.11.2
4040
mypy-extensions==1.0.0
41-
numpy==2.0.2
42-
openai==1.51.1
41+
numpy==2.1.2
42+
openai==1.51.2
4343
packaging==24.1
4444
pandas==2.2.3
4545
peewee==3.17.6
4646
pgvector==0.3.5
47-
phidata[aws]==2.5.0a9
47+
phidata==2.5.0a11
4848
platformdirs==4.3.6
4949
pluggy==1.5.0
50-
psycopg[binary]==3.1.18
51-
psycopg-binary==3.1.18
50+
psycopg==3.1.19
51+
psycopg-binary==3.1.19
5252
pydantic==2.9.2
5353
pydantic-core==2.23.4
5454
pydantic-settings==2.5.2
@@ -57,13 +57,14 @@ pypdf==5.0.1
5757
pytest==8.3.3
5858
python-dateutil==2.9.0.post0
5959
python-dotenv==1.0.1
60+
python-multipart==0.0.12
6061
pytz==2024.2
6162
pyyaml==6.0.2
6263
regex==2024.9.11
6364
requests==2.32.3
6465
rich==13.9.2
6566
ruff==0.6.9
66-
s3transfer==0.10.2
67+
s3transfer==0.10.3
6768
shellingham==1.5.4
6869
six==1.16.0
6970
smmap==5.0.1
@@ -79,7 +80,10 @@ types-beautifulsoup4==4.12.0.20240907
7980
types-html5lib==1.1.11.20240806
8081
typing-extensions==4.12.2
8182
tzdata==2024.2
82-
urllib3==1.26.20
83-
uvicorn==0.31.0
83+
urllib3==2.2.3
84+
uvicorn==0.31.1
85+
uvloop==0.20.0
86+
watchfiles==0.24.0
8487
webencodings==0.5.1
88+
websockets==13.1
8589
yfinance==0.2.44

scripts/_utils.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/bin/bash
22

33
############################################################################
4-
#
54
# Helper functions to import in other scripts
6-
#
75
############################################################################
86

97
print_horizontal_line() {

scripts/auth_ecr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
set -e
44

55
# Authenticate with ecr
6-
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 497891874516.dkr.ecr.us-east-1.amazonaws.com
6+
aws ecr get-login-password --region [AWS_REGION] | docker login --username AWS --password-stdin [AWS_ACCOUNT_ID].dkr.ecr.[AWS_REGION].amazonaws.com

0 commit comments

Comments
 (0)