From e8d74108a575ac2db53f663789baef3e8663c1a2 Mon Sep 17 00:00:00 2001 From: Roccat <153699410+lizheng419@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:00:34 +0800 Subject: [PATCH] Fix: Completion AttributeError: 'list' object has no attribute 'get' (#3999) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: lizheng@ssc-hn.com --- api/apps/conversation_app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/apps/conversation_app.py b/api/apps/conversation_app.py index 09245bc0897..e07a46da339 100644 --- a/api/apps/conversation_app.py +++ b/api/apps/conversation_app.py @@ -187,6 +187,8 @@ def get_value(d, k1, k2): return d.get(k1, d.get(k2)) for ref in conv.reference: + if isinstance(ref, list): + continue ref["chunks"] = [{ "id": get_value(ck, "chunk_id", "id"), "content": get_value(ck, "content", "content_with_weight"),