Complete list of model-related configurations for setting up the Cloudera Data Explorer (Hue) SQL AI Assistant
Review the list of service, model, and semantic search-related configurations used for custom configuring the AI services and models you want to use with the SQL AI Assistant and how to specify them in the Hue Advanced Configuration Snippet in the Cloudera Manager.
List of service and model-related configurations
[desktop]
[[ai_interface]]
[***CONFIG-KEY1***]='[***VALUE***]'
[***CONFIG-KEY2***]='[***VALUE***]'
[[semantic_search]]
[***CONFIG-KEY1***]='[***VALUE***]'
[***CONFIG-KEY2***]='[***VALUE***]'AI interface-related configurations
Here is the complete list of configurations under [[ai_interface]], which allows you to specify the service and model to be used:
| AI interface config key | Description |
|---|---|
| service | API service to be used for AI tasks. AI is disabled when a service is not configured. For example, the Cloudera AI Workbench and Cloudera AI Inference service are API services. |
| service_version | API service version to be used for AI tasks. |
| trusted_service | Indicates whether the LLM is trusted or not. Turn on to disable the
warning. The default value is True. |
| model | The AI model you want to use for AI tasks. For example,
gpt and llama. |
| model_name | The fully qualified name of the model to be used. For example,
gpt-3.5-turbo-16k. |
| model_ref | The `model_ref` is a placeholder for adding the access key of the specific model you want to use. |
| base_url | Service API base URL. |
| add_table_data | When enabled, sample rows from the table are added to the prompt.
The default value is True. |
| table_data_cache_size | Size of the LRU cache used for storing table sample data. |
| auto_fetch_table_meta_limit | Number of tables to load from a database, initially. |
| token | Service API secret token. |
| token_script | Provides a secure way to get the service API secret token. |
| enabled_sql_tasks | A comma-separated list of SQL-related AI tasks available in the Editor. |
User Input Validation for Data Explorer SQL AI
Following is the complete list of configurations under [[ai_interface]]. It helps to specify the input validation to enhance security and optimize performance.
| AI interface config key | Description |
|---|---|
| user_input_max_length | Ensure the configured user input length is not exceeded. The default limit is 1000, but you can configure it to a higher value if needed. |
| user_input_remove_characters | Remove specific characters from user input, such as newlines (\n), tab spaces (\t), and others, to ensure clean and consistent formatting. |
| user_input_banned_keyphrases | Block user input if certain configured keyphrases are found. |
| user_input_banned_regex | Block user input if a configured regex pattern match is found. |
| user_input_block_html | Escape HTML tags to prevent malicious activities and ensure secure input
handling. This config accepts a boolean value: True to escape HTML tags
or False to allow raw HTML.The default value is set to
|
The following sample configuration sets the validations for user input:
[[ai_interface]]
service='azure'
model_name='[***DEPLOYMENT-NAME***]'
base_url='https://[***RESOURCE***].cloudera.site/model'
token='[***RESOURCE-KEY***]'
user_input_max_length=1000
user_input_remove_characters="&\n\r\t"
user_input_banned_keyphrases=""
user_input_banned_regex=""
user_input_block_html="False"
Personally Identifiable Information PII entity detection configuration
The pii_entities_to_detect configuration property sets up
Personally Identifiable Information (PII) filtering for SQL AI queries.
The following table describes the configuration property:
| Property | Description | Type | Default |
|---|---|---|---|
pii_entities_to_detect |
Specifies a comma-separated list of Personally Identifiable Information (PII) entity types to detect in SQL AI user input. When one of the listed entity types is detected with sufficient confidence, the request is rejected to prevent sensitive data from being sent to the model. | Comma-separated list | Empty (PII detection disabled) |
The following example shows how to configure the
pii_entities_to_detect configuration property in the
hue-safety-valve configuration file:
pii_entities_to_detect=CREDIT_CARD,EMAIL_ADDRESS,PHONE_NUMBER,US_SSN
Row cap limit for SQL AI queries
For queries produced by the SQL AI Assistant generate task, the
SQL Editor user interface automatically appends a default LIMIT clause in
the preview before running the query to match the standard row cap. The default setting is
LIMIT 1000, which functions as a fallback only when the SQL Editor
snippet does not define a default_limit configuration property.
The system appends the limit only when the generated query is a read query using
a SELECT or WITH Common Table Expression clause that
includes a FROM clause and does not contain an existing
LIMIT clause. For multi-statement queries, the system applies the limit
to the final statement to run.
Semantic search-related configurations
| Semantic search config key | Description |
|---|---|
| relevancy | The technology you want to use for semantic search. Acceptable
values are vector_search or vector_db. |
| embedding_model | The model you want to use for data-embedding. This must be compatible with SentenceTransformer. |
| top_k | Number of top-ranking items returned by semantic search. |
| cache_size | Size of the LRU cache used for storing embedding. |
