mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
community[patch]: Fix KeyError 'embedding' (MongoDBAtlasVectorSearch) (#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)
This commit is contained in:
parent
9bb5157a3d
commit
ce22e10c4b
@ -209,7 +209,7 @@ class MongoDBAtlasVectorSearch(VectorStore):
|
|||||||
for res in cursor:
|
for res in cursor:
|
||||||
text = res.pop(self._text_key)
|
text = res.pop(self._text_key)
|
||||||
score = res.pop("score")
|
score = res.pop("score")
|
||||||
del res["embedding"]
|
del res[self._embedding_key]
|
||||||
docs.append((Document(page_content=text, metadata=res), score))
|
docs.append((Document(page_content=text, metadata=res), score))
|
||||||
return docs
|
return docs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user