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.