From b5471978b04110b535492168d66b1991a013b121 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 21 Mar 2025 14:05:59 +0800 Subject: [PATCH] Fix: add chunk api, empty content issue (#6390) ### What problem does this PR solve? #6387 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/sdk/doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/apps/sdk/doc.py b/api/apps/sdk/doc.py index e01e2dd95..614d4ab57 100644 --- a/api/apps/sdk/doc.py +++ b/api/apps/sdk/doc.py @@ -1044,7 +1044,7 @@ def add_chunk(tenant_id, dataset_id, document_id): ) doc = doc[0] req = request.json - if not req.get("content"): + if not str(req.get("content", "")).strip(): return get_error_data_result(message="`content` is required") if "important_keywords" in req: if not isinstance(req["important_keywords"], list):