Skip to main content

Vector Databases

Vector Databases

Chroma DB

ChromaDB(host, port, collection, ef_inputs)

Initializes a Chroma vector database connection. Required for tests on RAG workflows.

Method Parameters

host | required string

Host connection for vector database.


port | required int

Port for vector database connection.


collection | required string

Vector database collection name


ef_inputs | required object

Embedding function to be used for vector database.

HuggingFace

api_key | required string

HuggingFace Hub API key to access embedding function.

model_name | required string

HuggingFace Hub embedding function model name.

OpenAI

api_key | required string

OpenAI API key to access embedding function.

model_name | required string

OpenAI embedding function model name.

Azure OpenAI

api_key | required string

Azure OpenAI API key to access embedding function.

model_name | required string

Azure OpenAI embedding function model name.

api_base | required string

Azure OpenAI API base endpoint.

api_version | required string

Azure OpenAI API endpoint version.

Sentence Transformer

model_name | required string

Sentence Transformer embedding function model name.

Returns

ChromaDB object.

Example

chroma_args = {
"host": "chroma-service.chroma.svc.cluster.local",
"port": 8000,
"collection": "my_collection",
"ef_inputs": {
"ef_type": "sentence_transformer",
"model_name": "my_embedding_function",
},
}
chroma_connection = ChromaDB(**chroma_args)

LlamaIndex DB

LlamaIndexDB(aws_key, aws_secret_key, s3_bucket_name, ef_inputs)

Initializes a LlamaIndex vector index connection. Required for tests on RAG workflows.

Method Parameters

aws_key | required string

AWS S3 access key for the persistent directory


aws_secret_key | required int

AWS S3 secret access key for the persistent directory


s3_bucket_name | required string

AWS S3 bucket name for the persistent directory


ef_inputs | required object

Embedding function to be used for vector database.

HuggingFace

api_key | required string

HuggingFace Hub API key to access embedding function.

model_name | required string

HuggingFace Hub embedding function model name.

OpenAI

api_key | required string

OpenAI API key to access embedding function.

model_name | required string

OpenAI embedding function model name.

Azure OpenAI

api_key | required string

Azure OpenAI API key to access embedding function.

model_name | required string

Azure OpenAI embedding function model name.

api_base | required string

Azure OpenAI API base endpoint.

api_version | required string

Azure OpenAI API endpoint version.

Sentence Transformer

model_name | required string

Sentence Transformer embedding function model name.

Returns

LlamaIndexDB object.

Example

llamaindex_arg = {
"aws_key": AWS_KEY, # aws s3 access key
"aws_secret": AWS_SECRET_KEY, # aws s3 secret access key
"s3_bucket_name": "llamaindex-test", # aws s3 bucket name
"ef_inputs": {
"ef_type": "hf", # embedding function provider
"model_name": "all-MiniLM-L6-v2", # embedding function model name
"api_key": HF_AUTH_TOKEN, # credential needed to access the model
},
}
llamaindex_connection = LlamaIndexDB(**llamaindex_args)

CustomRag DB

CustomRagDB(custom_rag_application_id)

Initializes a CustomRagDB connection. Required for tests on RAG workflows.

Method Parameters

custom_rag_application_id | required int

Custom RAG application id


Returns

CustomRagDB object.

Example

custom_rag_arg = {
"custom_rag_application_id": 12 # id of custom-rag-application
}
custom_rag_connection = CustomRagDB(**custom_rag_arg)