🚀 Auto-deploy: BotVPS atualizado em 21/04/2026 20:51:24

This commit is contained in:
2026-04-21 20:51:24 +00:00
parent c538fdb9c2
commit 8161c35655
5 changed files with 13 additions and 12 deletions

View File

@@ -112,9 +112,11 @@ async def process_logic(update: Update, context: ContextTypes.DEFAULT_TYPE, user
# No Telegram, ainda não estamos mantendo histórico complexo no bot_data (pode ser futuro)
reply = await query_agent_async(user_msg, override_provider=cfg.get("active_provider"))
# Envia resposta (Texto)
# Remove apenas as tags <REFINED> e </REFINED>, mantendo o conteúdo
reply_clean = reply.replace('<REFINED>', '').replace('</REFINED>', '').strip()
# Normaliza a resposta: remove tags legadas <REFINED> ou [REFINED] e garante o prefixo RESUMO:
reply_clean = re.sub(r'[<\[]/?REFINED[>\]]', '', reply, flags=re.IGNORECASE).strip()
# Se a resposta não tiver "RESUMO:" mas tiver conteúdo, o orquestrador/IA já deve ter colocado.
# Se por algum motivo não houver, mantemos o texto limpo.
await update.message.reply_text(reply_clean)
# Se foi por voz, responde por voz também