瀏覽代碼

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.
tags/v0.20.2
jiasu 2 月之前
父節點
當前提交
23522f1ea8
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      api/apps/sdk/chat.py

+ 1
- 1
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)


Loading…
取消
儲存