Update asr interim
This commit is contained in:
@@ -414,6 +414,8 @@ class DuplexPipeline:
|
||||
)
|
||||
})
|
||||
|
||||
if not is_final:
|
||||
logger.info(f"ASR interim: {text[:100]}")
|
||||
logger.debug(f"Sent transcript ({'final' if is_final else 'interim'}): {text[:50]}...")
|
||||
|
||||
async def _on_speech_start(self) -> None:
|
||||
@@ -463,14 +465,16 @@ class DuplexPipeline:
|
||||
|
||||
logger.info(f"EOU detected - user said: {user_text[:100]}...")
|
||||
|
||||
# Send final transcription to client
|
||||
await self.transport.send_event({
|
||||
**ev(
|
||||
"transcript.final",
|
||||
trackId=self.session_id,
|
||||
text=user_text,
|
||||
)
|
||||
})
|
||||
# For ASR backends that already emitted final via callback,
|
||||
# avoid duplicating transcript.final on EOU.
|
||||
if user_text != self._last_sent_transcript:
|
||||
await self.transport.send_event({
|
||||
**ev(
|
||||
"transcript.final",
|
||||
trackId=self.session_id,
|
||||
text=user_text,
|
||||
)
|
||||
})
|
||||
|
||||
# Clear buffers
|
||||
self._audio_buffer = b""
|
||||
|
||||
Reference in New Issue
Block a user