File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,11 @@ print(result.final_output)
4747
4848(_ If running this, ensure you set the ` OPENAI_API_KEY ` environment variable_ )
4949
50+ (_ For Jupyter notebook users, see [ hello_world_jupyter.py] ( examples/basic/hello_world_jupyter.py ) _ )
51+
5052## Handoffs example
5153
52- ``` py
54+ ``` python
5355from agents import Agent, Runner
5456import asyncio
5557
Original file line number Diff line number Diff line change 1+ from agents import Agent , Runner
2+
3+ agent = Agent (name = "Assistant" , instructions = "You are a helpful assistant" )
4+
5+ # Intended for Jupyter notebooks where there's an existing event loop
6+ result = await Runner .run (agent , "Write a haiku about recursion in programming." ) # type: ignore[top-level-await] # noqa: F704
7+ print (result .final_output )
8+
9+ # Code within code loops,
10+ # Infinite mirrors reflect—
11+ # Logic folds on self.
You can’t perform that action at this time.
0 commit comments