Enabling checking for code sources

After you install watsonx Code Assistant, you can enable checking to confirm if a generated code suggestion is similar to other code sources.

Procedure

  1. Create an IBM Cloud account. For more information, see https://www.ibm.com/cloud.
  2. Create a service ID and API key for your IBM Cloud account. For more information, see Creating and working with service IDs.
  3. Verify you can connect to IBM Cloud from your Red Hat® OpenShift® cluster where Cloud Pak for Data is installed.
  4. Create the following environment variable for your API key:
    export API_KEY=<your-api-key>
    • Replace <your-api-key> with the API key for your service ID.
  5. Run the following commands from your cluster:
    oc create secret generic wca-similarity-service-key \
    --namespace=${PROJECT_CPD_INST_OPERANDS} \
    --from-literal=apiKey=${API_KEY}
    oc patch wca wca-cr \
    --namespace=${PROJECT_CPD_INST_OPERANDS} \
    --type=merge \
    --patch='{"spec":{"similarity_feature":{"enabled":true}}}'