chore: bump momento dependency version and refactor search hit usage (#13111)

**Description**

Bumps the Momento dependency to the latest version and refactors the
usage of `SearchHit` in the Momento Vector Index (MVI) vector store
integration. This change is a one liner where we use the preferred
attribute `score` to read the query-document similarity instead of
`distance`. The latest versions of Momento clients will use this
attribute going forward.

**Dependencies**

Updated the Momento dependency to latest version.

**Tests**

💚 I re-ran the existing MVI integration tests
(`tests/integration_tests/vectorstores/test_momento_vector_index.py`)
and they pass.

**Review**
cc @baskaryan @eyurtsev
pull/13299/head
Michael Landis 11 months ago committed by GitHub
parent 4da2faba41
commit 2aa13f1e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -308,7 +308,7 @@ class MomentoVectorIndex(VectorStore):
for hit in response.hits:
text = cast(str, hit.metadata.pop(self.text_field))
doc = Document(page_content=text, metadata=hit.metadata)
pair = (doc, hit.distance)
pair = (doc, hit.score)
results.append(pair)
return results

@ -4708,29 +4708,29 @@ files = [
[[package]]
name = "momento"
version = "1.12.0"
version = "1.13.0"
description = "SDK for Momento"
optional = true
python-versions = ">=3.7,<4.0"
files = [
{file = "momento-1.12.0-py3-none-any.whl", hash = "sha256:1dcb3ebadba67bc5e49337c433119d3857ff2e1e36627a8fcdadcc5db9a2f785"},
{file = "momento-1.12.0.tar.gz", hash = "sha256:31918c4e56b8db2f632a465c3a7df656666b8dab9efdcd49c61f3451d7bc481d"},
{file = "momento-1.13.0-py3-none-any.whl", hash = "sha256:dd5ace5b8d679e882afcefaa16bc413973c270b0a7a1c6c45f3eb60b0b9526de"},
{file = "momento-1.13.0.tar.gz", hash = "sha256:39419627542b8f5997a777ff91aa3aaf6406b7d76fb83cd84284a0f7d1f9e356"},
]
[package.dependencies]
grpcio = ">=1.46.0,<2.0.0"
momento-wire-types = ">=0.86.0,<0.87.0"
momento-wire-types = ">=0.91.1,<0.92.0"
pyjwt = ">=2.4.0,<3.0.0"
[[package]]
name = "momento-wire-types"
version = "0.86.0"
version = "0.91.4"
description = "Momento Client Proto Generated Files"
optional = true
python-versions = ">=3.7,<4.0"
files = [
{file = "momento_wire_types-0.86.0-py3-none-any.whl", hash = "sha256:1079f61f3a0aa90865870b116a8699289e6f03b969a349265abdd605b073251c"},
{file = "momento_wire_types-0.86.0.tar.gz", hash = "sha256:7695a448382fbfda8ad7a51c307b34a2ef3d81d883f77b71891c27a4c25aed18"},
{file = "momento_wire_types-0.91.4-py3-none-any.whl", hash = "sha256:f296249693de2f6c383a397e7616b84dd83dfd466743d34b035b90865000a2a8"},
{file = "momento_wire_types-0.91.4.tar.gz", hash = "sha256:de8cd14a12835d95997eb9b753ea47e1a5d2916658ec9320e416da8bd835fdff"},
]
[package.dependencies]
@ -11006,4 +11006,4 @@ text-helpers = ["chardet"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.8.1,<4.0"
content-hash = "53e759b0e865e43984f1b1617958b4ddd27c840624e3e0763a1c8cdd79e616bb"
content-hash = "ef4fb00c31e567dea3c4a1230dfea40edc9ffcf1c2b1d30d146904f696d07a22"

@ -95,7 +95,7 @@ azure-ai-formrecognizer = {version = "^3.2.1", optional = true}
azure-ai-vision = {version = "^0.11.1b1", optional = true}
azure-cognitiveservices-speech = {version = "^1.28.0", optional = true}
py-trello = {version = "^0.19.0", optional = true}
momento = {version = "^1.10.1", optional = true}
momento = {version = "^1.13.0", optional = true}
bibtexparser = {version = "^1.4.0", optional = true}
singlestoredb = {version = "^0.7.1", optional = true}
pyspark = {version = "^3.4.0", optional = true}

Loading…
Cancel
Save