Skip to content

Commit

Permalink
community[patch]: Fix MongoDBAtlasVectorSearch max_marginal_relevance…
Browse files Browse the repository at this point in the history
…_search (langchain-ai#17971)

Description:
* `self._embedding_key` is accessed after deletion, breaking
`max_marginal_relevance_search` search
* Introduced in:
langchain-ai@e135e52
* Updated but still persists in:
langchain-ai@ce22e10

Issue: langchain-ai#17963

Co-authored-by: Bagatur <baskaryan@gmail.com>
  • Loading branch information
2 people authored and gkorland committed Mar 30, 2024
1 parent 2d07084 commit 2330dbb
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def _similarity_search_with_score(
for res in cursor:
text = res.pop(self._text_key)
score = res.pop("score")
del res[self._embedding_key]
docs.append((Document(page_content=text, metadata=res), score))
return docs

Expand Down

0 comments on commit 2330dbb

Please sign in to comment.