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,7 +465,9 @@ class DuplexPipeline:
|
||||
|
||||
logger.info(f"EOU detected - user said: {user_text[:100]}...")
|
||||
|
||||
# Send final transcription to client
|
||||
# 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",
|
||||
|
||||
@@ -1703,17 +1703,11 @@ export const DebugDrawer: React.FC<{
|
||||
}
|
||||
const last = prev[prev.length - 1];
|
||||
if (last?.role === 'user') {
|
||||
if (last.text === finalText) {
|
||||
lastUserFinalRef.current = finalText;
|
||||
return prev;
|
||||
}
|
||||
if (finalText.startsWith(last.text) || last.text.startsWith(finalText)) {
|
||||
const next = [...prev];
|
||||
next[next.length - 1] = { ...last, text: finalText };
|
||||
lastUserFinalRef.current = finalText;
|
||||
return next;
|
||||
}
|
||||
}
|
||||
lastUserFinalRef.current = finalText;
|
||||
return [...prev, { role: 'user', text: finalText }];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user