44import json
55import uuid
66from collections .abc import Mapping , AsyncIterator , MutableMapping
7- from datetime import datetime , timezone
7+ from datetime import datetime , UTC
88from typing import Annotated , Any , Optional
99
1010from a2a .server .agent_execution import AgentExecutor , RequestContext
@@ -381,7 +381,7 @@ async def _process_task_streaming( # pylint: disable=too-many-locals
381381 task_id = task_id ,
382382 status = TaskStatus (
383383 state = TaskState .working ,
384- timestamp = datetime .now (timezone . utc ).isoformat (),
384+ timestamp = datetime .now (UTC ).isoformat (),
385385 ),
386386 context_id = context_id ,
387387 final = False ,
@@ -403,14 +403,14 @@ async def _process_task_streaming( # pylint: disable=too-many-locals
403403 if aggregator .task_state == TaskState .working :
404404 await task_updater .update_status (
405405 TaskState .completed ,
406- timestamp = datetime .now (timezone . utc ).isoformat (),
406+ timestamp = datetime .now (UTC ).isoformat (),
407407 final = True ,
408408 )
409409 else :
410410 await task_updater .update_status (
411411 aggregator .task_state ,
412412 message = aggregator .task_status_message ,
413- timestamp = datetime .now (timezone . utc ).isoformat (),
413+ timestamp = datetime .now (UTC ).isoformat (),
414414 final = True ,
415415 )
416416
@@ -459,7 +459,7 @@ async def _convert_stream_to_events( # pylint: disable=too-many-branches,too-ma
459459 context_id = context_id ,
460460 task_id = task_id ,
461461 ),
462- timestamp = datetime .now (timezone . utc ).isoformat (),
462+ timestamp = datetime .now (UTC ).isoformat (),
463463 ),
464464 context_id = context_id ,
465465 final = False ,
@@ -477,7 +477,7 @@ async def _convert_stream_to_events( # pylint: disable=too-many-branches,too-ma
477477 context_id = context_id ,
478478 task_id = task_id ,
479479 ),
480- timestamp = datetime .now (timezone . utc ).isoformat (),
480+ timestamp = datetime .now (UTC ).isoformat (),
481481 ),
482482 context_id = context_id ,
483483 final = False ,
@@ -495,7 +495,7 @@ async def _convert_stream_to_events( # pylint: disable=too-many-branches,too-ma
495495 context_id = context_id ,
496496 task_id = task_id ,
497497 ),
498- timestamp = datetime .now (timezone . utc ).isoformat (),
498+ timestamp = datetime .now (UTC ).isoformat (),
499499 ),
500500 context_id = context_id ,
501501 final = False ,
@@ -891,5 +891,5 @@ async def a2a_health_check() -> dict[str, str]:
891891 "service" : "lightspeed-a2a" ,
892892 "version" : __version__ ,
893893 "a2a_sdk_version" : "0.3.4" ,
894- "timestamp" : datetime .now (timezone . utc ).isoformat (),
894+ "timestamp" : datetime .now (UTC ).isoformat (),
895895 }
0 commit comments