mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-27 00:48:45 +00:00
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:
parent
786ef021a3
commit
25f2e25be1
@ -20,7 +20,7 @@ from ..utils import PatchedMongoDBAtlasVectorSearch
|
|||||||
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
|
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
|
||||||
DB_NAME = "langchain_test_db"
|
DB_NAME = "langchain_test_db"
|
||||||
COLLECTION_NAME = "langchain_test_chain_example"
|
COLLECTION_NAME = "langchain_test_chain_example"
|
||||||
INDEX_NAME = "vector_index_with_filter"
|
INDEX_NAME = "vector_index"
|
||||||
DIMENSIONS = 1536
|
DIMENSIONS = 1536
|
||||||
TIMEOUT = 60.0
|
TIMEOUT = 60.0
|
||||||
INTERVAL = 0.5
|
INTERVAL = 0.5
|
||||||
|
@ -9,6 +9,10 @@ from pymongo.collection import Collection
|
|||||||
|
|
||||||
from langchain_mongodb import index
|
from langchain_mongodb import index
|
||||||
|
|
||||||
|
DB_NAME = "langchain_test_index_db"
|
||||||
|
COLLECTION_NAME = "test_index"
|
||||||
|
VECTOR_INDEX_NAME = "vector_index"
|
||||||
|
|
||||||
TIMEOUT = 120
|
TIMEOUT = 120
|
||||||
DIMENSIONS = 10
|
DIMENSIONS = 10
|
||||||
|
|
||||||
@ -18,14 +22,14 @@ def collection() -> Generator:
|
|||||||
"""Depending on uri, this could point to any type of cluster."""
|
"""Depending on uri, this could point to any type of cluster."""
|
||||||
uri = os.environ.get("MONGODB_ATLAS_URI")
|
uri = os.environ.get("MONGODB_ATLAS_URI")
|
||||||
client: MongoClient = MongoClient(uri)
|
client: MongoClient = MongoClient(uri)
|
||||||
clxn = client["db"]["collection"]
|
clxn = client[DB_NAME][COLLECTION_NAME]
|
||||||
clxn.insert_one({"foo": "bar"})
|
clxn.insert_one({"foo": "bar"})
|
||||||
yield clxn
|
yield clxn
|
||||||
clxn.drop()
|
clxn.drop()
|
||||||
|
|
||||||
|
|
||||||
def test_search_index_commands(collection: Collection) -> None:
|
def test_search_index_commands(collection: Collection) -> None:
|
||||||
index_name = "vector_index"
|
index_name = VECTOR_INDEX_NAME
|
||||||
dimensions = DIMENSIONS
|
dimensions = DIMENSIONS
|
||||||
path = "embedding"
|
path = "embedding"
|
||||||
similarity = "cosine"
|
similarity = "cosine"
|
||||||
|
@ -18,7 +18,7 @@ from ..utils import ConsistentFakeEmbeddings, PatchedMongoDBAtlasVectorSearch
|
|||||||
|
|
||||||
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
|
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
|
||||||
DB_NAME = "langchain_test_db"
|
DB_NAME = "langchain_test_db"
|
||||||
COLLECTION_NAME = "test_retrievers"
|
COLLECTION_NAME = "langchain_test_retrievers"
|
||||||
VECTOR_INDEX_NAME = "vector_index"
|
VECTOR_INDEX_NAME = "vector_index"
|
||||||
EMBEDDING_FIELD = "embedding"
|
EMBEDDING_FIELD = "embedding"
|
||||||
PAGE_CONTENT_FIELD = "text"
|
PAGE_CONTENT_FIELD = "text"
|
||||||
|
Loading…
Reference in New Issue
Block a user