An example that shows the complete process of enabling Knowledge Transformer in an existing ZAssistantDeploy deployment.
About this task
Use this example to enable Knowledge Transformer in an existing
ZAssistantDeploy deployment. This workflow includes
creating secrets, updating the deployment configuration, and verifying the installation.
Procedure
- Create the Transform Secret
- Generate the API Key
TRANSFORM_API_KEY=$(openssl rand -base64 32)
echo "Save this API key: $TRANSFORM_API_KEY"
- Create a secret file
cat > transform-secret.yaml <<EOF
apiVersion: v1
kind: Secret
metadata:
name: transform-secret
namespace: wxa4z-zad
type: Opaque
stringData:
TRANSFORM_API_KEY: $TRANSFORM_API_KEY
EOF
- Apply secret
oc apply -f transform-secret.yaml
- Update ZAssistantDeploy CR
Edit your
deploy-zad.yaml file and add the transform section:
transform:
enabled: true
secretName: transform-secret
createRoute: true
route:
annotations:
haproxy.router.openshift.io/timeout: 30m
env:
MAX_ARCHIVE_FILES: "10000"
LLM_TLS_VERIFY: "false"
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 2
memory: 1Gi
ephemeral-storage: "8Gi"
- Apply the changes
oc apply -f deploy-zad.yaml
- Verify deployment
- Wait for the pod to be ready
oc wait --for=condition=Ready pod -l app=wxa4z-transform -n wxa4z-zad --timeout=300s
- Get the API URL
TRANSFORM_URL=https://$(oc get route wxa4z-transform -n wxa4z-zad -o jsonpath='{.spec.host}')
echo "Transform API URL: $TRANSFORM_URL"
- Test the connection
curl -k -H "X-API-Key: $TRANSFORM_API_KEY" $TRANSFORM_URL/health
- Configure zassist CLI
- Configure the CLI
zassist config transform set-url $TRANSFORM_URL
zassist config transform set-api-key $TRANSFORM_API_KEY
- Verify configuration
zassist config transform show
- Test Knowledge Transformer
- Create a test document
echo "# Test Document
This is a test document for Knowledge Transformer.
## Section 1
Content for section 1.
## Section 2
Content for section 2." > test.md
- Transform the document
zassist transform test.md
- Check the output
Results
You have successfully enabled Knowledge Transformer. The service is
now running and configured for use with the zassist CLI.