mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: handle missing dataset_ids when creating chat assistant (#9324)
- Root cause: accessing req.get("dataset_ids") returns None when the key
is absent, causing KeyError.
- Fix: use req.get("dataset_ids", []) to default to empty list.
This commit is contained in:
@ -139,7 +139,7 @@ def create(tenant_id):
|
|||||||
res["llm"] = res.pop("llm_setting")
|
res["llm"] = res.pop("llm_setting")
|
||||||
res["llm"]["model_name"] = res.pop("llm_id")
|
res["llm"]["model_name"] = res.pop("llm_id")
|
||||||
del res["kb_ids"]
|
del res["kb_ids"]
|
||||||
res["dataset_ids"] = req["dataset_ids"]
|
res["dataset_ids"] = req.get("dataset_ids", [])
|
||||||
res["avatar"] = res.pop("icon")
|
res["avatar"] = res.pop("icon")
|
||||||
return get_result(data=res)
|
return get_result(data=res)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user