🚀 Auto-deploy: BotVPS atualizado em 29/03/2026 01:00:58

This commit is contained in:
2026-03-29 01:00:58 +00:00
parent 1e01d261ea
commit 6306424b83

View File

@@ -82,10 +82,16 @@ DIRETRIZES:
print(f"[AGENT] Iteração {i+1} - Enviando para {provider} (modelo padrão)...")
response = await get_llm_response_async(system_prompt + current_history, provider, cfg)
print(f"[LLM RESPONSE]: {response}")
match = re.search(r"\[TOOL:(.*?)\](.*?)\[/TOOL\]", response, re.I | re.S)
# Regex robusto que encontra o [TOOL:nome] e extrai o argumento mesmo sem [/TOOL]
match = re.search(r"\[TOOL:([^\]]+)\]", response, re.I)
if match:
t_name, arg = match.group(1).strip(), match.group(2).strip()
t_name = match.group(1).strip()
content_after = response[match.end():]
end_tag = re.search(r"\[/TOOL\]", content_after, re.I)
arg = content_after[:end_tag.start()].strip() if end_tag else content_after.strip()
if t_name in AVAILABLE_TOOLS:
func = AVAILABLE_TOOLS[t_name]["func"]
# Assume ferramentas são síncronas em tools.py (legado)