xtrace_sdk.retrievers.base
Attributes
Classes
This class is interface for all retrievers. |
Module Contents
- xtrace_sdk.retrievers.base.TInt
- class xtrace_sdk.retrievers.base.RetrieverBase(execution_context, integration, **kwargs)
Bases:
abc.ABCThis class is interface for all retrievers.
- Parameters:
ABC (class) – abstract base class
execution_context (xtrace_sdk.utils.execution_context.ExecutionContext)
integration (Type[xtrace_sdk.integrations.base.IntegrationBase])
kwargs (Any)
- execution_context
- integration
- classmethod _from_disk(path_to_execution_context, passphrase, integration)
Construct a Retriever instance from saved execution context on disk.
- Parameters:
path_to_execution_context (str) – the path to execution context saved on disk
passphrase (str)
integration (Type[xtrace_sdk.integrations.base.IntegrationBase])
- Returns:
a Retriever instance.
- Return type:
Retriever
- classmethod _from_remote(path_to_execution_context, passphrase, integration)
- Parameters:
path_to_execution_context (str)
passphrase (str)
integration (Type[xtrace_sdk.integrations.base.IntegrationBase])
- Return type:
Any
- abstractmethod nn_search_for_ids(query_vector, k=3, **kwargs)
Given an encrypted prompt, return the k most similar encrypted contexts.
- abstractmethod retrieve_and_decrypt(chunk_ids, **kwargs)
Given a list of chunk ids, return the decrypted contexts.