From 6f7664846cace2b4109cd9a207c69deabc700ebc Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 24 Feb 2026 12:53:55 -0500 Subject: [PATCH] Add can_generate_metrics to Soniox and AWS Transcribe STT services Commit 859cd7c9 refactored STT TTFB measurement to use the base class start_ttfb_metrics/stop_ttfb_metrics, which are gated behind can_generate_metrics(). Soniox and AWS Transcribe never overrode this method (default returns False), so TTFB was silently never reported. --- changelog/3813.fixed.md | 1 + src/pipecat/services/aws/stt.py | 8 ++++++++ src/pipecat/services/soniox/stt.py | 8 ++++++++ 3 files changed, 17 insertions(+) create mode 100644 changelog/3813.fixed.md diff --git a/changelog/3813.fixed.md b/changelog/3813.fixed.md new file mode 100644 index 000000000..9d9115e77 --- /dev/null +++ b/changelog/3813.fixed.md @@ -0,0 +1 @@ +- Fixed STT TTFB metrics not being reported for `SonioxSTTService` and `AWSTranscribeSTTService` due to missing `can_generate_metrics()` override. diff --git a/src/pipecat/services/aws/stt.py b/src/pipecat/services/aws/stt.py index 09552ecfc..c53e3648c 100644 --- a/src/pipecat/services/aws/stt.py +++ b/src/pipecat/services/aws/stt.py @@ -126,6 +126,14 @@ class AWSTranscribeSTTService(WebsocketSTTService): self._receive_task = None + def can_generate_metrics(self) -> bool: + """Check if this service can generate processing metrics. + + Returns: + True, as AWS Transcribe STT supports metrics generation. + """ + return True + def get_service_encoding(self, encoding: str) -> str: """Convert internal encoding format to AWS Transcribe format. diff --git a/src/pipecat/services/soniox/stt.py b/src/pipecat/services/soniox/stt.py index 1e4b49705..61dbb794f 100644 --- a/src/pipecat/services/soniox/stt.py +++ b/src/pipecat/services/soniox/stt.py @@ -208,6 +208,14 @@ class SonioxSTTService(WebsocketSTTService): self._receive_task = None + def can_generate_metrics(self) -> bool: + """Check if this service can generate processing metrics. + + Returns: + True, as Soniox STT supports metrics generation. + """ + return True + async def start(self, frame: StartFrame): """Start the Soniox STT websocket connection.