fi: timestamp precision to millisec instead of micro

This commit is contained in:
Sabiha Khan 2026-07-06 09:28:48 +05:30
parent 44053d0a6d
commit 058565726b
2 changed files with 10 additions and 1 deletions

View file

@ -129,7 +129,7 @@ class InMemoryLogsBuffer:
@staticmethod
def _now_iso() -> str:
return datetime.now(UTC).isoformat()
return datetime.now(UTC).isoformat(timespec="milliseconds")
def mark_user_started_speaking(self):
"""Record when the user started speaking for the current turn."""

View file

@ -1,4 +1,5 @@
from types import SimpleNamespace
import re
import pytest
from pipecat.frames.frames import (
@ -200,6 +201,14 @@ async def test_observer_attaches_backend_speaking_intervals_to_logged_transcript
]
assert user_event["payload"]["timestamp"] != "aggregator-user-start"
assert re.match(
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+00:00$",
user_event["payload"]["timestamp"],
)
assert user_event["payload"]["end_timestamp"]
assert bot_event["payload"]["timestamp"] != "aggregator-bot-start"
assert re.match(
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\+00:00$",
bot_event["payload"]["timestamp"],
)
assert bot_event["payload"]["end_timestamp"]