|
22 | 22 | from typing import Dict |
23 | 23 | from typing import List |
24 | 24 | from typing import Optional |
25 | | - |
26 | | -from google.adk.platform import uuid as platform_uuid |
| 25 | +import uuid |
27 | 26 |
|
28 | 27 | from a2a.server.events import Event as A2AEvent |
29 | 28 | from a2a.types import DataPart |
@@ -255,7 +254,7 @@ def convert_a2a_task_to_event( |
255 | 254 | invocation_id=( |
256 | 255 | invocation_context.invocation_id |
257 | 256 | if invocation_context |
258 | | - else platform_uuid.new_uuid() |
| 257 | + else str(uuid.uuid4()) |
259 | 258 | ), |
260 | 259 | author=author or "a2a agent", |
261 | 260 | branch=invocation_context.branch if invocation_context else None, |
@@ -300,7 +299,7 @@ def convert_a2a_message_to_event( |
300 | 299 | invocation_id=( |
301 | 300 | invocation_context.invocation_id |
302 | 301 | if invocation_context |
303 | | - else platform_uuid.new_uuid() |
| 302 | + else str(uuid.uuid4()) |
304 | 303 | ), |
305 | 304 | author=author or "a2a agent", |
306 | 305 | branch=invocation_context.branch if invocation_context else None, |
@@ -350,7 +349,7 @@ def convert_a2a_message_to_event( |
350 | 349 | invocation_id=( |
351 | 350 | invocation_context.invocation_id |
352 | 351 | if invocation_context |
353 | | - else platform_uuid.new_uuid() |
| 352 | + else str(uuid.uuid4()) |
354 | 353 | ), |
355 | 354 | author=author or "a2a agent", |
356 | 355 | branch=invocation_context.branch if invocation_context else None, |
@@ -409,7 +408,7 @@ def convert_event_to_a2a_message( |
409 | 408 |
|
410 | 409 | if output_parts: |
411 | 410 | return Message( |
412 | | - message_id=platform_uuid.new_uuid(), role=role, parts=output_parts |
| 411 | + message_id=str(uuid.uuid4()), role=role, parts=output_parts |
413 | 412 | ) |
414 | 413 |
|
415 | 414 | except Exception as e: |
@@ -450,7 +449,7 @@ def _create_error_status_event( |
450 | 449 | status=TaskStatus( |
451 | 450 | state=TaskState.failed, |
452 | 451 | message=Message( |
453 | | - message_id=platform_uuid.new_uuid(), |
| 452 | + message_id=str(uuid.uuid4()), |
454 | 453 | role=Role.agent, |
455 | 454 | parts=[TextPart(text=error_message)], |
456 | 455 | metadata={ |
|
0 commit comments