From ea2e9dcffac634438a876ffedd52f495e7f25c40 Mon Sep 17 00:00:00 2001 From: a2a-bot Date: Thu, 17 Jul 2025 16:10:41 +0000 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20Update=20A2A=20types=20from=20speci?= =?UTF-8?q?fication=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/a2a/types.py | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/src/a2a/types.py b/src/a2a/types.py index 45adf8c1..4962cbd0 100644 --- a/src/a2a/types.py +++ b/src/a2a/types.py @@ -133,9 +133,7 @@ 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. """ @@ -1147,7 +1145,7 @@ class MessageSendConfiguration(A2ABaseModel): Configuration for the send message request. """ - acceptedOutputModes: list[str] + acceptedOutputModes: list[str] | None = None """ Accepted output modalities by the client. """ @@ -1273,9 +1271,7 @@ class Artifact(A2ABaseModel): class DeleteTaskPushNotificationConfigResponse( - RootModel[ - JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse - ] + RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse] ): root: JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse """ @@ -1284,9 +1280,7 @@ class DeleteTaskPushNotificationConfigResponse( class GetTaskPushNotificationConfigResponse( - RootModel[ - JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse - ] + RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse] ): root: JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse """ @@ -1295,9 +1289,7 @@ class GetTaskPushNotificationConfigResponse( class ListTaskPushNotificationConfigResponse( - RootModel[ - JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse - ] + RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse] ): root: JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse """ @@ -1452,9 +1444,7 @@ class SendStreamingMessageRequest(A2ABaseModel): class SetTaskPushNotificationConfigResponse( - RootModel[ - JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse - ] + RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse] ): root: JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse """ @@ -1507,9 +1497,7 @@ 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. """ @@ -1769,9 +1757,7 @@ class SendStreamingMessageSuccessResponse(A2ABaseModel): """ -class CancelTaskResponse( - RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse] -): +class CancelTaskResponse(RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]): root: JSONRPCErrorResponse | CancelTaskSuccessResponse """ JSON-RPC response for the 'tasks/cancel' method. @@ -1814,9 +1800,7 @@ class JSONRPCResponse( """ -class SendMessageResponse( - RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse] -): +class SendMessageResponse(RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]): root: JSONRPCErrorResponse | SendMessageSuccessResponse """ JSON-RPC response model for the 'message/send' method. From 9d2912c84d3af892ca1dc74087f3431b28c4c8d1 Mon Sep 17 00:00:00 2001 From: Holt Skinner Date: Thu, 17 Jul 2025 18:00:37 +0100 Subject: [PATCH 2/2] Change init of `SendMessageConfiguration.accepted_output_modes` to allow None --- src/a2a/utils/proto_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/a2a/utils/proto_utils.py b/src/a2a/utils/proto_utils.py index b67d6033..0871f05c 100644 --- a/src/a2a/utils/proto_utils.py +++ b/src/a2a/utils/proto_utils.py @@ -187,7 +187,7 @@ def message_send_configuration( if not config: return a2a_pb2.SendMessageConfiguration() return a2a_pb2.SendMessageConfiguration( - accepted_output_modes=list(config.acceptedOutputModes), + accepted_output_modes=config.acceptedOutputModes, push_notification=ToProto.push_notification_config( config.pushNotificationConfig )