langchain/libs
Philippe PRADOS 2d4689d721
langchain[minor]: Add pgvector to list of supported vectorstores in self query retriever (#22678)
The fact that we outsourced pgvector to another project has an
unintended effect. The mapping dictionary found by
`_get_builtin_translator()` cannot recognize the new version of pgvector
because it comes from another package.
`SelfQueryRetriever` no longer knows `PGVector`.

I propose to fix this by creating a global dictionary that can be
populated by various database implementations. Thus, importing
`langchain_postgres` will allow the registration of the `PGvector`
mapping.

But for the moment I'm just adding a lazy import

Furthermore, the implementation of _get_builtin_translator()
reconstructs the BUILTIN_TRANSLATORS variable with each invocation,
which is not very efficient. A global map would be an optimization.

- **Twitter handle:** pprados

@eyurtsev, can you review this PR? And unlock the PR [Add async mode for
pgvector](https://github.com/langchain-ai/langchain-postgres/pull/32)
and PR [community[minor]: Add SQL storage
implementation](https://github.com/langchain-ai/langchain/pull/22207)?

Are you in favour of a global dictionary-based implementation of
Translator?
2024-06-10 11:27:47 -04:00
..
cli couchbase: Add the initial version of Couchbase partner package (#22087) 2024-06-07 14:04:08 -07:00
community community[patch]: Use Custom Logger Instead of Root Logger in get_user_agent Function (#22691) 2024-06-08 02:33:07 +00:00
core core: add error message for non-structured llm to StructuredPrompt (#22684) 2024-06-07 19:42:09 +00:00
experimental multiple: get rid of pyproject extras (#22581) 2024-06-06 15:45:22 -07:00
langchain langchain[minor]: Add pgvector to list of supported vectorstores in self query retriever (#22678) 2024-06-10 11:27:47 -04:00
partners couchbase: Add the initial version of Couchbase partner package (#22087) 2024-06-07 14:04:08 -07:00
standard-tests multiple: add stop attribute (#22573) 2024-06-06 12:11:52 -04:00
text-splitters multiple: get rid of pyproject extras (#22581) 2024-06-06 15:45:22 -07:00