Skip to content

"Vibe-Trading: Your Personal Trading Agent"

fix(api): accept short universe names in alpha list endpoint

liucaiwen62869fc26a94
diff --git a/agent/src/api/alpha_routes.py b/agent/src/api/alpha_routes.py
index c1c5d40fd..be5e5ffac 100644
--- a/agent/src/api/alpha_routes.py
+++ b/agent/src/api/alpha_routes.py
@@ -282,6 +282,9 @@ def register_alpha_routes(
status_code=400,
detail=f"unknown theme {theme!r}; expected one of {sorted(_VALID_THEMES)}",
)
+ if universe is not None:
+ _ALIAS = {"csi300": "equity_cn", "sp500": "equity_us", "btc-usdt": "crypto"}
+ universe = _ALIAS.get(universe, universe)
if universe is not None and universe not in _VALID_UNIVERSES:
raise HTTPException(
status_code=400,