TencentVectorDB#
- class llama_index.vector_stores.TencentVectorDB(url: str, key: str, username: str = 'root', database_name: str = 'llama_default_database', read_consistency: str = 'eventualConsistency', collection_params: ~llama_index.vector_stores.tencentvectordb.CollectionParams = <llama_index.vector_stores.tencentvectordb.CollectionParams object>, batch_size: int = 512, **kwargs: ~typing.Any)#
Bases:
VectorStore
Tencent Vector Store.
In this vector store, embeddings and docs are stored within a Collection. If the Collection does not exist, it will be automatically created.
In order to use this you need to have a database instance. See the following documentation for details: https://cloud.tencent.com/document/product/1709/94951
- Parameters
url (Optional[str]) β url of Tencent vector database
username (Optional[str]) β The username for Tencent vector database. Default value is βrootβ
key (Optional[str]) β The Api-Key for Tencent vector database
collection_params (Optional[CollectionParams]) β The collection parameters for vector database
Attributes Summary
Get client.
Methods Summary
add
(nodes, **add_kwargs)Add nodes to index.
delete
(ref_doc_id, **delete_kwargs)Delete nodes using with ref_doc_id or ids.
from_params
(url, key[, username, ...])query
(query, **kwargs)Query index for top k most similar nodes.
query_by_ids
(ids)truncate
()Attributes Documentation
- client#
Get client.
- filter_fields: List[FilterField] = []#
- stores_text: bool = True#
Methods Documentation
- add(nodes: List[BaseNode], **add_kwargs: Any) List[str] #
Add nodes to index.
- Parameters
nodes β List[BaseNode]: list of nodes with embeddings
- classmethod class_name() str #
- delete(ref_doc_id: str, **delete_kwargs: Any) None #
Delete nodes using with ref_doc_id or ids.
- Parameters
ref_doc_id (str) β The doc_id of the document to delete.
- describe_collection() Any #
- classmethod from_params(url: str, key: str, username: str = 'root', database_name: str = 'llama_default_database', read_consistency: str = 'eventualConsistency', collection_params: ~llama_index.vector_stores.tencentvectordb.CollectionParams = <llama_index.vector_stores.tencentvectordb.CollectionParams object>, batch_size: int = 512, **kwargs: ~typing.Any) TencentVectorDB #
- query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult #
Query index for top k most similar nodes.
- Parameters
query (VectorStoreQuery) β contains query_embedding (List[float]): query embedding similarity_top_k (int): top k most similar nodes doc_ids (Optional[List[str]]): filter by doc_id filters (Optional[MetadataFilters]): filter result
kwargs.filter (Optional[str|Filter]) β
kwargs (if kwargs in) β using filter: age > 20 and author in (β¦) and β¦
query.filters (elif) β using filter: β and β.join([fβ{f.key} = β{f.value}ββ for f in query.filters.filters])
query.doc_ids (elif) β using filter: doc_id in (query.doc_ids)
- query_by_ids(ids: List[str]) List[Dict] #
- truncate() None #