🚀 Auto-deploy: BotVPS atualizado em 24/03/2026 21:36:58

This commit is contained in:
2026-03-24 21:36:58 +00:00
parent c2273a13f0
commit 27d12ff9c4
4 changed files with 40 additions and 14 deletions

View File

@@ -154,8 +154,10 @@ async def web_chat_audio(audio: UploadFile = File(...), is_auth: bool = Depends(
reply = await query_agent_async(text)
# 4. Gera áudio da resposta (TTS)
reply_clean = re.sub(r'<REFINED>.*?</REFINED>', '', reply, flags=re.DOTALL).strip()
filename = await text_to_speech_async(reply_clean)
# Se houver <REFINED>, usa apenas ele para o áudio. Caso contrário, usa tudo.
refined_match = re.search(r'<REFINED>(.*?)</REFINED>', reply, flags=re.DOTALL)
audio_text = refined_match.group(1).strip() if refined_match else reply
filename = await text_to_speech_async(audio_text)
return {
"text": text,