Skip to content

Commit

Permalink
community[patch]: Fix KeyError 'embedding' (MongoDBAtlasVectorSearch) (
Browse files Browse the repository at this point in the history
…#17178)

- **Description:**
Embedding field name was hard-coded named "embedding".
So I suggest that change `res["embedding"]` into
`res[self._embedding_key]`.
  - **Issue:** #17177,
- **Twitter handle:**
[@bagcheoljun17](https://twitter.com/bagcheoljun17)
  • Loading branch information
cjpark-data committed Feb 8, 2024
1 parent 9bb5157 commit ce22e10
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _similarity_search_with_score(
for res in cursor:
text = res.pop(self._text_key)
score = res.pop("score")
del res["embedding"]
del res[self._embedding_key]
docs.append((Document(page_content=text, metadata=res), score))
return docs

Expand Down

0 comments on commit ce22e10

Please sign in to comment.