Skip to content

Commit 5f7e025

Browse files
committed
Update types
1 parent fa92c75 commit 5f7e025

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/a2a/client/grpc_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ async def set_task_callback(
159159
Returns:
160160
A `TaskPushNotificationConfig` object containing the config.
161161
"""
162-
config = await self.stub.CreateTaskPushNotification(
163-
a2a_pb2.CreateTaskPushNotificationRequest(
162+
config = await self.stub.CreateTaskPushNotificationConfig(
163+
a2a_pb2.CreateTaskPushNotificationConfigRequest(
164164
parent='',
165165
config_id='',
166166
config=proto_utils.ToProto.task_push_notification_config(
@@ -182,8 +182,8 @@ async def get_task_callback(
182182
Returns:
183183
A `TaskPushNotificationConfig` object containing the configuration.
184184
"""
185-
config = await self.stub.GetTaskPushNotification(
186-
a2a_pb2.GetTaskPushNotificationRequest(
185+
config = await self.stub.GetTaskPushNotificationConfig(
186+
a2a_pb2.GetTaskPushNotificationConfigRequest(
187187
name=f'tasks/{request.id}/pushNotification/undefined',
188188
)
189189
)

src/a2a/server/request_handlers/grpc_handler.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
self,
5656
agent_card: AgentCard,
5757
request_handler: RequestHandler,
58-
context_builder: CallContextBuilder | None = None
58+
context_builder: CallContextBuilder | None = None,
5959
):
6060
"""Initializes the GrpcHandler.
6161
@@ -198,12 +198,12 @@ async def TaskSubscription(
198198
except ServerError as e:
199199
await self.abort_context(e, context)
200200

201-
async def GetTaskPushNotification(
201+
async def GetTaskPushNotificationConfig(
202202
self,
203-
request: a2a_pb2.GetTaskPushNotificationRequest,
203+
request: a2a_pb2.GetTaskPushNotificationConfigRequest,
204204
context: grpc.aio.ServicerContext,
205205
) -> a2a_pb2.TaskPushNotificationConfig:
206-
"""Handles the 'GetTaskPushNotification' gRPC method.
206+
"""Handles the 'GetTaskPushNotificationConfig' gRPC method.
207207
208208
Args:
209209
request: The incoming `GetTaskPushNotificationConfigRequest` object.
@@ -229,17 +229,17 @@ async def GetTaskPushNotification(
229229
lambda self: self.agent_card.capabilities.pushNotifications,
230230
'Push notifications are not supported by the agent',
231231
)
232-
async def CreateTaskPushNotification(
232+
async def CreateTaskPushNotificationConfig(
233233
self,
234-
request: a2a_pb2.CreateTaskPushNotificationRequest,
234+
request: a2a_pb2.CreateTaskPushNotificationConfigRequest,
235235
context: grpc.aio.ServicerContext,
236236
) -> a2a_pb2.TaskPushNotificationConfig:
237-
"""Handles the 'CreateTaskPushNotification' gRPC method.
237+
"""Handles the 'CreateTaskPushNotificationConfig' gRPC method.
238238
239239
Requires the agent to support push notifications.
240240
241241
Args:
242-
request: The incoming `CreateTaskPushNotificationRequest` object.
242+
request: The incoming `CreateTaskPushNotificationConfigRequest` object.
243243
context: Context provided by the server.
244244
245245
Returns:

src/a2a/utils/proto_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,12 @@ def task_id_params(
589589
request: (
590590
a2a_pb2.CancelTaskRequest
591591
| a2a_pb2.TaskSubscriptionRequest
592-
| a2a_pb2.GetTaskPushNotificationRequest
592+
| a2a_pb2.GetTaskPushNotificationConfigRequest
593593
),
594594
) -> types.TaskIdParams:
595595
# This is currently incomplete until the core sdk supports multiple
596596
# configs for a single task.
597-
if isinstance(request, a2a_pb2.GetTaskPushNotificationRequest):
597+
if isinstance(request, a2a_pb2.GetTaskPushNotificationConfigRequest):
598598
m = re.match(_TASK_PUSH_CONFIG_NAME_MATCH, request.name)
599599
if not m:
600600
raise ServerError(
@@ -615,7 +615,7 @@ def task_id_params(
615615
@classmethod
616616
def task_push_notification_config(
617617
cls,
618-
request: a2a_pb2.CreateTaskPushNotificationRequest,
618+
request: a2a_pb2.CreateTaskPushNotificationConfigRequest,
619619
) -> types.TaskPushNotificationConfig:
620620
m = re.match(_TASK_NAME_MATCH, request.parent)
621621
if not m:

0 commit comments

Comments
 (0)