fix rag ut failed cases

This commit is contained in:
betterwang 2024-03-07 14:37:26 +08:00
parent 184b0127e5
commit f327798e00
4 changed files with 7 additions and 5 deletions

View file

@ -176,6 +176,6 @@ class SimpleEngine(RetrieverQueryEngine):
def _try_reconstruct_obj(nodes: list[NodeWithScore]):
"""If node is object, then dynamically reconstruct object, and save object to node.metadata["obj"]."""
for node in nodes:
if node.metadata.get("is_obj"):
if node.metadata.get("is_obj", False):
obj_cls = import_class(node.metadata["obj_cls_name"], node.metadata["obj_mod_name"])
node.metadata["obj"] = obj_cls(**node.metadata["obj_dict"])