Fix: update chunk, empty question issue. (#6800)

### What problem does this PR solve?

fix issue #6539, refer to pr #6405

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
liu an 2025-04-03 18:04:19 +08:00 committed by GitHub
parent b213e88cca
commit 57e760883e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1262,7 +1262,7 @@ def update_chunk(tenant_id, dataset_id, document_id, chunk_id):
if "questions" in req:
if not isinstance(req["questions"], list):
return get_error_data_result("`questions` should be a list")
d["question_kwd"] = req.get("questions")
d["question_kwd"] = [str(q).strip() for q in req.get("questions", []) if str(q).strip()]
d["question_tks"] = rag_tokenizer.tokenize("\n".join(req["questions"]))
if "available" in req:
d["available_int"] = int(req["available"])