🚀 Auto-deploy: BotVPS atualizado em 24/03/2026 11:41:41
This commit is contained in:
@@ -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")
|
provider = override_provider or cfg.get("active_provider", "gemini")
|
||||||
tools_desc = "\n".join([f"- {k}: {v['description']}" for k, v in AVAILABLE_TOOLS.items()])
|
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.
|
system_prompt = f"""Sou o CLAW, auxiliar do Marcos. Gerencio a VPS.
|
||||||
Responda em PORTUGUÊS. Seja técnico e direto.
|
Responda em PORTUGUÊS de forma curta e direta.
|
||||||
|
|
||||||
### FERRAMENTAS:
|
### FERRAMENTAS:
|
||||||
{tools_desc}
|
{tools_desc}
|
||||||
@@ -35,6 +35,7 @@ Responda em PORTUGUÊS. Seja técnico e direto.
|
|||||||
Use [TOOL:nome] arg [/TOOL] para ações.
|
Use [TOOL:nome] arg [/TOOL] para ações.
|
||||||
Finalize com <REFINED> resumo </REFINED>.
|
Finalize com <REFINED> resumo </REFINED>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
history_str = ""
|
history_str = ""
|
||||||
if chat_history:
|
if chat_history:
|
||||||
for m in chat_history[-5:]:
|
for m in chat_history[-5:]:
|
||||||
|
|||||||
5
main.py
5
main.py
@@ -127,8 +127,11 @@ async def test_llm_latency(is_auth: bool = Depends(verify_password)):
|
|||||||
@app.post("/api/chat")
|
@app.post("/api/chat")
|
||||||
async def web_chat(message: dict, is_auth: bool = Depends(verify_password)):
|
async def web_chat(message: dict, is_auth: bool = Depends(verify_password)):
|
||||||
user_text = message.get("text", "")
|
user_text = message.get("text", "")
|
||||||
|
history = message.get("history", []) # Extrai o histórico do frontend
|
||||||
if not user_text: return {"reply": "Vazio."}
|
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}
|
return {"reply": reply}
|
||||||
|
|
||||||
@app.post("/api/orchestrate")
|
@app.post("/api/orchestrate")
|
||||||
|
|||||||
Reference in New Issue
Block a user