Configuring the SQL AI Assistant in CDW

After you prepare the supported platforms (Azure, AWS, or OpenAI), configure the SQL AI Assistant in Cloudera Data Warehouse (CDW) to use it in Hue.

You can pass the token required for connecting to the LLM service using one of the following approaches:
Secure
(Recommended) In this approach, you use Kubernetes' method of distributing secrets. You first encode the credentials and then add the encoded bit as a data item in the HUE_AI_INTERFACE_TOKEN property. The token becomes available in the Hue pod as an environment variable.
Open
You specify the token value in the hue-safety-valve field. In this approach the credentials are saved in a configuration file in plain text format.
To encode the LLM token:
  1. Use a base64 encoding tool to convert your token to a base-64 representation by running the following command:
    echo -n '[***MY-TOKEN***]' | base64

    Replace [***MY-TOKEN***] with the token value you want to encode.

  2. Open a terminal session and run the following command to add the encoded secret:
    kubectl edit secret hue-secret -n [***HUE-POD***]

    Replace [***HUE-POD***] with the Hue pod in which you want to add the secret.

  3. Add the encoded value returned for your token in the HUE_AI_INTERFACE_TOKEN property as follows:
    ...
    apiVersion: v1
    data:
      HADOOP_CREDSTORE_PASSWORD: [***ENCODED-HADOOP-CREDSTORE-PASSWORD***]
      HUE_AI_INTERFACE_TOKEN: [***ENCODED-TOKEN-VALUE***]
    kind: Secret

    Replace [***ENCODED-TOKEN-VALUE***] with the actual encoded value returned for your token.

  1. Log in to the Data Warehouse service as DWAdmin.
  2. Go to the Virtual Warehouses tab, locate the Virtual Warehouse on which you want to enable this feature, and click > Edit.
  3. Go to Configurations > Hue, select hue-safety-valve from the Configuration files drop-down menu, and add the following lines depending on the approach you are using for passing the token and your platform:
    Azure
    [desktop]
    [[ai_interface]]
        service='azure'
        model_name='[***DEPLOYMENT-NAME***]'
        base_url="https://[***RESOURCE***].openai.azure.com/"
    OpenAI
    [desktop]
    	[[ai_interface]]
    		service='openai'
    Azure
    [desktop]
    [[ai_interface]]
        service='azure'
        model_name='[***DEPLOYMENT-NAME***]'
        base_url="https://[***RESOURCE***].openai.azure.com/"
        token="[***RESOURCE-KEY***]
    AWS
    [aws]
    	[[bedrock_account]]
    		access_key_id='[***ACCESS-KEY***]'
    		secret_access_key='[***SECRET-KEY***]'
    		region='us-east-1'
    [desktop]
    	[[ai_interface]]
    		service='bedrock'
    		model='claude'
    OpenAI
    [desktop]
    	[[ai_interface]]
    		service='openai'
    		token='[***API-KEY***]'
  4. Click Apply Changes.
You see Assistant on the Hue SQL editor.