Skip to content

Commit 73032a2

Browse files
lcwSevenwarren618
authored andcommitted
fix(api): accept short universe names in alpha list endpoint
Normalize csi300/sp500/btc-usdt to canonical names before validation in GET /alpha/list, matching the behavior of the bench form endpoint. Signed-off-by: liucaiwen <liucaiwenseven@163.com>
1 parent 8e9ec08 commit 73032a2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

agent/src/api/alpha_routes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ async def list_alphas(
282282
status_code=400,
283283
detail=f"unknown theme {theme!r}; expected one of {sorted(_VALID_THEMES)}",
284284
)
285+
if universe is not None:
286+
_ALIAS = {"csi300": "equity_cn", "sp500": "equity_us", "btc-usdt": "crypto"}
287+
universe = _ALIAS.get(universe, universe)
285288
if universe is not None and universe not in _VALID_UNIVERSES:
286289
raise HTTPException(
287290
status_code=400,

0 commit comments

Comments
 (0)