File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 1717"""
1818This example shows how to use guardrails.
1919
20- Guardrails are checks that run either in parallel with the agent or before the agent starts .
20+ Guardrails are checks that run in parallel to the agent's execution .
2121They can be used to do things like:
2222- Check if input messages are off-topic
2323- Check that input messages don't violate any policies
2424- Take over control of the agent's execution if an unexpected input is detected
2525
2626In this example, we'll setup an input guardrail that trips if the user is asking to do math homework.
2727If the guardrail trips, we'll respond with a refusal message.
28-
29- By default, guardrails run in parallel with the agent for better latency.
30- You can set run_in_parallel=False to run the guardrail before the agent starts,
31- which saves token costs if the guardrail fails (the agent never starts).
3228"""
3329
3430
You can’t perform that action at this time.
0 commit comments