Skip to content

Commit 1c968db

Browse files
authored
Merge branch 'main' into snake-case-field
2 parents 4835603 + eead9d7 commit 1c968db

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

.github/workflows/update-a2a-types.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
token: ${{ secrets.A2A_BOT_PAT }}
4848
committer: a2a-bot <a2a-bot@google.com>
4949
author: a2a-bot <a2a-bot@google.com>
50-
commit-message: 'feat: Update A2A types from specification 🤖'
51-
title: 'feat: Update A2A types from specification 🤖'
50+
commit-message: 'feat(spec): Update A2A types from specification 🤖'
51+
title: 'feat(spec): Update A2A types from specification 🤖'
5252
body: |
5353
This PR updates `src/a2a/types.py` based on the latest `specification/json/a2a.json` from [a2aproject/A2A](https://github.com/a2aproject/A2A/commit/${{ github.event.client_payload.sha }}).
5454
branch: auto-update-a2a-types-${{ github.event.client_payload.sha }}

.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ inline-quotes = "single"
143143

144144
[format]
145145
exclude = [
146-
"types.py",
147146
"src/a2a/grpc/**",
148147
]
149148
docstring-code-format = true

scripts/generate_types.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ uv run datamodel-codegen \
3636
--base-class a2a._base.A2ABaseModel \
3737
--snake-case-field
3838

39+
echo "Formatting generated file with ruff..."
40+
uv run ruff format "$GENERATED_FILE"
41+
3942
echo "Codegen finished successfully."

src/a2a/types.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ class AgentSkill(A2ABaseModel):
133133
"""
134134
Supported media types for output.
135135
"""
136-
tags: list[str] = Field(..., examples=[['cooking', 'customer support', 'billing']])
136+
tags: list[str] = Field(
137+
..., examples=[['cooking', 'customer support', 'billing']]
138+
)
137139
"""
138140
Set of tagwords describing classes of capabilities for this specific skill.
139141
"""
@@ -1285,7 +1287,9 @@ class Artifact(A2ABaseModel):
12851287

12861288

12871289
class DeleteTaskPushNotificationConfigResponse(
1288-
RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse]
1290+
RootModel[
1291+
JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse
1292+
]
12891293
):
12901294
root: JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse
12911295
"""
@@ -1294,7 +1298,9 @@ class DeleteTaskPushNotificationConfigResponse(
12941298

12951299

12961300
class GetTaskPushNotificationConfigResponse(
1297-
RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse]
1301+
RootModel[
1302+
JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse
1303+
]
12981304
):
12991305
root: JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse
13001306
"""
@@ -1303,7 +1309,9 @@ class GetTaskPushNotificationConfigResponse(
13031309

13041310

13051311
class ListTaskPushNotificationConfigResponse(
1306-
RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse]
1312+
RootModel[
1313+
JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse
1314+
]
13071315
):
13081316
root: JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse
13091317
"""
@@ -1458,7 +1466,9 @@ class SendStreamingMessageRequest(A2ABaseModel):
14581466

14591467

14601468
class SetTaskPushNotificationConfigResponse(
1461-
RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse]
1469+
RootModel[
1470+
JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse
1471+
]
14621472
):
14631473
root: JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse
14641474
"""
@@ -1511,7 +1521,9 @@ class TaskStatus(A2ABaseModel):
15111521
Additional status updates for client
15121522
"""
15131523
state: TaskState
1514-
timestamp: str | None = Field(default=None, examples=['2023-10-27T10:00:00Z'])
1524+
timestamp: str | None = Field(
1525+
default=None, examples=['2023-10-27T10:00:00Z']
1526+
)
15151527
"""
15161528
ISO 8601 datetime string when the status was recorded.
15171529
"""
@@ -1777,7 +1789,9 @@ class SendStreamingMessageSuccessResponse(A2ABaseModel):
17771789
"""
17781790

17791791

1780-
class CancelTaskResponse(RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]):
1792+
class CancelTaskResponse(
1793+
RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]
1794+
):
17811795
root: JSONRPCErrorResponse | CancelTaskSuccessResponse
17821796
"""
17831797
JSON-RPC response for the 'tasks/cancel' method.
@@ -1820,7 +1834,9 @@ class JSONRPCResponse(
18201834
"""
18211835

18221836

1823-
class SendMessageResponse(RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]):
1837+
class SendMessageResponse(
1838+
RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]
1839+
):
18241840
root: JSONRPCErrorResponse | SendMessageSuccessResponse
18251841
"""
18261842
JSON-RPC response model for the 'message/send' method.

0 commit comments

Comments
 (0)