From f92ee9d2b9e8a22b1f43cb776124fde3d3c878d8 Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Tue, 24 Mar 2026 11:41:41 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Auto-deploy:=20BotVPS=20atualiza?= =?UTF-8?q?do=20em=2024/03/2026=2011:41:41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai_agent.py | 5 +++-- main.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ai_agent.py b/ai_agent.py index a71c87f..03639a8 100644 --- a/ai_agent.py +++ b/ai_agent.py @@ -25,8 +25,8 @@ async def query_agent_async(prompt: str, override_provider=None, chat_history=No provider = override_provider or cfg.get("active_provider", "gemini") tools_desc = "\n".join([f"- {k}: {v['description']}" for k, v in AVAILABLE_TOOLS.items()]) - system_prompt = f"""Você é o Antigravity VPS Agent. Root Admin da VPS do Marcos. -Responda em PORTUGUÊS. Seja técnico e direto. + system_prompt = f"""Sou o CLAW, auxiliar do Marcos. Gerencio a VPS. +Responda em PORTUGUÊS de forma curta e direta. ### FERRAMENTAS: {tools_desc} @@ -35,6 +35,7 @@ Responda em PORTUGUÊS. Seja técnico e direto. Use [TOOL:nome] arg [/TOOL] para ações. Finalize com resumo . """ + history_str = "" if chat_history: for m in chat_history[-5:]: diff --git a/main.py b/main.py index fcebfc9..5e73e20 100644 --- a/main.py +++ b/main.py @@ -127,8 +127,11 @@ async def test_llm_latency(is_auth: bool = Depends(verify_password)): @app.post("/api/chat") async def web_chat(message: dict, is_auth: bool = Depends(verify_password)): user_text = message.get("text", "") + history = message.get("history", []) # Extrai o histórico do frontend if not user_text: return {"reply": "Vazio."} - reply = await query_agent_async(user_text) + + # Repassa o histórico para manter o contexto da conversa + reply = await query_agent_async(user_text, chat_history=history) return {"reply": reply} @app.post("/api/orchestrate")