InfinispanVS(
self,
embedding: Optional[Embeddings] = None,
ids: Optional[List| Name | Type |
|---|---|
| embedding | Optional[Embeddings] |
| ids | Optional[List[str]] |
Infinispan VectorStore interface.
This class exposes the method to present Infinispan as a VectorStore. It relies on the Infinispan class (below) which takes care of the REST interface with the server.
Example:
... code-block:: python from langchain_community.vectorstores import InfinispanVS from mymodels import RGBEmbeddings ... vectorDb = InfinispanVS.from_documents(docs, embedding=RGBEmbeddings(), output_fields=["texture", "color"], lambda_key=lambda text,meta: str(meta["_key"]), lambda_content=lambda item: item["color"])
or an empty InfinispanVS instance can be created if preliminary setup is required before populating the store
... code-block:: python from langchain_community.vectorstores import InfinispanVS from mymodels import RGBEmbeddings ... ispnVS = InfinispanVS() # configure Infinispan here # i.e. create cache and schema
# then populate the store
vectorDb = InfinispanVS.from_documents(docs,
embedding=RGBEmbeddings(),
output_fields: ["texture", "color"],
lambda_key: lambda text,meta: str(meta["_key"]),
lambda_content: lambda item: item["color"])
Deploy the schema for the vector db Args: proto(str): protobuf schema Returns: An http Response containing the result of the operation
Delete the schema for the vector db Returns: An http Response containing the result of the operation
Create the cache for the vector db Args: config(str): configuration of the cache. Returns: An http Response containing the result of the operation
Delete the cache for the vector db Returns: An http Response containing the result of the operation
Clear the cache for the vector db Returns: An http Response containing the result of the operation
Checks if the cache exists Returns: true if exists
Clear the index for the vector db Returns: An http Response containing the result of the operation
Rebuild the for the vector db Returns: An http Response containing the result of the operation
Return docs most similar to query.
Perform a search on a query string and return results with score.
Return docs most similar to embedding vector.
Return VectorStore initialized from texts and embeddings.
In addition to parameters described by the super method, this implementation provides other configuration params if different configuration from default is needed.
ids : List[str] Additional list of keys associated to the embedding. If not provided UUIDs will be generated clear_old : bool Whether old data must be deleted. Default True auto_config: bool Whether to do a complete server setup (caches, protobuf definition...). Default True kwargs: Any Rest of arguments passed to InfinispanVS. See docs