Skip to content

Commit 7f20a18

Browse files
committed
Add timestamp to bookkeeping data
1 parent 84b6cc1 commit 7f20a18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llmstack/play/output_stream.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import asyncio
66
import logging
7+
import time
78
import uuid
89
from collections import defaultdict
910
from typing import Any, Dict, Type
@@ -230,7 +231,10 @@ def bookkeep(self, data: BaseModel) -> None:
230231
"""
231232
Bookkeeping entry.
232233
"""
233-
self._bookkeeping_queue.put_nowait((self._stream_id, data.model_dump()))
234+
timestamp = time.time()
235+
timestamped_data = {**data.model_dump(), "timestamp": timestamp}
236+
237+
self._bookkeeping_queue.put_nowait((self._stream_id, timestamped_data))
234238

235239
def error(self, error: Exception) -> None:
236240
"""

0 commit comments

Comments
 (0)