track_guardrails

opik.integrations.guardrails.track_guardrails(guard: Guard, project_name: str | None = None) Guard

Adds Opik tracking to a guardrails Guard instance.

Every validation step will be logged as a trace.

Parameters:
  • guard – An instance of Guard object.

  • project_name – The name of the project to log data.

Returns:

The modified Guard instance with Opik tracking enabled for its validators.