fix: suppress VAD debug logs, spotify no-device graceful, filter tool names from response
Some checks failed
Deploy / deploy (push) Failing after 45s
Some checks failed
Deploy / deploy (push) Failing after 45s
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user