Skip to content

Commit 5584d97

Browse files
committed
refactor: Update to Protocol V1 and fix all tests
1 parent cd8946b commit 5584d97

48 files changed

Lines changed: 759 additions & 790 deletions

Some content is hidden

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

.github/actions/spelling/allow.txt

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,29 @@
1+
a2a
12
A2A
23
A2AFastAPI
34
AAgent
4-
ACMRTUXB
55
ACard
66
AClient
7+
ACMRTUXB
8+
aconnect
9+
adk
710
AError
811
AException
912
AFast
13+
agentic
1014
AGrpc
15+
aio
16+
aiomysql
17+
alg
18+
amannn
19+
aproject
1120
ARequest
1221
ARun
1322
AServer
1423
AServers
1524
AService
1625
AStarlette
1726
AUser
18-
DSNs
19-
ES256
20-
EUR
21-
FastAPI
22-
GBP
23-
GVsb
24-
HS256
25-
HS384
26-
INR
27-
JOSE
28-
JPY
29-
JSONRPC
30-
JSONRPCt
31-
JWS
32-
Llm
33-
OpenAPI
34-
POSTGRES
35-
Protobuf
36-
RS256
37-
RUF
38-
SECP256R1
39-
SLF
40-
Starlette
41-
Tful
42-
a2a
43-
aconnect
44-
adk
45-
agentic
46-
aio
47-
aiomysql
48-
alg
49-
amannn
50-
aproject
5127
autouse
5228
backticks
5329
base64url
@@ -60,46 +36,64 @@ coro
6036
datamodel
6137
deepwiki
6238
drivername
39+
DSNs
6340
dunders
41+
ES256
6442
euo
43+
EUR
6544
excinfo
45+
FastAPI
6646
fernet
6747
fetchrow
6848
fetchval
49+
GBP
6950
genai
7051
getkwargs
7152
gle
53+
GVsb
7254
hazmat
55+
HS256
56+
HS384
7357
ietf
7458
importlib
7559
initdb
7660
inmemory
61+
INR
7762
isready
7863
jku
64+
JOSE
65+
JPY
66+
JSONRPC
67+
JSONRPCt
7968
jwk
8069
jwks
8170
jws
71+
JWS
8272
kid
8373
kwarg
8474
langgraph
8575
lifecycles
8676
linting
77+
Llm
8778
lstrips
8879
middleware
8980
mikeas
9081
mockurl
9182
notif
9283
oauthoidc
9384
oidc
85+
OpenAPI
9486
openapiv
9587
openapiv2
9688
opensource
9789
otherurl
9890
pb2
9991
postgres
92+
POSTGRES
10093
postgresql
10194
proto
10295
protobuf
96+
Protobuf
10397
protoc
10498
pydantic
10599
pyi
@@ -109,13 +103,19 @@ pyversions
109103
redef
110104
respx
111105
resub
106+
RS256
107+
RUF
108+
SECP256R1
109+
SLF
112110
socio
113111
sse
114112
starlette
113+
Starlette
115114
swagger
116115
tagwords
117116
taskupdate
118117
testuuid
118+
Tful
119119
tiangolo
120120
typ
121121
typeerror

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Lint Code Base
33
on:
44
pull_request:
5-
branches: [main]
5+
branches: [main, 1.0-a2a_proto_refactor]
66
permissions:
77
contents: read
88
jobs:

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Run Unit Tests
33
on:
44
pull_request:
5-
branches: [main]
5+
branches: [main, 1.0-a2a_proto_refactor]
66
permissions:
77
contents: read
88
jobs:
@@ -36,7 +36,7 @@ jobs:
3636
3737
strategy:
3838
matrix:
39-
python-version: ['3.10', '3.13']
39+
python-version: ["3.10", "3.13"]
4040
steps:
4141
- name: Checkout code
4242
uses: actions/checkout@v6

buf.gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: v2
33
inputs:
44
- git_repo: https://github.com/a2aproject/A2A.git
55
ref: main
6-
subdir: specification/grpc
6+
subdir: specification
77
managed:
88
enabled: true
99
# Python Generation

src/a2a/client/auth/interceptor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ async def intercept(
3131
# We check for truthiness to see if they are non-empty.
3232
if (
3333
agent_card is None
34-
or not agent_card.security
34+
or not agent_card.security_requirements
3535
or not agent_card.security_schemes
3636
):
3737
return request_payload, http_kwargs
3838

39-
for requirement in agent_card.security:
39+
for requirement in agent_card.security_requirements:
4040
for scheme_name in requirement.schemes:
4141
credential = await self._credential_service.get_credentials(
4242
scheme_name, context

src/a2a/client/base_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Message,
2020
SendMessageConfiguration,
2121
SendMessageRequest,
22-
SetTaskPushNotificationConfigRequest,
22+
CreateTaskPushNotificationConfigRequest,
2323
StreamResponse,
2424
SubscribeToTaskRequest,
2525
Task,
@@ -180,7 +180,7 @@ async def cancel_task(
180180

181181
async def set_task_callback(
182182
self,
183-
request: SetTaskPushNotificationConfigRequest,
183+
request: CreateTaskPushNotificationConfigRequest,
184184
*,
185185
context: ClientCallContext | None = None,
186186
extensions: list[str] | None = None,

src/a2a/client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
GetTaskRequest,
1717
Message,
1818
PushNotificationConfig,
19-
SetTaskPushNotificationConfigRequest,
19+
CreateTaskPushNotificationConfigRequest,
2020
StreamResponse,
2121
SubscribeToTaskRequest,
2222
Task,
@@ -147,7 +147,7 @@ async def cancel_task(
147147
@abstractmethod
148148
async def set_task_callback(
149149
self,
150-
request: SetTaskPushNotificationConfigRequest,
150+
request: CreateTaskPushNotificationConfigRequest,
151151
*,
152152
context: ClientCallContext | None = None,
153153
extensions: list[str] | None = None,

src/a2a/client/client_factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,5 +282,5 @@ def minimal_agent_card(
282282
skills=[],
283283
version='',
284284
name='',
285-
protocol_versions=['v1'],
286-
)
285+
286+
)

src/a2a/client/transports/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
GetTaskRequest,
1010
SendMessageRequest,
1111
SendMessageResponse,
12-
SetTaskPushNotificationConfigRequest,
12+
CreateTaskPushNotificationConfigRequest,
1313
StreamResponse,
1414
SubscribeToTaskRequest,
1515
Task,
@@ -65,7 +65,7 @@ async def cancel_task(
6565
@abstractmethod
6666
async def set_task_callback(
6767
self,
68-
request: SetTaskPushNotificationConfigRequest,
68+
request: CreateTaskPushNotificationConfigRequest,
6969
*,
7070
context: ClientCallContext | None = None,
7171
extensions: list[str] | None = None,

src/a2a/client/transports/grpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
from a2a.types.a2a_pb2 import (
2323
AgentCard,
2424
CancelTaskRequest,
25+
CreateTaskPushNotificationConfigRequest,
2526
GetTaskPushNotificationConfigRequest,
2627
GetTaskRequest,
2728
SendMessageRequest,
2829
SendMessageResponse,
29-
SetTaskPushNotificationConfigRequest,
3030
StreamResponse,
3131
SubscribeToTaskRequest,
3232
Task,
@@ -158,13 +158,13 @@ async def cancel_task(
158158

159159
async def set_task_callback(
160160
self,
161-
request: SetTaskPushNotificationConfigRequest,
161+
request: CreateTaskPushNotificationConfigRequest,
162162
*,
163163
context: ClientCallContext | None = None,
164164
extensions: list[str] | None = None,
165165
) -> TaskPushNotificationConfig:
166166
"""Sets or updates the push notification configuration for a specific task."""
167-
return await self.stub.SetTaskPushNotificationConfig(
167+
return await self.stub.CreateTaskPushNotificationConfig(
168168
request,
169169
metadata=self._get_grpc_metadata(extensions),
170170
)

0 commit comments

Comments
 (0)