Fix: "AttributeError(\"'list' object has no attribute 'get'\")" (#12518)

### What problem does this PR solve?
https://github.com/infiniflow/ragflow/issues/12515

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Stephen Hu
2026-01-09 10:19:51 +08:00
committed by GitHub
parent 9562762af2
commit f522391d1e
2 changed files with 3 additions and 1 deletions

View File

@ -425,7 +425,7 @@ async def chat_completion_openai_like(tenant_id, chat_id):
],
}
if need_reference:
response["choices"][0]["message"]["reference"] = chunks_format(answer.get("reference", []))
response["choices"][0]["message"]["reference"] = chunks_format(answer.get("reference", {}))
return jsonify(response)