Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/update-a2a-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
token: ${{ secrets.A2A_BOT_PAT }}
committer: a2a-bot <a2a-bot@google.com>
author: a2a-bot <a2a-bot@google.com>
commit-message: 'feat: Update A2A types from specification 🤖'
title: 'feat: Update A2A types from specification 🤖'
commit-message: 'feat(spec): Update A2A types from specification 🤖'
title: 'feat(spec): Update A2A types from specification 🤖'
body: |
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 }}).
branch: auto-update-a2a-types-${{ github.event.client_payload.sha }}
Expand Down
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ inline-quotes = "single"

[format]
exclude = [
"types.py",
"src/a2a/grpc/**",
]
docstring-code-format = true
Expand Down
3 changes: 3 additions & 0 deletions scripts/generate_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ uv run datamodel-codegen \
--use-subclass-enum \
--base-class a2a._base.A2ABaseModel

echo "Formatting generated file with ruff..."
uv run ruff format "$GENERATED_FILE"
Comment thread
holtskinner marked this conversation as resolved.

echo "Codegen finished successfully."
32 changes: 24 additions & 8 deletions src/a2a/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ class AgentSkill(A2ABaseModel):
"""
Supported media types for output.
"""
tags: list[str] = Field(..., examples=[['cooking', 'customer support', 'billing']])
tags: list[str] = Field(
..., examples=[['cooking', 'customer support', 'billing']]
)
"""
Set of tagwords describing classes of capabilities for this specific skill.
"""
Expand Down Expand Up @@ -1271,7 +1273,9 @@ class Artifact(A2ABaseModel):


class DeleteTaskPushNotificationConfigResponse(
RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse]
RootModel[
JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse
]
):
root: JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse
"""
Expand All @@ -1280,7 +1284,9 @@ class DeleteTaskPushNotificationConfigResponse(


class GetTaskPushNotificationConfigResponse(
RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse]
RootModel[
JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse
]
):
root: JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse
"""
Expand All @@ -1289,7 +1295,9 @@ class GetTaskPushNotificationConfigResponse(


class ListTaskPushNotificationConfigResponse(
RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse]
RootModel[
JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse
]
):
root: JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse
"""
Expand Down Expand Up @@ -1444,7 +1452,9 @@ class SendStreamingMessageRequest(A2ABaseModel):


class SetTaskPushNotificationConfigResponse(
RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse]
RootModel[
JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse
]
):
root: JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse
"""
Expand Down Expand Up @@ -1497,7 +1507,9 @@ class TaskStatus(A2ABaseModel):
Additional status updates for client
"""
state: TaskState
timestamp: str | None = Field(default=None, examples=['2023-10-27T10:00:00Z'])
timestamp: str | None = Field(
default=None, examples=['2023-10-27T10:00:00Z']
)
"""
ISO 8601 datetime string when the status was recorded.
"""
Expand Down Expand Up @@ -1757,7 +1769,9 @@ class SendStreamingMessageSuccessResponse(A2ABaseModel):
"""


class CancelTaskResponse(RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]):
class CancelTaskResponse(
RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]
):
root: JSONRPCErrorResponse | CancelTaskSuccessResponse
"""
JSON-RPC response for the 'tasks/cancel' method.
Expand Down Expand Up @@ -1800,7 +1814,9 @@ class JSONRPCResponse(
"""


class SendMessageResponse(RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]):
class SendMessageResponse(
RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]
):
root: JSONRPCErrorResponse | SendMessageSuccessResponse
"""
JSON-RPC response model for the 'message/send' method.
Expand Down
Loading