Skip to content

Commit 35c3ea3

Browse files
committed
Merge branch 'main' of https://github.com/a2aproject/a2a-python into pr/darkhaniop/217
2 parents f93abd8 + ee48d68 commit 35c3ea3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5549
-1951
lines changed

.github/actions/spelling/allow.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ lifecycles
5353
linting
5454
Llm
5555
lstrips
56+
mikeas
5657
mockurl
5758
notif
5859
oauthoidc
@@ -77,5 +78,6 @@ sse
7778
tagwords
7879
taskupdate
7980
testuuid
81+
Tful
8082
typeerror
8183
vulnz

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
python-version: ${{ matrix.python-version }}
4747
- name: Set up test environment variables
48-
run: |
48+
run: |
4949
echo "POSTGRES_TEST_DSN=postgresql+asyncpg://a2a:a2a_password@localhost:5432/a2a_test" >> $GITHUB_ENV
5050
echo "MYSQL_TEST_DSN=mysql+aiomysql://a2a:a2a_password@localhost:3306/a2a_test" >> $GITHUB_ENV
5151
@@ -55,8 +55,8 @@ jobs:
5555
run: |
5656
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
5757
- name: Install dependencies
58-
run: uv sync --dev --extra sql --extra encryption --extra grpc
58+
run: uv sync --dev --extra sql --extra encryption --extra grpc --extra telemetry
5959
- name: Run tests and check coverage
60-
run: uv run pytest --cov=a2a --cov-report=xml --cov-fail-under=89
60+
run: uv run pytest --cov=a2a --cov-report term --cov-fail-under=89
6161
- name: Show coverage summary in log
6262
run: uv run coverage report

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"-s"
4848
],
4949
"console": "integratedTerminal",
50-
"justMyCode": true
50+
"justMyCode": true,
51+
"python": "${workspaceFolder}/.venv/bin/python",
5152
}
5253
]
53-
}
54+
}

Gemini.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
**A2A specification:** https://a2a-protocol.org/latest/specification/
2+
3+
## Project frameworks
4+
- uv as package manager
5+
6+
## How to run all tests
7+
1. If dependencies are not installed install them using following command
8+
```
9+
uv sync --all-extras
10+
```
11+
12+
2. Run tests
13+
```
14+
uv run pytest
15+
```
16+
17+
## Other instructions
18+
1. Whenever writing python code, write types as well.
19+
2. After making the changes run ruff to check and fix the formatting issues
20+
```
21+
uv run ruff check --fix
22+
```
23+
3. Run mypy type checkers to check for type errors
24+
```
25+
uv run mypy
26+
```
27+
4. Run the unit tests to make sure that none of the unit tests are broken.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ To install with gRPC support:
4545
uv add "a2a-sdk[grpc]"
4646
```
4747

48+
To install with OpenTelemetry tracing support:
49+
50+
```bash
51+
uv add "a2a-sdk[telemetry]"
52+
```
53+
4854
To install with database support:
4955

5056
```bash
@@ -81,6 +87,12 @@ To install with gRPC support:
8187
pip install "a2a-sdk[grpc]"
8288
```
8389

90+
To install with OpenTelemetry tracing support:
91+
92+
```bash
93+
pip install "a2a-sdk[telemetry]"
94+
```
95+
8496
To install with database support:
8597

8698
```bash

error_handlers.py

Whitespace-only changes.

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ keywords = ["A2A", "A2A SDK", "A2A Protocol", "Agent2Agent", "Agent 2 Agent"]
1010
dependencies = [
1111
"httpx>=0.28.1",
1212
"httpx-sse>=0.4.0",
13-
"opentelemetry-api>=1.33.0",
14-
"opentelemetry-sdk>=1.33.0",
1513
"pydantic>=2.11.3",
14+
"protobuf==5.29.5",
15+
"google-api-core>=1.26.0",
1616
]
1717

1818
classifiers = [
@@ -29,13 +29,14 @@ classifiers = [
2929
]
3030

3131
[project.optional-dependencies]
32-
http-server = ["fastapi>=0.115.2", "sse-starlette", "starlette"]
32+
http-server = ["fastapi", "sse-starlette", "starlette"]
3333
postgresql = ["sqlalchemy[asyncio,postgresql-asyncpg]>=2.0.0"]
3434
mysql = ["sqlalchemy[asyncio,aiomysql]>=2.0.0"]
3535
sqlite = ["sqlalchemy[asyncio,aiosqlite]>=2.0.0"]
3636
sql = ["sqlalchemy[asyncio,postgresql-asyncpg,aiomysql,aiosqlite]>=2.0.0"]
3737
encryption = ["cryptography>=43.0.0"]
38-
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0", "protobuf==5.29.5", "google-api-core>=1.26.0"]
38+
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0"]
39+
telemetry = ["opentelemetry-api>=1.33.0", "opentelemetry-sdk>=1.33.0"]
3940

4041
[project.urls]
4142
homepage = "https://a2a-protocol.org/"
@@ -92,6 +93,7 @@ dev = [
9293
"pyupgrade",
9394
"autoflake",
9495
"no_implicit_optional",
96+
"trio",
9597
]
9698

9799
[[tool.uv.index]]

src/a2a/client/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,24 @@
77
CredentialService,
88
InMemoryContextCredentialStore,
99
)
10-
from a2a.client.client import A2ACardResolver, A2AClient
10+
from a2a.client.card_resolver import A2ACardResolver
11+
from a2a.client.client import Client, ClientConfig, ClientEvent, Consumer
12+
from a2a.client.client_factory import ClientFactory, minimal_agent_card
1113
from a2a.client.errors import (
1214
A2AClientError,
1315
A2AClientHTTPError,
1416
A2AClientJSONError,
1517
A2AClientTimeoutError,
1618
)
1719
from a2a.client.helpers import create_text_message_object
20+
from a2a.client.legacy import A2AClient
1821
from a2a.client.middleware import ClientCallContext, ClientCallInterceptor
1922

2023

2124
logger = logging.getLogger(__name__)
2225

2326
try:
24-
from a2a.client.grpc_client import A2AGrpcClient # type: ignore
27+
from a2a.client.legacy_grpc import A2AGrpcClient # type: ignore
2528
except ImportError as e:
2629
_original_error = e
2730
logger.debug(
@@ -48,9 +51,15 @@ def __init__(self, *args, **kwargs):
4851
'A2AClientTimeoutError',
4952
'A2AGrpcClient',
5053
'AuthInterceptor',
54+
'Client',
5155
'ClientCallContext',
5256
'ClientCallInterceptor',
57+
'ClientConfig',
58+
'ClientEvent',
59+
'ClientFactory',
60+
'Consumer',
5361
'CredentialService',
5462
'InMemoryContextCredentialStore',
5563
'create_text_message_object',
64+
'minimal_agent_card',
5665
]

0 commit comments

Comments
 (0)