Skip to content

Commit

Permalink
Merge pull request pipecat-ai#485 from pipecat-ai/khk/metrics-model-e…
Browse files Browse the repository at this point in the history
…xclude-none

fixup for serialization issue
  • Loading branch information
kwindla authored Sep 21, 2024
2 parents e8f8a49 + 78a3f08 commit 26a64af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pipecat/transports/services/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,19 +740,19 @@ async def send_metrics(self, frame: MetricsFrame):
if isinstance(d, TTFBMetricsData):
if "ttfb" not in metrics:
metrics["ttfb"] = []
metrics["ttfb"].append(d.model_dump())
metrics["ttfb"].append(d.model_dump(exclude_none=True))
elif isinstance(d, ProcessingMetricsData):
if "processing" not in metrics:
metrics["processing"] = []
metrics["processing"].append(d.model_dump())
metrics["processing"].append(d.model_dump(exclude_none=True))
elif isinstance(d, LLMUsageMetricsData):
if "tokens" not in metrics:
metrics["tokens"] = []
metrics["tokens"].append(d.value.model_dump(exclude_none=True))
elif isinstance(d, TTSUsageMetricsData):
if "characters" not in metrics:
metrics["characters"] = []
metrics["characters"].append(d.model_dump())
metrics["characters"].append(d.model_dump(exclude_none=True))

message = DailyTransportMessageFrame(message={
"type": "pipecat-metrics",
Expand Down

0 comments on commit 26a64af

Please sign in to comment.