yipao.vectorstores.qdrant.QdrantDB

class yipao.vectorstores.qdrant.QdrantDB(cfg: str, api_key: str | None = None, embedding_model: str = 'sentence-transformers/all-MiniLM-L6-v2', name_collection: str = 'ddl')[source]

Class for interacting with Qdrant, a vector store designed for handling and querying embedded documents.

__init__(cfg: str, api_key: str | None = None, embedding_model: str = 'sentence-transformers/all-MiniLM-L6-v2', name_collection: str = 'ddl')[source]

Initializes the Qdrant client based on configuration.

Parameters:
  • cfg (str) – Can be “:memory:”, “/path/to/db” or “http://host:port”.

  • api_key (str) – The API key for the Qdrant client (default is None).

Raises:

TypeError – If cfg is not a string.

Methods

__init__(cfg[, api_key, embedding_model, ...])

Initializes the Qdrant client based on configuration.

add_ddl(ddl, name_collection)

Adds a DDL statement to the Qdrant collection.

add_ddls(ddls, name_collection)

Adds multiple DDL statements to the ChromaDB collection.

check_documents(collection_name)

Checks if exist documents in a given collection.

initialize(name_collection)

Initializes the Qdrant client.

query(collection_name, query_text, n_results)

Queries the Qdrant collection with the given query texts.

reset()

Resets the database client, clearing all stored data and configurations.