fix: Assignment exception (#8663)

Co-authored-by: fum <fum@investoday.com.cn>
This commit is contained in:
haike-1213 2024-09-23 07:23:52 +00:00 committed by GitHub
parent 3618a97c20
commit 4c7beb9d7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,10 +75,10 @@ class AppGenerateResponseConverter(ABC):
:return:
"""
# show_retrieve_source
updated_resources = []
if "retriever_resources" in metadata:
metadata["retriever_resources"] = []
for resource in metadata["retriever_resources"]:
metadata["retriever_resources"].append(
updated_resources.append(
{
"segment_id": resource["segment_id"],
"position": resource["position"],
@ -87,6 +87,7 @@ class AppGenerateResponseConverter(ABC):
"content": resource["content"],
}
)
metadata["retriever_resources"] = updated_resources
# show annotation reply
if "annotation_reply" in metadata: