Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: handle missing dataset_ids when creating chat assistant (#9324)

jiasu23522f1ea83f
diff --git a/api/apps/sdk/chat.py b/api/apps/sdk/chat.py
index 23231bc529..edf5e26994 100644
--- a/api/apps/sdk/chat.py
+++ b/api/apps/sdk/chat.py
@@ -139,7 +139,7 @@ def create(tenant_id):
res["llm"] = res.pop("llm_setting")
res["llm"]["model_name"] = res.pop("llm_id")
del res["kb_ids"]
- res["dataset_ids"] = req["dataset_ids"]
+ res["dataset_ids"] = req.get("dataset_ids", [])
res["avatar"] = res.pop("icon")
return get_result(data=res)