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

Methods Summary

add(nodes, **add_kwargs)

Add nodes to index.

class_name()

delete(ref_doc_id, **delete_kwargs)

Delete nodes using with ref_doc_id or ids.

describe_collection()

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#