66
77import httpx
88
9- from google .protobuf .json_format import MessageToDict , Parse
9+ from google .protobuf .json_format import MessageToDict , Parse , ParseDict
1010from httpx_sse import SSEError , aconnect_sse
1111
1212from a2a .client .card_resolver import A2ACardResolver
@@ -121,7 +121,7 @@ async def send_message(
121121 """
122122 pb = a2a_pb2 .SendMessageRequest (
123123 request = proto_utils .ToProto .message (request .message ),
124- configuration = proto_utils .ToProto .send_message_config (
124+ configuration = proto_utils .ToProto .message_send_configuration (
125125 request .configuration
126126 ),
127127 metadata = (
@@ -141,7 +141,7 @@ async def send_message(
141141 '/v1/message:send' , payload , modified_kwargs
142142 )
143143 response_pb = a2a_pb2 .SendMessageResponse ()
144- Parse (response_data , response_pb )
144+ ParseDict (response_data , response_pb )
145145 return proto_utils .FromProto .task_or_message (response_pb )
146146
147147 async def send_message_streaming (
@@ -173,7 +173,7 @@ async def send_message_streaming(
173173 """
174174 pb = a2a_pb2 .SendMessageRequest (
175175 request = proto_utils .ToProto .message (request .message ),
176- configuration = proto_utils .ToProto .send_message_config (
176+ configuration = proto_utils .ToProto .message_send_configuration (
177177 request .configuration
178178 ),
179179 metadata = (
@@ -322,13 +322,13 @@ async def get_task(
322322 )
323323 response_data = await self ._send_get_request (
324324 f'/v1/tasks/{ request .taskId } ' ,
325- {'historyLength' : request .history_length }
325+ {'historyLength' : str ( request .history_length ) }
326326 if request .history_length
327327 else {},
328328 modified_kwargs ,
329329 )
330330 task = a2a_pb2 .Task ()
331- Parse (response_data , task )
331+ ParseDict (response_data , task )
332332 return proto_utils .FromProto .task (task )
333333
334334 async def cancel_task (
@@ -365,7 +365,7 @@ async def cancel_task(
365365 f'/v1/tasks/{ request .id } :cancel' , payload , modified_kwargs
366366 )
367367 task = a2a_pb2 .Task ()
368- Parse (response_data , task )
368+ ParseDict (response_data , task )
369369 return proto_utils .FromProto .task (task )
370370
371371 async def set_task_callback (
@@ -406,7 +406,7 @@ async def set_task_callback(
406406 modified_kwargs ,
407407 )
408408 config = a2a_pb2 .TaskPushNotificationConfig ()
409- Parse (response_data , config )
409+ ParseDict (response_data , config )
410410 return proto_utils .FromProto .task_push_notification_config (config )
411411
412412 async def get_task_callback (
@@ -447,7 +447,7 @@ async def get_task_callback(
447447 modified_kwargs ,
448448 )
449449 config = a2a_pb2 .TaskPushNotificationConfig ()
450- Parse (response_data , config )
450+ ParseDict (response_data , config )
451451 return proto_utils .FromProto .task_push_notification_config (config )
452452
453453 async def resubscribe (
@@ -548,8 +548,8 @@ async def get_card(
548548 return card
549549
550550 # Apply interceptors before sending
551- payload , modified_kwargs = await self ._apply_interceptors (
552- '' ,
551+ _ , modified_kwargs = await self ._apply_interceptors (
552+ {} ,
553553 http_kwargs ,
554554 context ,
555555 )
0 commit comments