You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an MVP, give agents the ability to validate output against guardrails:
pii_guard.validate("My phone number is 555-555-6868")
Example code from a meeting:
from openai import OpenAI
from guardrails import Guard, install
# CLI Installation
# guadrails hub install hub://guadrails/detect_pii
install("hub://guardrails/detect_pii")
install("hub://guardrails/toxic_language")
from guardrails.hub import DetectPII
from guardrails.hub import ToxicLanguage
client = OpenAI()
pii_guard = Guard().use(DetectPII(pii_entities=["EMAIL_ADDRESS", "PHONE_NUMBER"]))
toxic_language_guard = Guard().use(ToxicLanguage())
combo_guard = Guard().use_many(DetectPII(pii_entities=["EMAIL_ADDRESS", "PHONE_NUMBER"]), ToxicLanguage())
client(
model='gpt-4o-mini',
messages=[{
"role": "user",
"content": "What is the meaning of life?"
}]
)
pii_guard(
model='gpt-4o-mini',
messages=[{
"role": "user",
"content": "What is the meaning of life?"
}]
)
toxic_language_guard(
model='gpt-4o-mini',
messages=[{
"role": "user",
"content": "What is the meaning of life?"
}]
)
pii_guard.validate("My phone number is 555-555-6868")
The text was updated successfully, but these errors were encountered:
As an MVP, give agents the ability to validate output against guardrails:
pii_guard.validate("My phone number is 555-555-6868")
Example code from a meeting:
The text was updated successfully, but these errors were encountered: