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)
pull/17252/head^2
cjpark-data 8 months ago committed by GitHub
parent 9bb5157a3d
commit ce22e10c4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -209,7 +209,7 @@ class MongoDBAtlasVectorSearch(VectorStore):
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

Loading…
Cancel
Save