SuperSCC.rag.ConnectRAG

class SuperSCC.rag.ConnectRAG(host, api_key, location, url, collection_name, embedding_model)[source]

Establishes a connection to the Qdrant vector store using the provided details.

Parameters:
  • (dict (encode_kwargs) – Keyword arguments for loading the Hugging Face embedding model. Defaults to {“device”: “cpu”}.

  • optional) – Keyword arguments for loading the Hugging Face embedding model. Defaults to {“device”: “cpu”}.

  • (dict – Keyword arguments for the embedding model’s encoding process. Defaults to {“normalize_embeddings”: True}.

  • optional) – Keyword arguments for the embedding model’s encoding process. Defaults to {“normalize_embeddings”: True}.

  • (int (timeout) – The request timeout in seconds for the Qdrant client. Defaults to 1000.

  • optional) – The request timeout in seconds for the Qdrant client. Defaults to 1000.

__init__(host, api_key, location, url, collection_name, embedding_model)[source]

Methods

__init__(host, api_key, location, url, ...)

add_documents(file_path, file_type[, ...])

change_text_embedding(model_name[, ...])

connect_client([model_kwargs, ...])

Establishes a connection to the Qdrant vector store using the provided details.

create_rag_chain(vector_store, model, ...[, ...])

data_loader(file_path[, mode, metadata_columns])

format_docs(docs)

get_all_ids()

get_answer(gene_list[, query, ...])

The main entry point for asking a question.

get_relevant_segments()

highlight_docs()

hybrid_search([hierarchy_search, key, value])

recursive_search(path[, type])

refine_query()

rerank([model, top_n])

run_rag(llm_model, llm_api_key, llm_base_url)

Initializes the RAG chain using the established connection to the vector store.

score_documents([docs])

summary_res(res)

text_encode(text, model_name, location[, ...])

text_split(docs[, chunk_size, ...])

translator([query])

update_rag_chain([model, api_key, base_url, ...])

Updates components of the existing RAG chain, such as the LLM or prompt.