Skip to content

Commit 84229c9

Browse files
authored
Merge branch 'main' into md-agentcards
2 parents 905637f + ee48d68 commit 84229c9

Some content is hidden

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

50 files changed

+6412
-2819
lines changed

.github/actions/spelling/allow.txt

Lines changed: 3 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
@@ -67,6 +68,7 @@ pyi
6768
pypistats
6869
pyupgrade
6970
pyversions
71+
redef
7072
respx
7173
resub
7274
RUF
@@ -76,5 +78,6 @@ sse
7678
tagwords
7779
taskupdate
7880
testuuid
81+
Tful
7982
typeerror
8083
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
@@ -39,6 +39,12 @@ To install with gRPC support:
3939
uv add "a2a-sdk[grpc]"
4040
```
4141

42+
To install with OpenTelemetry tracing support:
43+
44+
```bash
45+
uv add "a2a-sdk[telemetry]"
46+
```
47+
4248
To install with database support:
4349

4450
```bash
@@ -69,6 +75,12 @@ To install with gRPC support:
6975
pip install "a2a-sdk[grpc]"
7076
```
7177

78+
To install with OpenTelemetry tracing support:
79+
80+
```bash
81+
pip install "a2a-sdk[telemetry]"
82+
```
83+
7284
To install with database support:
7385

7486
```bash

error_handlers.py

Whitespace-only changes.

pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ authors = [{ name = "Google LLC", email = "[email protected]" }]
88
requires-python = ">=3.10"
99
keywords = ["A2A", "A2A SDK", "A2A Protocol", "Agent2Agent", "Agent 2 Agent"]
1010
dependencies = [
11-
"fastapi>=0.115.2",
11+
"fastapi>=0.116.1",
1212
"httpx>=0.28.1",
1313
"httpx-sse>=0.4.0",
14-
"opentelemetry-api>=1.33.0",
15-
"opentelemetry-sdk>=1.33.0",
1614
"pydantic>=2.11.3",
1715
"sse-starlette",
18-
"starlette"
16+
"starlette",
17+
"protobuf==5.29.5",
18+
"google-api-core>=1.26.0",
1919
]
2020

2121
classifiers = [
@@ -37,7 +37,8 @@ mysql = ["sqlalchemy[asyncio,aiomysql]>=2.0.0"]
3737
sqlite = ["sqlalchemy[asyncio,aiosqlite]>=2.0.0"]
3838
sql = ["sqlalchemy[asyncio,postgresql-asyncpg,aiomysql,aiosqlite]>=2.0.0"]
3939
encryption = ["cryptography>=43.0.0"]
40-
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0", "protobuf==5.29.5", "google-api-core>=1.26.0"]
40+
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0"]
41+
telemetry = ["opentelemetry-api>=1.33.0", "opentelemetry-sdk>=1.33.0"]
4142

4243
[project.urls]
4344
homepage = "https://a2a-protocol.org/"
@@ -91,6 +92,7 @@ dev = [
9192
"pyupgrade",
9293
"autoflake",
9394
"no_implicit_optional",
95+
"trio",
9496
]
9597

9698
[[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)