Skip to content

Commit 17d6042

Browse files
DeanChensjcopybara-github
authored andcommitted
fix: Make sure each partial event has different timestamp
PiperOrigin-RevId: 778148175
1 parent 43083ba commit 17d6042

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/google/adk/flows/llm_flows/base_llm_flow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from abc import ABC
1818
import asyncio
19+
import datetime
1920
import inspect
2021
import logging
2122
from typing import AsyncGenerator
@@ -320,6 +321,7 @@ async def _run_one_step_async(
320321
):
321322
# Update the mutable event id to avoid conflict
322323
model_response_event.id = Event.new_id()
324+
model_response_event.timestamp = datetime.datetime.now().timestamp()
323325
yield event
324326

325327
async def _preprocess_async(

0 commit comments

Comments
 (0)