Skip to content

Vector Databases

CustomModelVectorDatabaseValidation

class datarobot.models.genai.vector_database.CustomModelVectorDatabaseValidation

Validation record checking the ability of the deployment to serve as a vector database.

Variables

Attribute Type Description
id str The ID of the validation.
prompt_column_name str The column name the deployed model expect as the input.
target_column_name str The target name deployed model will output.
deployment_id str ID of the deployment.
model_id str ID of the underlying deployment model. Can be found from the API as Deployment.model[“id”].
validation_status str Can be TESTING, FAILED and PASSED. Only PASSED allowed for use.
deployment_access_data dict, optional The data that will be used for accessing the deployment prediction server. This field is only available for deployments that pass validation. Dict fields are as follows:- prediction_api_url - The URL for the deployment prediction server. - datarobot_key - The first of two auth headers for the prediction server. - authorization_header - The second of two auth headers for the prediction server. - input_type - The input type the model expects, either JSON or CSV. - model_type - The target type of the deployed custom model.
tenant_id str The creating user’s tenant ID.
name str The display name of the validated custom model.
creation_date str The creation date of the validation (ISO 8601 formatted).
user_id str The ID of the creating user.
error_message Optional[str] Additional information for the errored validation.
deployment_name Optional[str] The name of the validated deployment.
user_name Optional[str] The name of the creating user.
use_case_id Optional[str] The ID of the Use Case associated with the validation.

SupportedEmbeddings

class datarobot.models.genai.vector_database.SupportedEmbeddings

All supported embedding models including the recommended default model.

Variables

Attribute Type Description
embedding_models list[EmbeddingModel] All supported embedding models.
default_embedding_model str Name of the default recommended text embedding model. Currently supported options are listed in VectorDatabaseEmbeddingModel but the values can differ with different platform versions.
custom_model_embedding_validations List[str] External embedding custom models that have been validated
openai_embedding_validations List[str] External OpenAI compatible embedding models that have been validated

SupportedCustomModelEmbedding

class datarobot.models.genai.vector_database.SupportedCustomModelEmbedding

SupportedOpenAIEmbeddingModel

class datarobot.models.genai.vector_database.SupportedOpenAIEmbeddingModel

SupportedTextChunkings

class datarobot.models.genai.vector_database.SupportedTextChunkings

Supported text chunking configurations which includes a set of recommended chunking parameters for each supported embedding model.

Variables

Attribute Type Description
text_chunking_configs All supported text chunking configurations.

VectorDatabase

class datarobot.models.genai.vector_database.VectorDatabase

Metadata for a DataRobot vector database accessible to the user.

Variables

Attribute Type Description
id str Vector database ID.
name str Vector database name.
size int Size of the vector database assets in bytes.
use_case_id str Linked use case ID.
dataset_id str ID of the dataset used for creation.
embedding_model str Name of the text embedding model. Currently supported options are listed in VectorDatabaseEmbeddingModel but the values can differ with different platform versions.
chunking_method str or None Name of the method to split dataset documents. Currently supported options are listed in VectorDatabaseChunkingMethod but the values can differ with different platform versions.
chunk_size int or None Size of each text chunk in number of tokens.
chunk_overlap_percentage int or None Overlap percentage between chunks.
chunks_count int Total number of text chunks.
custom_chunking bool Determines if the chunking is custom. With custom chunking, dataset rows are not split into chunks automatically;instead, the user provides the chunks.
separators list[string] or None Separators for document splitting.
creation_date str Date when the database was created.
creation_user_id str The ID of the creating user.
organization_id str The creating user’s organization ID.
tenant_id str The creating user’s tenant ID.
last_update_date str Last update date for the database.
execution_status str Database execution status. Currently supported options are listed in VectorDatabaseExecutionStatus but the values can differ with different platform versions.
playgrounds_count int Number of using playgrounds.
dataset_name str Name of the used dataset.
user_name str Name of the creating user.
source str Source of the vector database. Currently supported options are listed in VectorDatabaseSource but the values can differ with different platform versions.
validation_id Optional[str] ID of custom model vector database validation. Only filled for external vector databases.
error_message Optional[str] Additional information for errored vector database.
embedding_validation_id Optional[str] ID of the custom embedding validation, if any.
is_separator_regex bool Whether the separators should be treated as regular expressions.
external_vector_database_connection Optional[dict] Parameters defining the external vector database connection to use.
metadata_dataset_id Optional[str] The ID of the dataset used to add additional metadata to the vector database.
metadata_dataset_name Optional[str] The name of the dataset used to add additional metadata to the vector database.
metadata_combination_strategy Optional[VectorDatabaseMetadataCombinationStrategy] The strategy used to combine metadata when there is duplication between the dataset and the metadata dataset.
added_metadata_dataset_pairs Optional[List[Dict[str, str]] Pairs of dataset_id and metadata_dataset_id that have been added to the vector database.

get_supported_embeddings()

classmethod get_supported_embeddings()

Get all supported and the recommended embedding models.

Parameters

Parameter Type Description
dataset_id Optional[str] ID of a dataset for which the recommended model is returned based on the detected language of that dataset.
use_case Optional[UseCase, str] May be Use Case ID or the Use Case entity.

Returns

Returns Description
supported_embeddings The supported embedding models.

Return type: SupportedEmbeddings

submit_export_dataset_job()

method submit_export_dataset_job()

Submit the vector database dataset export job.

Returns

Returns Description
result The result of the vector database dataset export job containing the exported dataset id.

Return type: VectorDatabaseDatasetExportJob

get_supported_retrieval_settings()

classmethod get_supported_retrieval_settings()

Get supported retrieval settings.

Returns

Returns Description
supported_retrieval_settings The supported retriever settings.

Return type: SupportedRetrievalSettings

create()

classmethod create()

Create a new vector database.

Parameters

Parameter Type Description
dataset_id str ID of the dataset used for creation.
chunking_parameters ChunkingParameters Parameters defining how documents are split and embedded.
use_case Optional[Union[UseCase, str]], optional Use case to link to the created vector database.
name Optional[str] Vector database name, by default None which leads to the default name ‘Vector Database for ’.
parent_vector_database_id Optional[str] ID of the parent vector database to base the update on.
update_llm_blueprints Optional[bool] Whether to update LLM blueprints related to the parent vector database.
update_deployments Optional[bool] Whether to update deployments related to the parent vector database.
external_vector_database_connection Optional[dict] Parameters defining the external vector database connection to use.
metadata_dataset_id Optional[str] The ID of the dataset used to provide additional metadata.
metadata_combination_strategy Optional[VectorDatabaseMetadataCombinationStrategy] Strategy used to combine the metadata columns if there are duplicates between the dataset and the metadata dataset.

Returns

Returns Description
vector database The created vector database with execution status ‘new’.

Return type: VectorDatabase

create_from_custom_model()

classmethod create_from_custom_model()

Create a new vector database from validated custom model deployment.

Parameters

Parameter Type Description
name str Vector database name.
use_case Optional[Union[UseCase, str]], optional Use case to link to the created vector database.
validation_id Optional[str] ID of CustomModelVectorDatabaseValidation for the deployment. Alternatively, you can specify ALL the following fields.
prompt_column_name Optional[str] The column name the deployed model expect as the input.
target_column_name Optional[str] The target name deployed model will output.
deployment_id Optional[str] ID of the deployment.
model_id Optional[str] ID of the underlying deployment model. Can be found from the API as Deployment.model[“id”].

Returns

Returns Description
vector database The created vector database.

Return type: VectorDatabase

get()

classmethod get()

Retrieve a single vector database.

Parameters

Parameter Type Description
vector_database_id str The ID of the vector database you want to retrieve.

Returns

Returns Description
vector database The requested vector database.

Return type: VectorDatabase

list()

classmethod list()

List all vector databases associated with a specific use case available to the user.

Parameters

Parameter Type Description
use_case Optional[UseCaseLike], optional The returned vector databases are filtered to those associated with a specific Use Case or Cases if specified or can be inferred from the Context. Accepts either the entity or the ID.
playground Optional[Union[Playground, str]], optional The returned vector databases are filtered to those associated with a specific playground if it is specified. Accepts either the entity or the ID.
search Optional[str] String for filtering vector databases. Vector databases that contain the string in name will be returned. If not specified, all vector databases will be returned.
sort Optional[str] Property to sort vector databases by. Prefix the attribute name with a dash to sort in descending order, e.g., sort=’-creationDate’. Currently supported options are listed in ListVectorDatabasesSortQueryParams but the values can differ with different platform versions. By default, the sort parameter is None which will result in vector databases being returned in order of creation time descending.
completed_only Optional[bool] A filter to retrieve only vector databases that have been successfully created. By default, all vector databases regardless of execution status are retrieved.

Returns

Returns Description
vectorbases A list of vector databases available to the user.

Return type: list[VectorDatabase]

update()

method update()

Update the vector database.

Parameters

Parameter Type Description
name Optional[str] The new name for the vector database.
credential_id Optional[str] The new credential id to access the connected vector database.

Returns

Returns Description
vector database The updated vector database.

Return type: VectorDatabase

update_connected()

method update_connected()

Update a connected vector database.

Parameters

Parameter Type Description
dataset_id str The ID of the dataset to add to the vector database.
metadata_dataset_id Optional[str] The ID of the dataset used to provide additional metadata.
metadata_combination_strategy Optional[VectorDatabaseMetadataCombinationStrategy] Strategy used to combine the metadata columns if there are duplicates between the dataset and the metadata dataset.

Returns

Returns Description
vector database The updated vector database.

Return type: VectorDatabase

delete()

method delete()

Delete the vector database.

Return type: None

get_supported_text_chunkings()

classmethod get_supported_text_chunkings()

Get all supported text chunking configurations which includes a set of recommended chunking parameters for each supported embedding model.

Returns

Returns Description
supported_text_chunkings The supported text chunking configurations.

Return type: SupportedTextChunkings

download_text_and_embeddings_asset()

method download_text_and_embeddings_asset()

Download a parquet file with text chunks and corresponding embeddings created by a vector database.

Parameters

Parameter Type Description
file_path Optional[str] File path to save the asset. By default, it saves in the current directory autogenerated by server name.
part Optional[int] Part of the text chunks to download. Connected vector databases have a part for each dataset that is added.

Return type: None

send_to_custom_model_workshop()

method send_to_custom_model_workshop()

Create a new CustomModelVersion for this vector database.

Parameters

Parameter Type Description
maximum_memory Optional[int] The maximum memory that will be allocated to this custom model.
resource_bundle_id Optional[str] The ID of a datarobot.models.resource_bundle.ResourceBundle that will be used by this custom model.
replicas Optional[int] A fixed number of replicas that will be deployed for this custom model.
network_egress_policy Optional[str] Determines whether the given custom model is isolated, or can access the public network. Values: [datarobot.NETWORK_EGRESS_POLICY.NONE, datarobot.NETWORK_EGRESS_POLICY.PUBLIC].

Return type: CustomModelVersion

deploy()

method deploy()

Create a new Custom Model for this vector database and deploy it on a new Deployment.

Parameters

Parameter Type Description
default_prediction_server_id Optional[str] An identifier of a prediction server to be used as the default prediction server. When working with prediction environments, the default prediction server ID should not be provided.
prediction_environment_id Optional[str] An identifier of a prediction environment to be used for model deployment.
credential_id Optional[str]: The ID of credentials to access a connected vector database. Only needed for vector databases with an external source when the user does not have access to the credentials associated with this vector database.
maximum_memory Optional[int] The maximum memory that will be allocated to the new custom model.
resource_bundle_id Optional[str] The ID of a datarobot.models.resource_bundle.ResourceBundle that will be used by the new custom model.
replicas Optional[int] A fixed number of replicas that will be deployed for this custom model.
network_egress_policy Optional[str] Determines whether the given custom model is isolated, or can access the public network. Values: [datarobot.NETWORK_EGRESS_POLICY.NONE, datarobot.NETWORK_EGRESS_POLICY.PUBLIC].

Return type: Deployment

SupportedRetrievalSetting

class datarobot.models.genai.vector_database.SupportedRetrievalSetting

A single supported retrieval setting.

Variables

Attribute Type Description
name str The name of the setting.
type str or list[str] The type of the setting.
description str The description of the setting.
title str The title of the setting.
default str, int, bool, or None The default value of the setting.
minimum int or None The minimum value of the setting.
maximum int or None The maximum value of the setting.
enum list[str] or None The enum values of the setting.
settings list[SupportedRetrievalSetting] or None The supported retriever settings.
group_id str or None The group ID of the setting.

VectorDatabaseDatasetExportJob

class datarobot.models.genai.vector_database.VectorDatabaseDatasetExportJob

Response for the vector database dataset export job.

Variables

Attribute Type Description
job_id str ID of the export job.
vector_database_id str ID of the vector database.
export_dataset_id str ID of the exported dataset.

Citation

class datarobot.models.genai.chat_prompt.Citation

Citation for documents retrieved from a vector database.

Variables

Attribute Type Description
text str The text retrieved from a vector database.
source str or None, optional The source of the retrieved text.
similarity_score The similarity score between the citation and the user prompt.
metadata dict or None, optional Additional metadata for the citation.

VectorDatabaseSettings

class datarobot.models.genai.llm_blueprint.VectorDatabaseSettings

Settings for a DataRobot GenAI vector database associated with an LLM blueprint.

Variables

Attribute Type Description
max_documents_retrieved_per_prompt int or None, optional The maximum number of documents to retrieve for each prompt.
max_tokens int or None, optional The maximum number of tokens to retrieve for each document.
retriever VectorDatabaseRetrievers The vector database retriever name.
add_neighbor_chunks Whether to add neighboring documents to the retrieved documents.
retrieval_mode VectorDatabaseRetrievalMode The vector database retrieval mode.
maximal_marginal_relevance_lambda float The maximal marginal relevance lambda. Favors diversity (0.0) or similarity (1.0) of the retrieved documents.

ChunkingParameters

class datarobot.models.genai.vector_database.ChunkingParameters

Parameters defining how documents are split and embedded.

Variables

Attribute Type Description
embedding_model Optional[str] Name of the text embedding model. Currently supported options are listed in VectorDatabaseEmbeddingModel but the values can differ with different platform versions.
chunking_method str Name of the method to split dataset documents. Currently supported options are listed in VectorDatabaseChunkingMethod but the values can differ with different platform versions.
chunk_size int Size of each text chunk in number of tokens.
chunk_overlap_percentage int Overlap percentage between chunks.
separators list[str] Strings used to split documents into text chunks.
embedding_validation Optional[CustomModelEmbeddingValidation, OpenAIEmbddingModelValidation, SupportedEmbeddingExternalModel, str] ID or object for embedding validation.
custom_chunking bool Determines if the chunking is custom. With custom chunking, dataset rows are not split into chunks automatically;instead, the user provides the chunks.

CustomModelEmbeddingValidation

class datarobot.models.genai.custom_model_embedding_validation.CustomModelEmbeddingValidation

Validation record checking the ability of the deployment to serve as a custom model embedding.

Variables

Attribute Type Description
id str The ID of the validation.
prompt_column_name str The column name the deployed model expect as the input.
target_column_name str The target name that the deployed model will output.
deployment_id str The ID of the deployment.
model_id str The ID of the underlying deployed model, which can be found using Deployment.model[“id”].
validation_status str Can be TESTING, FAILED, or PASSED. Only PASSED is allowed for use.
deployment_access_data dict, optional The data that will be used for accessing the deployment prediction server. This field is only available for deployments that pass validation. Dict fields are as follows:- prediction_api_url - The URL for the deployment prediction server. - datarobot_key - The first of two auth headers for the prediction server. - authorization_header - The second of two auth headers for the prediction server. - input_type - The input type the model expects, either JSON or CSV. - model_type - The target type of the deployed custom model.
tenant_id str The creating user’s tenant ID.
name str The display name of the validated custom model.
creation_date str The creation date of the validation (ISO 8601 formatted).
user_id str The ID of the creating user.
error_message Optional[str] Additional information for the errored validation.
deployment_name Optional[str] The name of the validated deployment.
user_name Optional[str] The name of the creating user.
use_case_id Optional[str] The ID of the Use Case associated with the validation.
prediction_timeout int The timeout in seconds for the prediction API used in this custom model validation.

OpenAIEmbeddingModelValidation

class datarobot.models.genai.openai_embedding_model_validation.OpenAIEmbeddingModelValidation

create()

classmethod create()

Start the validation of the OpenAI-compatible embedding model.

Parameters

Parameter Type Description
model str The name of the validated OpenAI embeddings model.
base_url str Base URL to OpenAI-compatible deployment.
credential_id str The ID of credentials that hold token for OpenAI-compatible deployment.
use_case Union[UseCase, str] The Use Case to link the validation to, either UseCase or the Use Case ID.
name str The name of the validation.
extra_body_params list Parameters used as extra_body in request to OpenAI-compatible embeddings model.
wait_for_completion bool If set to True, the code will wait for the validation job to complete before returning results. If the job does not finish in 10 minutes, this method call raises a timeout error. If set to False, the code does not wait for the job to complete. Instead, OpenAIEmbeddingModelValidation.get can be used to poll for the status of the job using the validation ID returned by the method.

Return type: OpenAIEmbeddingModelValidation

get()

classmethod get()

Get the OpenAI-compatible embedding model validation record by ID.

Parameters

Parameter Type Description
validation_id str ID of OpenAIEmbeddingModelValidation to retrieve.

Return type: OpenAIEmbeddingModelValidation

list()

classmethod list()

List the validation records by field values.

Parameters

Parameter Type Description
model str, optional The name of embeddings model.
use_cases list[Union[UseCase, str]], optional The returned validations are filtered to those associated with specific Use Cases if specified, either UseCase objects or the Use Case IDs.
playground Union[Playground, str], optional The returned validations are filtered to those used in a specific playground if specified, either Playground or playground ID.
completed_only bool Whether to retrieve only completed validations.
search str, optional String for filtering validations. Validations that contain the string in name will be returned.
sort str, optional Property to sort validations by. Prefix the attribute name with a dash to sort in descending order, e.g., sort=’-name’. Currently supported options are listed in ListOpenAIEmbeddingValidationSortQueryParam but the values can differ with different platform versions. By default, the sort parameter is None which will result in validations being returned in order of creation time descending.

Return type: List[OpenAIEmbeddingModelValidation]

update()

method update()

Update a OpenAI-compatible embedding model validation.

Parameters

Parameter Type Description
name str, optional The new name of the validation.
model str, optional The new model within the deployment to validate.
base_url str, optional Base URL to OpenAI-compatible deployment.
credential_id str, optional The ID of credentials that hold token for OpenAI-compatible deployment.
extra_body_params list, optional Parameters used as extra_body in request to OpenAI-compatible embeddings model. If empty list is passed then all existing extra_body_params will be erased.

Return type: OpenAIEmbeddingModelValidation

delete()

method delete()

Delete the OpenAI-compatible embedding model validation.

Return type: None