fix: suppress VAD debug logs, spotify no-device graceful, filter tool names from response
Some checks failed
Deploy / deploy (push) Failing after 45s

This commit is contained in:
Cosmo
2026-05-01 11:25:15 +00:00
parent 70284c69cf
commit a94a40ffc6
3 changed files with 43 additions and 12 deletions

View File

@@ -203,7 +203,19 @@ export async function POST(req: Request) {
]
await saveHistory(agent, updatedHistory)
const cleaned = cleanForSpeech(stripFillers(finalText))
// Убрать строки вида "get_weather ..." или "<function=...>" которые иногда генерирует LLM
const filteredText = finalText
.split('\n')
.filter(line => {
const l = line.trim()
return !(/^(get_|set_|control_|create_|update_|delete_|cancel_)[a-z_]+\s/.test(l) ||
l.startsWith('<function') ||
l.startsWith('function='))
})
.join('\n')
.trim()
const cleaned = cleanForSpeech(stripFillers(filteredText || finalText))
emitVoice('response', agent, cleaned)
return NextResponse.json({ text: cleaned })
}