langchain/libs/core/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
..
_api core[patch]: fix validation of @deprecated decorator (#22513) 2024-06-14 16:52:30 +00:00
caches core[minor]: Add maxsize for InMemoryCache (#23405) 2024-07-01 14:21:21 -04:00
callbacks community, core[callbacks]: move FileCallbackHandler from community to core (#20495) 2024-04-17 22:29:30 -04:00
chat_history core[patch],community[patch]: Move file chat history back to community (#20834) 2024-04-24 12:47:25 -04:00
data
dependencies community[minor]: Add glue catalog loader (#20220) 2024-04-16 11:39:23 -04:00
document_loaders infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
documents core[minor]: Create BaseMedia object (#23639) 2024-07-01 15:07:30 -04:00
embeddings
example_selectors infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
examples
fake infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
indexing core[minor]: add upsert, streaming_upsert, aupsert, astreaming_upsert methods to the VectorStore abstraction (#23774) 2024-07-05 12:21:40 -04:00
language_models infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
load
messages core: add RemoveMessage (#23636) 2024-06-28 14:40:02 -07:00
output_parsers infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
outputs core[patch]: fix ChatGeneration.text with content blocks (#20294) 2024-04-10 15:54:06 -07:00
prompts core[patch]: Accounting for Optional Input Variables in BasePromptTemplate (#22851) 2024-07-05 15:49:40 +00:00
runnables core[patch]: Accounting for Optional Input Variables in BasePromptTemplate (#22851) 2024-07-05 15:49:40 +00:00
stores core[minor],langchain[patch],community[patch]: Move storage interfaces to core (#20750) 2024-04-30 13:14:26 -04:00
tracers core[minor]: Add an async root listener and with_alisteners method (#22151) 2024-06-06 16:03:44 -04:00
utils core[minor]: add upsert, streaming_upsert, aupsert, astreaming_upsert methods to the VectorStore abstraction (#23774) 2024-07-05 12:21:40 -04: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
conftest.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
prompt_file.txt
stubs.py core: Assign missing message ids in BaseChatModel (#19863) 2024-04-02 01:18:36 +00:00
test_globals.py
test_imports.py core[patch]: Speed up unit tests for imports (#23837) 2024-07-03 15:55:15 -04:00
test_messages.py core[minor]: update conversion utils to handle RemoveMessage (#23840) 2024-07-03 16:13:31 -04:00
test_outputs.py
test_sys_info.py
test_tools.py [Core] Unify function schema parsing (#23370) 2024-07-03 09:55:38 -07:00