Zilliz(
self,
embedding_function: Embeddings,
collection_name: str = 'LangChainCollection',
Evict from cache if there's an entry.
Get primary keys with expression
Update/Insert documents to the vectorstore.
| Name | Type | Description |
|---|---|---|
embedding_function* | Embeddings | Function used to embed the text. |
collection_name | str | Default: 'LangChainCollection'Which Zilliz collection to use. Defaults to "LangChainCollection". |
connection_args | Optional[dict[str, any]] | Default: None |
consistency_level | str | Default: 'Session' |
index_params | Optional[dict] | Default: None |
search_params | Optional[dict] | Default: None |
drop_old | Optional[bool] | Default: False |
auto_id | bool | Default: False |
Zilliz vector store.
You need to have pymilvus installed and a
running Zilliz database.
See the following documentation for how to run a Zilliz instance: https://docs.zilliz.com/docs/create-cluster
IF USING L2/IP metric IT IS HIGHLY SUGGESTED TO NORMALIZE YOUR DATA.
The connection args used for this class comes in the form of a dict, here are a few of the options: address (str): The actual address of Zilliz instance. Example address: "localhost:19530" uri (str): The uri of Zilliz instance. Example uri: "https://in03-ba4234asae.api.gcp-us-west1.zillizcloud.com", host (str): The host of Zilliz instance. Default at "localhost", PyMilvus will fill in the default host if only port is provided. port (str/int): The port of Zilliz instance. Default at 19530, PyMilvus will fill in the default port if only host is provided. user (str): Use which user to connect to Zilliz instance. If user and password are provided, we will add related header in every RPC call. password (str): Required when user is provided. The password corresponding to the user. token (str): API key, for serverless clusters which can be used as replacements for user and password. secure (bool): Default is false. If set to true, tls will be enabled. client_key_path (str): If use tls two-way authentication, need to write the client.key path. client_pem_path (str): If use tls two-way authentication, need to write the client.pem path. ca_pem_path (str): If use tls two-way authentication, need to write the ca.pem path. server_pem_path (str): If use tls one-way authentication, need to write the server.pem path. server_name (str): If use tls, need to write the common name.
Example:
.. code-block:: python
from langchain_community.vectorstores import Zilliz from langchain_community.embeddings import OpenAIEmbeddings
embedding = OpenAIEmbeddings()
milvus_store = Milvus( embedding_function = embedding, collection_name = "LangChainCollection", connection_args = { "uri": "https://in03-ba4234asae.api.gcp-us-west1.zillizcloud.com", "user": "temp", "password": "temp", "token": "temp", # API key as replacements for user and password "secure": True } drop_old: True, )
The connection args used for this class comes in the form of a dict.
The consistency level to use for a collection. Defaults to "Session".
Which index params to use. Defaults to HNSW/AUTOINDEX depending on service.
Which search params to use. Defaults to default of index.
Whether to drop the current collection. Defaults to False.
Whether to enable auto id for primary key. Defaults to False. If False, you needs to provide text ids (string less than 65535 bytes). If True, Milvus will generate unique integers as primary keys.