Skip to content

Commit 0d033b1

Browse files
committed
fixing linter
1 parent 8e655d1 commit 0d033b1

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/a2a/server/apps/jsonrpc/jsonrpc_app.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
from abc import ABC, abstractmethod
77
from collections.abc import AsyncGenerator, Callable
8-
from typing import TYPE_CHECKING, Any
8+
from typing import TYPE_CHECKING, Any, Type, Union
99

10-
from pydantic import ValidationError
10+
from pydantic import BaseModel, ValidationError
1111

1212
from a2a.auth.user import UnauthenticatedUser
1313
from a2a.auth.user import User as A2AUser
@@ -156,7 +156,21 @@ class JSONRPCApplication(ABC):
156156
"""
157157

158158
# Method-to-model mapping for centralized routing
159-
METHOD_TO_MODEL = {
159+
# Define the union type for all supported request models
160+
A2ARequestModel = Union[
161+
SendMessageRequest,
162+
SendStreamingMessageRequest,
163+
GetTaskRequest,
164+
CancelTaskRequest,
165+
SetTaskPushNotificationConfigRequest,
166+
GetTaskPushNotificationConfigRequest,
167+
ListTaskPushNotificationConfigRequest,
168+
DeleteTaskPushNotificationConfigRequest,
169+
TaskResubscriptionRequest,
170+
GetAuthenticatedExtendedCardRequest,
171+
]
172+
173+
METHOD_TO_MODEL: dict[str, Type[A2ARequestModel]] = {
160174
'message/send': SendMessageRequest,
161175
'message/stream': SendStreamingMessageRequest,
162176
'tasks/get': GetTaskRequest,

0 commit comments

Comments
 (0)