模型下拉框

This commit is contained in:
董宏凯 committed 2026-05-25 20:23:33 +08:00
1 parent 6addf507cb
commit b91a45639f
5 files changed
+121 -32

No files matched your search

@@ -151,7 +151,7 @@ async def stream_recommend(request: Request, payload: dict = Body(...)) -> Strea
{
"intent": {"objective": "...", "constraints": [...], "assumptions": [...]},
"candidates": [{"agent_id": "...", "name": "...", "description": "..."}, ...],
"model": "deepseek-chat" # optional
"model": "<可选>" # optional;不传由 lead_agent 回退到 config.yaml models[0]
}
Stream: transparent upstream LangGraph frames, followed by one status
@@ -169,7 +169,10 @@ async def stream_recommend(request: Request, payload: dict = Body(...)) -> Strea
"""
intent = payload.get("intent") or {}
candidates = payload.get("candidates") or []
model_name = str(payload.get("model") or "deepseek-chat")
# 不写死任何默认模型;空串会让 lead_agent._resolve_model_name() 回退到
# config.yaml 的 models[0]。内网部署可能没有 deepseek-chat,前端传当前选中的
# model 名即可,缺失也不会硬错。
model_name = str(payload.get("model") or "")
if not isinstance(intent, dict) or not str(intent.get("objective") or "").strip():
raise HTTPException(status_code=400, detail="intent.objective is required")