Skip to content

Commit 4442167

Browse files
Merge pull request #1778 from rahulsamant37:fix/event-id-uuid4-collision-v1
PiperOrigin-RevId: 779177848
2 parents 3fa2ea7 + e437c7a commit 4442167

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/google/adk/events/event.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
from __future__ import annotations
1515

1616
from datetime import datetime
17-
import random
18-
import string
1917
from typing import Optional
18+
import uuid
2019

2120
from google.genai import types
2221
from pydantic import alias_generators
@@ -132,5 +131,4 @@ def has_trailing_code_execution_result(
132131

133132
@staticmethod
134133
def new_id():
135-
characters = string.ascii_letters + string.digits
136-
return ''.join(random.choice(characters) for _ in range(8))
134+
return str(uuid.uuid4())

0 commit comments

Comments
 (0)