mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 21:43:44 +00:00
langchain[minor]: allow CacheBackedEmbeddings to cache queries (#20073)
Add optional caching of queries to cache backed embeddings
This commit is contained in:
@@ -18,11 +18,12 @@
|
||||
"- document_embedding_cache: Any [`ByteStore`](/docs/integrations/stores/) for caching document embeddings.\n",
|
||||
"- batch_size: (optional, defaults to `None`) The number of documents to embed between store updates.\n",
|
||||
"- namespace: (optional, defaults to `\"\"`) The namespace to use for document cache. This namespace is used to avoid collisions with other caches. For example, set it to the name of the embedding model used.\n",
|
||||
"- query_embedding_cache: (optional, defaults to `None` or not caching) A [`ByteStore`](/docs/integrations/stores/) for caching query embeddings, or `True` to use the same store as `document_embedding_cache`.\n",
|
||||
"\n",
|
||||
"**Attention**:\n",
|
||||
"\n",
|
||||
"- Be sure to set the `namespace` parameter to avoid collisions of the same text embedded using different embeddings models.\n",
|
||||
"- Currently `CacheBackedEmbeddings` does not cache embedding created with `embed_query()` `aembed_query()` methods."
|
||||
"- `CacheBackedEmbeddings` does not cache query embeddings by default. To enable query caching, one need to specify a `query_embedding_cache`."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user