The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
langchain-mongodb: Standardize mongodb collection/index names in tests (#18755)
Jibd60e93b6aea5
diff --git a/libs/partners/mongodb/tests/integration_tests/test_cache.py b/libs/partners/mongodb/tests/integration_tests/test_cache.pyindex 52cd1dfd64..c7618c4ea2 100644--- a/libs/partners/mongodb/tests/integration_tests/test_cache.py+++ b/libs/partners/mongodb/tests/integration_tests/test_cache.py@@ -13,8 +13,9 @@ from langchain_mongodb.cache import MongoDBAtlasSemanticCache, MongoDBCachefrom tests.utils import ConsistentFakeEmbeddings, FakeChatModel, FakeLLMCONN_STRING = os.environ.get("MONGODB_ATLAS_URI")-COLLECTION = "default"-DATABASE = "default"+INDEX_NAME = "langchain-test-index-semantic-cache"+DATABASE = "langchain_test_db"+COLLECTION = "langchain_test_cache"def random_string() -> str:diff --git a/libs/partners/mongodb/tests/integration_tests/test_chat_message_histories.py b/libs/partners/mongodb/tests/integration_tests/test_chat_message_histories.pyindex 376422afff..0454f86554 100644--- a/libs/partners/mongodb/tests/integration_tests/test_chat_message_histories.py+++ b/libs/partners/mongodb/tests/integration_tests/test_chat_message_histories.py@@ -6,6 +6,9 @@ from langchain_core.messages import message_to_dictfrom langchain_mongodb.chat_message_histories import MongoDBChatMessageHistory+DATABASE = "langchain_test_db"+COLLECTION = "langchain_test_chat"+# Replace these with your mongodb connection stringconnection_string = os.environ.get("MONGODB_ATLAS_URI", "")@@ -14,7 +17,10 @@ def test_memory_with_message_store() -> None:"""Test the memory with a message store."""# setup MongoDB as a message storemessage_history = MongoDBChatMessageHistory(- connection_string=connection_string, session_id="test-session"+ connection_string=connection_string,+ session_id="test-session",+ database_name=DATABASE,+ collection_name=COLLECTION,)memory = ConversationBufferMemory(memory_key="baz", chat_memory=message_history, return_messages=Truediff --git a/libs/partners/mongodb/tests/integration_tests/test_vectorstores.py b/libs/partners/mongodb/tests/integration_tests/test_vectorstores.pyindex 8c747fb48c..b4b3fd28d4 100644--- a/libs/partners/mongodb/tests/integration_tests/test_vectorstores.py+++ b/libs/partners/mongodb/tests/integration_tests/test_vectorstores.py@@ -15,8 +15,8 @@ from pymongo.collection import Collectionfrom langchain_mongodb import MongoDBAtlasVectorSearchfrom tests.utils import ConsistentFakeEmbeddings-INDEX_NAME = "langchain-test-index"-NAMESPACE = "langchain_test_db.langchain_test_collection"+INDEX_NAME = "langchain-test-index-vectorstores"+NAMESPACE = "langchain_test_db.langchain_test_vectorstores"CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")DB_NAME, COLLECTION_NAME = NAMESPACE.split(".")DIMENSIONS = 1536