🚀 Auto-deploy: BotVPS atualizado em 24/03/2026 21:36:58
This commit is contained in:
6
main.py
6
main.py
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user