feat: tencent tts add metrics#2124
Conversation
PR Review: feat: tencent tts add metricsThis PR adds metrics tracking to What looks good
Issue: potential null request ID passed to
|
5c770e6 to
578ed0b
Compare
|
PR Review - Overall LGTM with minor observations. This PR adds output character and audio chunk metrics to the Tencent TTS extension, following the same pattern established in PR 2122 for google_tts_python, qwen3_tts_python, and rime_tts. The implementation correctly mirrors the established pattern: metrics_add_output_characters inside the text strip guard, metrics_add_recv_audio_chunks at the audio data receive point, and send_usage_metrics called before finish_request in _handle_tts_audio_end. Minor observations: (1) Character count includes whitespace - the guard ensures t.text.strip() is non-empty but metrics_add_output_characters(len(t.text)) still counts leading/trailing whitespace. Consistent with google_tts_python so fine as-is, but worth noting if exact character billing matters. (2) Metrics are inside the 'if self.request_start_ts is not None' block - correct and pre-existing behavior, but means metrics will not emit if _handle_tts_audio_end is called before a request starts. Not introduced by this PR. The missing newline fix in manifest.json is a nice cleanup and the version bump to 0.4.5 is appropriate. Clean, focused change that brings Tencent TTS to parity with other TTS extensions. No blocking issues. |
No description provided.