Merge pull request #3186 from pipecat-ai/mb/11labs-fix-metrics-tracking

fix: ElevenLabsTTSService character usage metrics
This commit is contained in:
Mark Backman
2025-12-04 12:36:39 -05:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -61,6 +61,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed an issue in `ElevenLabsTTSService` where character usage metrics were
only reported on the first TTS generation per turn.
- Fixed an issue where `LLMTextFrame.skip_tts` was being overwritten by LLM
services.

View File

@@ -731,10 +731,8 @@ class ElevenLabsTTSService(AudioContextWordTTSService):
await self._websocket.send(json.dumps(msg))
logger.trace(f"Created new context {self._context_id}")
await self._send_text(text)
await self.start_tts_usage_metrics(text)
else:
await self._send_text(text)
await self._send_text(text)
await self.start_tts_usage_metrics(text)
except Exception as e:
yield TTSStoppedFrame()
yield ErrorFrame(error=f"Unknown error occurred: {e}")