Skip to content

Commit 46af735

Browse files
gary149claude
andauthored
transcription returning ellipsis dots (#2009)
Fix transcription returning dots for silence/unclear audio Whisper model returns "..." (or similar dot patterns) when audio is too short, silent, or unclear. Filter out responses that only contain dots server-side to prevent them from being inserted into the draft message or triggering auto-send on mobile. Co-authored-by: Claude <[email protected]>
1 parent a5200d5 commit 46af735

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/routes/api/transcribe/+server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export async function POST({ request, locals }) {
8585
const result = await response.json();
8686

8787
// Whisper API returns { text: "transcribed text" }
88-
return json({ text: result.text || "" });
88+
// Filter out responses that only contain dots (e.g. "..." returned for silence/unclear audio)
89+
const text = (result.text || "").trim();
90+
const isOnlyDots = /^\.+$/.test(text);
91+
return json({ text: isOnlyDots ? "" : text });
8992
} catch (err) {
9093
if (err instanceof Error && err.name === "AbortError") {
9194
logger.error({ model: transcriptionModel }, "Transcription timeout");

0 commit comments

Comments
 (0)