Skip to content

Commit

Permalink
transports(daily): don't send empty metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Jul 23, 2024
1 parent 69f6489 commit f41c2b3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pipecat/transports/services/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,15 @@ async def send_message(self, frame: TransportMessageFrame):
await self._client.send_message(frame)

async def send_metrics(self, frame: MetricsFrame):
metrics = {}
if frame.ttfb:
metrics["ttfb"] = frame.ttfb
if frame.processing:
metrics["processing"] = frame.processing

message = DailyTransportMessageFrame(message={
"type": "pipecat-metrics",
"metrics": {
"ttfb": frame.ttfb or [],
"processing": frame.processing or [],
},
"metrics": metrics
})
await self._client.send_message(message)

Expand Down

0 comments on commit f41c2b3

Please sign in to comment.