From 61d1d2171ab1c1bbb09033b80987556f682d0baf Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Wed, 4 Dec 2024 15:37:15 -0500 Subject: [PATCH] nits --- .../how_to/integrations/vector_stores.mdx | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/docs/contributing/how_to/integrations/vector_stores.mdx b/docs/docs/contributing/how_to/integrations/vector_stores.mdx index edb4811d903cf..b189f0f7a5570 100644 --- a/docs/docs/contributing/how_to/integrations/vector_stores.mdx +++ b/docs/docs/contributing/how_to/integrations/vector_stores.mdx @@ -436,7 +436,7 @@ for all supported methods. The required methods are tabulated below: | `add_documents` | Add documents to the vector store. | | `delete` | Delete selected documents from vector store (by IDs) | | `get_by_ids` | Get selected documents from vector store (by IDs) | -| `similarity_search | Get documents most similar to a query. | +| `similarity_search` | Get documents most similar to a query. | | `embeddings` (property) | Embeddings object for vector store. | | `from_texts` | Instantiate vector store via adding texts. | @@ -465,7 +465,6 @@ configure what vector store implementation is tested. First we need to install certain dependencies. These include: - `pytest`: For running tests -- `pytest-socket`: For running unit tests - `pytest-asyncio`: For testing async functionality - `langchain-tests`: For importing standard tests - `langchain-core`: This should already be installed, but is needed to define our integration. @@ -474,16 +473,11 @@ If you followed the previous [bootstrapping guide](/docs/contributing/how_to/int these should already be installed. ### Add and configure standard tests -There are two namespaces in the langchain-tests package: -- [Unit tests](../../../concepts/testing.mdx#unit-tests) (`langchain_tests.unit_tests`): designed to be used to test the component in isolation and without access to external services -- [Integration tests](../../../concepts/testing.mdx#integration-tests) (`langchain_tests.integration_tests`): designed to be used to test the component with access to external services (in particular, the external service that the component is designed to interact with). - -Both types of tests are implemented as [pytest class-based test suites](https://docs.pytest.org/en/7.1.x/getting-started.html#group-multiple-tests-in-a-class). - -By subclassing the base classes for each type of standard test (see below), you get -all of the standard tests for that type, and you can override the properties that the -test suite uses to configure the tests. +The `langchain-test` package implements suites of tests for testing vector store +integrations. By subclassing the base classes for each standard test (see below), you +get all of the standard tests for that type, and you can override the properties that +the test suite uses to configure the tests. Here's how you would configure the standard tests for a typical vector store (using `ParrotVectorStore` as a placeholder): @@ -505,7 +499,7 @@ from langchain_standard_tests.integration_tests.vectorstores import ( class TestSync(ReadWriteTestSuite): @pytest.fixture() def vectorstore(self) -> Generator[VectorStore, None, None]: # type: ignore - """Get an empty vectorstore for unit tests.""" + """Get an empty vectorstore.""" store = ParrotVectorStore() # note: store should be EMPTY at this point # if you need to delete data, you may do so here @@ -519,7 +513,7 @@ class TestSync(ReadWriteTestSuite): class TestAsync(AsyncReadWriteTestSuite): @pytest.fixture() async def vectorstore(self) -> AsyncGenerator[VectorStore, None]: # type: ignore - """Get an empty vectorstore for unit tests.""" + """Get an empty vectorstore.""" store = ParrotVectorStore() # note: store should be EMPTY at this point # if you need to delete data, you may do so here @@ -550,7 +544,7 @@ from langchain_chroma import Chroma class TestSync(ReadWriteTestSuite): @pytest.fixture() def vectorstore(self) -> Generator[VectorStore, None, None]: # type: ignore - """Get an empty vectorstore for unit tests.""" + """Get an empty vectorstore.""" store = Chroma(embedding_function=self.get_embeddings()) try: yield store @@ -587,4 +581,4 @@ Each test method documents: This information along with the full set of tests that run can be found in the API reference. See details: -[Integration tests API reference](https://python.langchain.com/api_reference/standard_tests/integration_tests/langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.html) +[Test class API reference](https://python.langchain.com/api_reference/standard_tests/integration_tests/langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.html)