langchain/libs/core/langchain_core
Eugene Yurtsev 4f1821db3e
core[minor]: Add get_by_ids to vectorstore interface (#23594)
This PR adds a part of the indexing API proposed in this RFC
https://github.com/langchain-ai/langchain/pull/23544/files.

It allows rolling out `get_by_ids` which should be uncontroversial to
existing vectorstores without introducing new abstractions.

The semantics for this method depend on the ability of identifying
returned documents using the new optional ID field on documents:
https://github.com/langchain-ai/langchain/pull/23411

Alternatives are:

1. Relax the sequence requirement

```python
def get_by_ids(self, ids: Iterable[str], /) -> Iterable[Document]:
```

Rejected:
- implementations are more likley to start batching with bad defaults
- users would need to call list() or we'd need to introduce another
convenience method

2. Support more kwargs

```python

def get_by_ids(self, ids: Sequence[str], /, **kwargs) -> List[Document]:
...
```

Rejected: 
- No need for `batch` parameter since IDs is a sequence
- Output cannot be customized since `Document` is fixed. (e.g.,
parameters could be useful to grab extra metadata like the vector that
was indexed with the Document or to project a part of the document)
2024-07-01 13:04:33 -04:00
..
_api core[patch]: fix validation of @deprecated decorator (#22513) 2024-06-14 16:52:30 +00:00
beta core: Updated docstring for Context class (#19079) 2024-03-18 21:15:14 -07:00
callbacks core[patch]: callbacks docstrings (#23375) 2024-06-26 17:11:06 -04:00
document_loaders core[minor]: Add aload to document loader (#19936) 2024-04-03 10:46:47 -04:00
documents core[minor]: Add optional ID field to Document schema (#23411) 2024-06-27 12:15:58 -04:00
embeddings core[patch]: Document embeddings namespace (#23132) 2024-06-19 10:11:16 -04:00
example_selectors core: docstrings example_selectors (#23542) 2024-06-26 17:10:40 -04:00
indexing core[minor]: Adds an in-memory implementation of RecordManager (#13200) 2024-06-20 12:19:10 -04:00
language_models [docs]: split up tool docs (#22919) 2024-06-25 13:15:08 -07:00
load core: add RemoveMessage (#23636) 2024-06-28 14:40:02 -07:00
messages core: add RemoveMessage (#23636) 2024-06-28 14:40:02 -07:00
output_parsers core[patch]: export tool output parsers from langchain_core.output_parsers (#23305) 2024-06-25 14:40:42 -04:00
outputs core[patch]: Add doc-strings to outputs, fix @root_validator (#23190) 2024-06-19 14:59:06 -04:00
prompts core(patch): Fix encoding problem of load_prompt method (#21559) 2024-06-20 09:25:54 -07:00
pydantic_v1 multiple: get rid of pyproject extras (#22581) 2024-06-06 15:45:22 -07:00
runnables core[patch]: Add unit test when catching generator exit (#23402) 2024-06-27 20:36:07 +00:00
tracers [Core] Logging: Suppress missing parent warning (#23363) 2024-06-25 14:57:23 -04:00
utils [Core] Add support for inferring Annotated types (#23284) 2024-06-21 15:16:30 -07:00
__init__.py core[patch], community[patch]: mark runnable context, lc load as beta (#15603) 2024-01-05 17:54:26 -05:00
agents.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
caches.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
chat_history.py core: chat_* docstrings (#23412) 2024-06-27 17:29:38 -04:00
chat_loaders.py core: chat_* docstrings (#23412) 2024-06-27 17:29:38 -04:00
chat_sessions.py core: chat_* docstrings (#23412) 2024-06-27 17:29:38 -04:00
env.py core[patch]: update langchain-core runtime library name (#14884) 2023-12-20 14:35:48 -08:00
exceptions.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
globals.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
memory.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
prompt_values.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
py.typed core[minor], langchain[patch], experimental[patch]: Added missing py.typed to langchain_core (#14143) 2023-12-01 19:15:23 -08:00
retrievers.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
stores.py core[patch]: docstrings agents (#23502) 2024-06-26 17:50:48 -04:00
structured_query.py core[patch[: docstring update (#21036) 2024-04-29 15:35:34 -04:00
sys_info.py docs: modules descriptions (#17844) 2024-02-21 15:58:21 -08:00
tools.py core[patch]: use args_schema doc for tool description (#23503) 2024-06-25 15:26:35 -07:00
vectorstores.py core[minor]: Add get_by_ids to vectorstore interface (#23594) 2024-07-01 13:04:33 -04:00