docs: fix missing imports in dynamic instructions example (#3895)

Co-authored-by: Kazuhiro Sera <seratch@openai.com>
This commit is contained in:
Umer Ali
2026-07-21 03:01:30 +05:00
committed by GitHub
parent 2fa463571e
commit e78bb09275
+2
View File
@@ -238,6 +238,8 @@ triage_agent = Agent(
In most cases, you can provide instructions when you create the agent. However, you can also provide dynamic instructions via a function. The function will receive the agent and context, and must return the prompt. Both regular and `async` functions are accepted.
```python
from agents import Agent, RunContextWrapper
def dynamic_instructions(
context: RunContextWrapper[UserContext], agent: Agent[UserContext]
) -> str: