xtrace_sdk.retrievers.parallel_retriever

Classes

ParallelRetriever

This class is a simple retriever that uses hamming distance to find the most similar context data.

Functions

decode_item(homomorphic_client, ciphertext)

Decodes a single ciphertext using the provided client.

Module Contents

xtrace_sdk.retrievers.parallel_retriever.decode_item(homomorphic_client, ciphertext)

Decodes a single ciphertext using the provided client.

Parameters:
  • homomorphic_client (Any)

  • ciphertext (Any)

Return type:

Any

class xtrace_sdk.retrievers.parallel_retriever.ParallelRetriever(execution_context, integration)

Bases: xtrace_sdk.retrievers.base.RetrieverBase

This class is a simple retriever that uses hamming distance to find the most similar context data.

Parameters:
execution_context
integration
async nn_search_for_ids_bench(query_vector, k=3, **kwargs)
Parameters:
  • query_vector (Any)

  • k (int)

  • kwargs (Any)

Return type:

Any

async nn_search_for_ids(query_vector, k=3, include_scores=False, **kwargs)

Given an encrypted prompt, return the k most similar encrypted contexts.

Parameters:
  • prompt (ciphertext) – encrypted prompt

  • k (int, optional) – the number of most similar context data to return, defaults to 3

  • query_vector (Any)

  • include_scores (bool)

  • kwargs (Any)

Return type:

Any

async retrieve_and_decrypt(chunk_ids, **kwargs)

Given a list of chunk ids, return the decrypted contexts.

Parameters:
  • chunk_ids (list[str]) – list of chunk ids

  • kwargs (Any)

Return type:

Any