Skip to content

Commit eead9d7

Browse files
ci: Change commit message for update PRs and add formatting (#321)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent e229576 commit eead9d7

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
@@ -35,4 +35,7 @@ uv run datamodel-codegen \
3535
--use-subclass-enum \
3636
--base-class a2a._base.A2ABaseModel
3737

38+
echo "Formatting generated file with ruff..."
39+
uv run ruff format "$GENERATED_FILE"
40+
3841
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
"""
@@ -1271,7 +1273,9 @@ class Artifact(A2ABaseModel):
12711273

12721274

12731275
class DeleteTaskPushNotificationConfigResponse(
1274-
RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse]
1276+
RootModel[
1277+
JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse
1278+
]
12751279
):
12761280
root: JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse
12771281
"""
@@ -1280,7 +1284,9 @@ class DeleteTaskPushNotificationConfigResponse(
12801284

12811285

12821286
class GetTaskPushNotificationConfigResponse(
1283-
RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse]
1287+
RootModel[
1288+
JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse
1289+
]
12841290
):
12851291
root: JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse
12861292
"""
@@ -1289,7 +1295,9 @@ class GetTaskPushNotificationConfigResponse(
12891295

12901296

12911297
class ListTaskPushNotificationConfigResponse(
1292-
RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse]
1298+
RootModel[
1299+
JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse
1300+
]
12931301
):
12941302
root: JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse
12951303
"""
@@ -1444,7 +1452,9 @@ class SendStreamingMessageRequest(A2ABaseModel):
14441452

14451453

14461454
class SetTaskPushNotificationConfigResponse(
1447-
RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse]
1455+
RootModel[
1456+
JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse
1457+
]
14481458
):
14491459
root: JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse
14501460
"""
@@ -1497,7 +1507,9 @@ class TaskStatus(A2ABaseModel):
14971507
Additional status updates for client
14981508
"""
14991509
state: TaskState
1500-
timestamp: str | None = Field(default=None, examples=['2023-10-27T10:00:00Z'])
1510+
timestamp: str | None = Field(
1511+
default=None, examples=['2023-10-27T10:00:00Z']
1512+
)
15011513
"""
15021514
ISO 8601 datetime string when the status was recorded.
15031515
"""
@@ -1757,7 +1769,9 @@ class SendStreamingMessageSuccessResponse(A2ABaseModel):
17571769
"""
17581770

17591771

1760-
class CancelTaskResponse(RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]):
1772+
class CancelTaskResponse(
1773+
RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]
1774+
):
17611775
root: JSONRPCErrorResponse | CancelTaskSuccessResponse
17621776
"""
17631777
JSON-RPC response for the 'tasks/cancel' method.
@@ -1800,7 +1814,9 @@ class JSONRPCResponse(
18001814
"""
18011815

18021816

1803-
class SendMessageResponse(RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]):
1817+
class SendMessageResponse(
1818+
RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]
1819+
):
18041820
root: JSONRPCErrorResponse | SendMessageSuccessResponse
18051821
"""
18061822
JSON-RPC response model for the 'message/send' method.

0 commit comments

Comments
 (0)