mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 05:05:59 +08:00
fix: Assignment exception (#8663)
Co-authored-by: fum <fum@investoday.com.cn>
This commit is contained in:
parent
3618a97c20
commit
4c7beb9d7b
@ -75,10 +75,10 @@ class AppGenerateResponseConverter(ABC):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# show_retrieve_source
|
# show_retrieve_source
|
||||||
|
updated_resources = []
|
||||||
if "retriever_resources" in metadata:
|
if "retriever_resources" in metadata:
|
||||||
metadata["retriever_resources"] = []
|
|
||||||
for resource in metadata["retriever_resources"]:
|
for resource in metadata["retriever_resources"]:
|
||||||
metadata["retriever_resources"].append(
|
updated_resources.append(
|
||||||
{
|
{
|
||||||
"segment_id": resource["segment_id"],
|
"segment_id": resource["segment_id"],
|
||||||
"position": resource["position"],
|
"position": resource["position"],
|
||||||
@ -87,6 +87,7 @@ class AppGenerateResponseConverter(ABC):
|
|||||||
"content": resource["content"],
|
"content": resource["content"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
metadata["retriever_resources"] = updated_resources
|
||||||
|
|
||||||
# show annotation reply
|
# show annotation reply
|
||||||
if "annotation_reply" in metadata:
|
if "annotation_reply" in metadata:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user