partners[patch]: Mongodb Retrievers - CI final touches. (#25202)

## Description

Contains 2 updates to for integration tests to run on langchain's CI.
Addendum to #25057 to get release github action to succeed.
This commit is contained in:
Casey Clements 2024-08-08 18:38:31 -04:00 committed by GitHub
parent 786ef021a3
commit 25f2e25be1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

@ -20,7 +20,7 @@ from ..utils import PatchedMongoDBAtlasVectorSearch
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
DB_NAME = "langchain_test_db"
COLLECTION_NAME = "langchain_test_chain_example"
INDEX_NAME = "vector_index_with_filter"
INDEX_NAME = "vector_index"
DIMENSIONS = 1536
TIMEOUT = 60.0
INTERVAL = 0.5

View File

@ -9,6 +9,10 @@ from pymongo.collection import Collection
from langchain_mongodb import index
DB_NAME = "langchain_test_index_db"
COLLECTION_NAME = "test_index"
VECTOR_INDEX_NAME = "vector_index"
TIMEOUT = 120
DIMENSIONS = 10
@ -18,14 +22,14 @@ def collection() -> Generator:
"""Depending on uri, this could point to any type of cluster."""
uri = os.environ.get("MONGODB_ATLAS_URI")
client: MongoClient = MongoClient(uri)
clxn = client["db"]["collection"]
clxn = client[DB_NAME][COLLECTION_NAME]
clxn.insert_one({"foo": "bar"})
yield clxn
clxn.drop()
def test_search_index_commands(collection: Collection) -> None:
index_name = "vector_index"
index_name = VECTOR_INDEX_NAME
dimensions = DIMENSIONS
path = "embedding"
similarity = "cosine"

View File

@ -18,7 +18,7 @@ from ..utils import ConsistentFakeEmbeddings, PatchedMongoDBAtlasVectorSearch
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
DB_NAME = "langchain_test_db"
COLLECTION_NAME = "test_retrievers"
COLLECTION_NAME = "langchain_test_retrievers"
VECTOR_INDEX_NAME = "vector_index"
EMBEDDING_FIELD = "embedding"
PAGE_CONTENT_FIELD = "text"