fix(tts): add error handling for accumulated block TTS
This commit is contained in:
parent
938a9ab627
commit
145618d625
@ -346,6 +346,7 @@ export async function dispatchReplyFromConfig(params: {
|
|||||||
// This handles the case where block streaming succeeds and drops final payloads,
|
// This handles the case where block streaming succeeds and drops final payloads,
|
||||||
// but we still want TTS audio to be generated from the accumulated block content.
|
// but we still want TTS audio to be generated from the accumulated block content.
|
||||||
if (replies.length === 0 && blockCount > 0 && accumulatedBlockText.trim()) {
|
if (replies.length === 0 && blockCount > 0 && accumulatedBlockText.trim()) {
|
||||||
|
try {
|
||||||
const ttsSyntheticReply = await maybeApplyTtsToPayload({
|
const ttsSyntheticReply = await maybeApplyTtsToPayload({
|
||||||
payload: { text: accumulatedBlockText },
|
payload: { text: accumulatedBlockText },
|
||||||
cfg,
|
cfg,
|
||||||
@ -383,6 +384,11 @@ export async function dispatchReplyFromConfig(params: {
|
|||||||
queuedFinal = didQueue || queuedFinal;
|
queuedFinal = didQueue || queuedFinal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logVerbose(
|
||||||
|
`dispatch-from-config: accumulated block TTS failed: ${err instanceof Error ? err.message : String(err)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await dispatcher.waitForIdle();
|
await dispatcher.waitForIdle();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user