Running the Semantic Guardrails samples
The example scripts under the semantic-guardrail/ folder demonstrate the usage of Semantic Guardrails APIs. For more information about the Semantic Guardrails APIs, refer to the section Semantic Guardrails APIs.
Note: A dedicated
semantic-guardrail/docker-compose.ymlis provided to start the Data Discovery and the Semantic Guardrails services.
Open a command prompt.
Navigate to the directory where AI Developer Edition is cloned.
Run the following command to test Semantic Guardrails using Python scripts. The following command submits a multi-turn conversation for analysis. One for semantic and a second one for PII processing.
python semantic-guardrail/samples/python/sample-guardrail-python.pyRun the following command to start Jupyter Lab for running Semantic Guardrails.
jupyter labCopy the URL displayed and navigate to the site from a web browser. Ensure that
localhostis replaced with the IP address of the system where the AI Developer Edition is set up.In the left pane of the Jupyter Lab, navigate to
semantic-guardrail/samples/python/sample-app-semantic-guardrails.Open the
Sample Application.ipynbfile.Click the Play icon and follow the prompts in the Jupyter Lab.
Feedback
Was this page helpful?