Skip to content

Commit e97ac8c

Browse files
authored
Merge branch 'main' into feat/messageDelta
2 parents 656a8cf + 7c46e70 commit e97ac8c

30 files changed

+2956
-873
lines changed

.github/actions/spelling/allow.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ AServer
99
AServers
1010
AService
1111
AStarlette
12+
AUser
13+
DSNs
1214
EUR
1315
GBP
16+
GVsb
1417
INR
1518
JPY
1619
JSONRPCt
1720
Llm
21+
POSTGRES
1822
RUF
1923
aconnect
2024
adk
2125
agentic
2226
aio
27+
aiomysql
2328
aproject
2429
autouse
2530
backticks
@@ -29,23 +34,34 @@ coc
2934
codegen
3035
coro
3136
datamodel
37+
drivername
3238
dunders
3339
euo
40+
excinfo
41+
fetchrow
42+
fetchval
3443
genai
3544
getkwargs
3645
gle
46+
initdb
3747
inmemory
48+
isready
3849
kwarg
3950
langgraph
4051
lifecycles
4152
linting
4253
lstrips
4354
mockurl
55+
notif
4456
oauthoidc
4557
oidc
4658
opensource
59+
otherurl
60+
postgres
61+
postgresql
4762
protoc
4863
pyi
64+
pypistats
4965
pyversions
5066
respx
5167
resub

.github/actions/spelling/expect.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/security.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Bandit
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
analyze:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
security-events: write
11+
actions: read
12+
contents: read
13+
steps:
14+
- name: Perform Bandit Analysis
15+
uses: PyCQA/bandit-action@v1
16+
with:
17+
severity: medium
18+
confidence: medium
19+
targets: "src/a2a"

.github/workflows/unit-tests.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ jobs:
99
test:
1010
name: Test with Python ${{ matrix.python-version }}
1111
runs-on: ubuntu-latest
12+
1213
if: github.repository == 'a2aproject/a2a-python'
14+
services:
15+
postgres:
16+
image: postgres:15-alpine
17+
env:
18+
POSTGRES_USER: postgres
19+
POSTGRES_PASSWORD: postgres
20+
POSTGRES_DB: a2a_test
21+
ports:
22+
- 5432:5432
23+
1324
strategy:
1425
matrix:
1526
python-version: ['3.10', '3.13']
@@ -20,13 +31,19 @@ jobs:
2031
uses: actions/setup-python@v5
2132
with:
2233
python-version: ${{ matrix.python-version }}
34+
- name: Set postgres for tests
35+
run: |
36+
sudo apt-get update && sudo apt-get install -y postgresql-client
37+
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d a2a_test -f ${{ github.workspace }}/docker/postgres/init.sql
38+
export POSTGRES_TEST_DSN="postgresql+asyncpg://postgres:postgres@localhost:5432/a2a_test"
39+
2340
- name: Install uv
2441
uses: astral-sh/setup-uv@v6
2542
- name: Add uv to PATH
2643
run: |
2744
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
2845
- name: Install dependencies
29-
run: uv sync --dev
46+
run: uv sync --dev --extra sql
3047
- name: Run tests and check coverage
3148
run: uv run pytest --cov=a2a --cov-report=xml --cov-fail-under=90
3249
- name: Show coverage summary in log

CONTRIBUTING.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
We'd love to accept your patches and contributions to this project.
44

5-
## Before you begin
6-
7-
### Review our community guidelines
8-
9-
This project follows
10-
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
11-
125
## Contribution process
136

147
### Code reviews
@@ -33,11 +26,3 @@ Here are some additional things to keep in mind during the process:
3326

3427
- **Test your changes.** Before you submit a pull request, make sure that your changes work as expected.
3528
- **Be patient.** It may take some time for your pull request to be reviewed and merged.
36-
37-
---
38-
39-
## For Google Employees
40-
41-
Complete the following steps to register your GitHub account and be added as a contributor to this repository.
42-
43-
1. Register your GitHub account at [go/GitHub](http://go/github).

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ When you're working within a uv project or a virtual environment managed by uv,
3333
uv add a2a-sdk
3434
```
3535

36+
To install with database support:
37+
38+
```bash
39+
# PostgreSQL support
40+
uv add "a2a-sdk[postgresql]"
41+
42+
# MySQL support
43+
uv add "a2a-sdk[mysql]"
44+
45+
# SQLite support
46+
uv add "a2a-sdk[sqlite]"
47+
48+
# All database drivers
49+
uv add "a2a-sdk[sql]"
50+
```
51+
3652
### Using `pip`
3753

3854
If you prefer to use pip, the standard Python package installer, you can install `a2a-sdk` as follows
@@ -41,6 +57,22 @@ If you prefer to use pip, the standard Python package installer, you can install
4157
pip install a2a-sdk
4258
```
4359

60+
To install with database support:
61+
62+
```bash
63+
# PostgreSQL support
64+
pip install "a2a-sdk[postgresql]"
65+
66+
# MySQL support
67+
pip install "a2a-sdk[mysql]"
68+
69+
# SQLite support
70+
pip install "a2a-sdk[sqlite]"
71+
72+
# All database drivers
73+
pip install "a2a-sdk[sql]"
74+
```
75+
4476
## Examples
4577

4678
### [Helloworld Example](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/helloworld)
@@ -60,7 +92,7 @@ pip install a2a-sdk
6092
uv run test_client.py
6193
```
6294

63-
3. You can validate your agent using the agent inspector. Follow the instructions at the [a2a-inspector](https://github.com/a2aproject/a2a-inspector) repo.
95+
3. You can validate your agent using the agent inspector. Follow the instructions at the [a2a-inspector](https://github.com/a2aproject/a2a-inspector) repo.
6496

6597
You can also find more Python samples [here](https://github.com/a2aproject/a2a-samples/tree/main/samples/python) and JavaScript samples [here](https://github.com/a2aproject/a2a-samples/tree/main/samples/js).
6698

docker/postgres/init.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Create a dedicated user for the application
2+
CREATE USER a2a WITH PASSWORD 'a2a_password';
3+
4+
-- Create the tasks database
5+
CREATE DATABASE a2a_tasks;
6+
7+
GRANT ALL PRIVILEGES ON DATABASE a2a_test TO a2a;
8+

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name = "a2a-sdk"
33
dynamic = ["version"]
44
description = "A2A Python SDK"
55
readme = "README.md"
6-
license = { file = "LICENSE" }
6+
license = "Apache-2.0"
77
authors = [{ name = "Google LLC", email = "[email protected]" }]
88
requires-python = ">=3.10"
9-
keywords = ["A2A", "A2A SDK", "A2A Protocol", "Agent2Agent"]
9+
keywords = ["A2A", "A2A SDK", "A2A Protocol", "Agent2Agent", "Agent 2 Agent"]
1010
dependencies = [
1111
"fastapi>=0.115.2",
1212
"httpx>=0.28.1",
@@ -36,6 +36,12 @@ classifiers = [
3636
"License :: OSI Approved :: Apache Software License",
3737
]
3838

39+
[project.optional-dependencies]
40+
postgresql = ["sqlalchemy[asyncio,postgresql-asyncpg]>=2.0.0"]
41+
mysql = ["sqlalchemy[asyncio,aiomysql]>=2.0.0"]
42+
sqlite = ["sqlalchemy[asyncio,aiosqlite]>=2.0.0"]
43+
sql = ["sqlalchemy[asyncio,postgresql-asyncpg,aiomysql,aiosqlite]>=2.0.0"]
44+
3945
[project.urls]
4046
homepage = "https://a2aproject.github.io/A2A/"
4147
repository = "https://github.com/a2aproject/a2a-python"

src/a2a/server/apps/jsonrpc/jsonrpc_app.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
A2ARequest,
2626
AgentCard,
2727
CancelTaskRequest,
28+
DeleteTaskPushNotificationConfigRequest,
2829
GetTaskPushNotificationConfigRequest,
2930
GetTaskRequest,
3031
InternalError,
@@ -33,6 +34,7 @@
3334
JSONRPCError,
3435
JSONRPCErrorResponse,
3536
JSONRPCResponse,
37+
ListTaskPushNotificationConfigRequest,
3638
SendMessageRequest,
3739
SendStreamingMessageRequest,
3840
SendStreamingMessageResponse,
@@ -297,12 +299,22 @@ async def _process_non_streaming_request(
297299
request_obj, context
298300
)
299301
case SetTaskPushNotificationConfigRequest():
300-
handler_result = await self.handler.set_push_notification(
302+
handler_result = await self.handler.set_push_notification_config(
301303
request_obj,
302304
context,
303305
)
304306
case GetTaskPushNotificationConfigRequest():
305-
handler_result = await self.handler.get_push_notification(
307+
handler_result = await self.handler.get_push_notification_config(
308+
request_obj,
309+
context,
310+
)
311+
case ListTaskPushNotificationConfigRequest():
312+
handler_result = await self.handler.list_push_notification_config(
313+
request_obj,
314+
context,
315+
)
316+
case DeleteTaskPushNotificationConfigRequest():
317+
handler_result = await self.handler.delete_push_notification_config(
306318
request_obj,
307319
context,
308320
)

0 commit comments

Comments
 (0)