Integrations
Guardrails
# Import Guard and Validator
from guardrails.hub import BespokeMiniCheck
from guardrails import Guard
# Setup Guard
guard = Guard().use(
BespokeMiniCheck,
split_sentences=True,
threshold=0.5,
on_fail="fix"
)
# Validator passes
guard.validate("Alex likes cats.",
metadata={"context": "Alex likes cats and dogs"})
# Validator fails
guard.validate("Alex likes cats.",
metadata={"context": "Alex likes dogs, but not cats."}) Ollama
Last updated