Guardrails AI
Guardrails AI is a framework for validating the inputs and outputs
For this guide we will use a simple example that logs guardrails validation steps as traces to Opik, providing them with the validation result tags.
First, ensure you have both opik
and guardrails-ai
installed:
We will also need to install the guardrails check for politeness from the Guardrails Hub
Logging validation traces
In order to log traces to Opik, you will need to call the track the Guard object with track_guardrails
function.
Every validation will now be logged to Opik as a trace
The trace will now be viewable in the Opik platform:
