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)
This commit is contained in:
Kevin Hu 2025-03-21 14:05:59 +08:00 committed by GitHub
parent efdfb39a33
commit b5471978b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1044,7 +1044,7 @@ def add_chunk(tenant_id, dataset_id, document_id):
) )
doc = doc[0] doc = doc[0]
req = request.json req = request.json
if not req.get("content"): if not str(req.get("content", "")).strip():
return get_error_data_result(message="`content` is required") return get_error_data_result(message="`content` is required")
if "important_keywords" in req: if "important_keywords" in req:
if not isinstance(req["important_keywords"], list): if not isinstance(req["important_keywords"], list):