mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-25 01:16:55 +00:00
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?