feat: add USD/BRL and XAU/USD pipeline agents (Brief+Decio) with /api/usd/brief and /api/xau/brief routes

This commit is contained in:
2026-06-15 17:22:16 +00:00
parent 1e3f2e7199
commit 1defb34d47
6 changed files with 602 additions and 0 deletions
+42
View File
@@ -18,6 +18,10 @@ from agents.brief import BriefAgent
from agents.decio import DecioAgent
from agents.papert import PapertAgent
from agents.audit import AuditAgent
from agents.usd_brief import USDBriefAgent
from agents.usd_decio import USDDecioAgent
from agents.xau_brief import XAUBriefAgent
from agents.xau_decio import XAUDecioAgent
app = Flask(__name__)
@@ -860,6 +864,44 @@ def run_backtest():
except Exception as e:
return jsonify({"error": str(e)}), 500
# ── Multi-Asset API Routes ──────────────────────────────────────────────────
@app.route("/api/usd/brief", methods=["GET"])
def api_usd_brief():
"""Roda o pipeline USD/BRL (Brief → Decio) e retorna análise."""
try:
brief = USDBriefAgent()
brief_data = brief.run()
decio = USDDecioAgent(brief_data)
decio_data = decio.run()
return jsonify({
"brief": brief_data,
"decio": decio_data,
"asset": "USD/BRL",
"timestamp": datetime.now().isoformat()
})
except Exception as e:
app.logger.error(f"USD brief error: {e}")
return jsonify({"error": str(e)}), 500
@app.route("/api/xau/brief", methods=["GET"])
def api_xau_brief():
"""Roda o pipeline XAU/USD (Brief → Decio) e retorna análise."""
try:
brief = XAUBriefAgent()
brief_data = brief.run()
decio = XAUDecioAgent(brief_data)
decio_data = decio.run()
return jsonify({
"brief": brief_data,
"decio": decio_data,
"asset": "XAU/USD",
"timestamp": datetime.now().isoformat()
})
except Exception as e:
app.logger.error(f"XAU brief error: {e}")
return jsonify({"error": str(e)}), 500
# ── Config API (Cockpit de Dosagens de Trabalho) ──────────────────────────────
CONFIG_FILE = os.path.join(DATA_DIR, "user_config.json")