File tree 2 files changed +14
-1
lines changed
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)
47
47
48
48
(_ If running this, ensure you set the ` OPENAI_API_KEY ` environment variable_ )
49
49
50
+ (_ For Jupyter notebook users, see [ hello_world_jupyter.py] ( examples/basic/hello_world_jupyter.py ) _ )
51
+
50
52
## Handoffs example
51
53
52
- ``` py
54
+ ``` python
53
55
from agents import Agent, Runner
54
56
import asyncio
55
57
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