Skip to content

Commit

Permalink
fix variable name clash for legacy vector indexes (#6867)
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Jul 12, 2023
1 parent bad64c6 commit 1dd4bf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
- Added sources to agent/chat engine responses (#6854)
- Added basic chat buffer memory to agents / chat engines (#6857)

### Bug Fixes / Nits
- Fixed support for legacy vector store metadata (#6867)

## [v0.7.5] - 2023-07-11

### New Features
Expand Down
6 changes: 3 additions & 3 deletions llama_index/vector_stores/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ def legacy_metadata_dict_to_node(
metadata.pop("ref_doc_id", None)

# remaining metadata is metadata or node_info
metadata = {}
new_metadata = {}
for key, val in metadata.items():
# NOTE: right now we enforce metadata to be dict of simple types.
# dump anything that's not a simple type into node_info.
if isinstance(val, (str, int, float, type(None))):
metadata[key] = val
new_metadata[key] = val
else:
node_info[key] = val

return metadata, node_info, relationships
return new_metadata, node_info, relationships

0 comments on commit 1dd4bf0

Please sign in to comment.