Skip to content

Commit b9dab3b

Browse files
docs: add missing InputGuardrailTripwireTriggered import to quickstart example
Fixes NameError when handling guardrail exceptions by including the required import in the docs.
1 parent aeb4381 commit b9dab3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/quickstart.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ You can define custom guardrails to run on the input or output.
9595

9696
```python
9797
from agents import GuardrailFunctionOutput, Agent, Runner
98+
from agents.exceptions import InputGuardrailTripwireTriggered
9899
from pydantic import BaseModel
99100

101+
100102
class HomeworkOutput(BaseModel):
101103
is_homework: bool
102104
reasoning: str
@@ -122,6 +124,7 @@ Let's put it all together and run the entire workflow, using handoffs and the in
122124

123125
```python
124126
from agents import Agent, InputGuardrail, GuardrailFunctionOutput, Runner
127+
from agents.exceptions import InputGuardrailTripwireTriggered
125128
from pydantic import BaseModel
126129
import asyncio
127130

0 commit comments

Comments
 (0)