xtrace_sdk.retrievers.simple_retriever

Classes

SimpleRetriever

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

Module Contents

class xtrace_sdk.retrievers.simple_retriever.SimpleRetriever(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(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 (list[float])

  • include_scores (bool)

  • kwargs (Any)

Return type:

Any

async nn_search_for_ids_bench(query_vector, k=3, **kwargs)
Parameters:
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