langchain/libs/community/tests/unit_tests
Eugene Yurtsev 6f08e11d7c
core[minor]: add upsert, streaming_upsert, aupsert, astreaming_upsert methods to the VectorStore abstraction (#23774)
This PR rolls out part of the new proposed interface for vectorstores
(https://github.com/langchain-ai/langchain/pull/23544) to existing store
implementations.

The PR makes the following changes:

1. Adds standard upsert, streaming_upsert, aupsert, astreaming_upsert
methods to the vectorstore.
2. Updates `add_texts` and `aadd_texts` to be non required with a
default implementation that delegates to `upsert` and `aupsert` if those
have been implemented. The original `add_texts` and `aadd_texts` methods
are problematic as they spread object specific information across
document and **kwargs. (e.g., ids are not a part of the document)
3. Adds a default implementation to `add_documents` and `aadd_documents`
that delegates to `upsert` and `aupsert` respectively.
4. Adds standard unit tests to verify that a given vectorstore
implements a correct read/write API.

A downside of this implementation is that it creates `upsert` with a
very similar signature to `add_documents`.
The reason for introducing `upsert` is to:
* Remove any ambiguities about what information is allowed in `kwargs`.
Specifically kwargs should only be used for information common to all
indexed data. (e.g., indexing timeout).
*Allow inheriting from an anticipated generalized interface for indexing
that will allow indexing `BaseMedia` (i.e., allow making a vectorstore
for images/audio etc.)
 
`add_documents` can be deprecated in the future in favor of `upsert` to
make sure that users have a single correct way of indexing content.

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
2024-07-05 12:21:40 -04:00
..
agent_toolkits community[patch]: Fix requests alias for load_tools (#23734) 2024-07-01 15:02:14 -07:00
agents infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
callbacks infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
chains infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
chat_loaders infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
chat_message_histories community[patch]: restore compatibility with SQLAlchemy 1.x (#22546) 2024-06-19 17:58:57 +00:00
chat_models infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
cross_encoders community[patch]: cross_encoders flatten namespaces (#20183) 2024-04-08 20:50:23 -04:00
data community[patch]: Adding HEADER to the list of supported locations (#21946) 2024-05-22 22:47:56 +00:00
docstore infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
document_compressors community[minor]: add Volcengine Rerank (#22700) 2024-06-10 13:41:05 -07:00
document_loaders infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
document_transformers infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
embeddings infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
evaluation infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
examples community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
graphs community[minor]: add graph store implementation for apache age (#20582) 2024-04-20 14:31:04 -07:00
imports community[minor]: Adds a vector store for Azure Cosmos DB for NoSQL (#21676) 2024-06-11 10:34:01 -07:00
indexes community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
llms infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
load core: add RemoveMessage (#23636) 2024-06-28 14:40:02 -07:00
query_constructors multiple: langchain 0.2 in master (#21191) 2024-05-08 16:46:52 -04:00
retrievers infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
storage infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
tools infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
utilities community[major], experimental[patch]: Remove Python REPL from community (#22904) 2024-06-14 17:53:29 +00:00
utils infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
vectorstores core[minor]: add upsert, streaming_upsert, aupsert, astreaming_upsert methods to the VectorStore abstraction (#23774) 2024-07-05 12:21:40 -04:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
conftest.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_cache.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_dependencies.py community[patch]: Test InMemoryVectorStore with RWAPI test suite (#23603) 2024-06-27 16:43:43 -04:00
test_document_transformers.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_imports.py community[patch]: Fix remaining __inits__ in community (#22037) 2024-05-22 17:42:17 +00:00
test_sql_database_schema.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
test_sql_database.py community[patch]: restore compatibility with SQLAlchemy 1.x (#22546) 2024-06-19 17:58:57 +00:00
test_sqlalchemy.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00