Configuration¶
The XTraceSDK is designed to be highly configurable to suit various use cases and environments. This section will guide you through the configuration options available in the SDK. You can configure the SDK by setting environment variables or by passing parameters directly to the classes and methods.
Cryptography Configuration¶
The SDK supports various cryptographic algorithms for data encryption and decryption. You can configure the cryptographic settings by passing the appropriate parameters to the crypto client classes. For example, when using the PaillierClient, you can specify the embedding length, and key length:
from xtrace_sdk.crypto.paillier_client import PaillierClient
paillier_client = PaillierClient(embd_len=512, key_len=1024)
Data Loader Configuration¶
The SDK provides various data loaders for different file formats. You can configure the data loader by passing the appropriate parameters to the loader class. For example, you can specify the embedding, cryptographic clients, and storage module:
from xtrace_sdk.data_loaders.base import DataLoaderBase
from xtrace_sdk.crypto.paillier_client import PaillierClient
from xtrace_sdk.crypto.encryption.aes import AESClient
from xtrace_sdk.utils.embedding import Embedding
from xtrace_sdk.integrations.local.storage import LocalStorage
paillier_client = PaillierClient(embd_len=512, key_len=1024)
aes_client = AESClient("this is a super safe AES Key")
embedding = Embedding()
storage = LocalStorage("data/")
data_loader = DataLoaderBase(embedding, aes_client, paillier_client, storage)
Retriever Configuration¶
Retriever configuration is similar to data loader configuration. You can specify the cryptographic clients, embedding, and compute module when creating a retriever instance. For example, when using the SimpleRetriever, you can specify the AES client, Paillier client, embedding, and compute module:
from xtrace_sdk.retrievers.simple_retriever import SimpleRetriever
retriever = SimpleRetriever(embedding, aes_client, paillier_client, compute)