Skip to content

Commit bcdb558

Browse files
authored
Merge pull request #23 from moonpyt/doc-agents-clean
modify build-first-agent.md
2 parents 4532f2e + 853cf33 commit bcdb558

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/how-to-guides/build-first-agent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ if __name__ == "__main__":
225225
If you want token-by-token output for a more interactive experience:
226226

227227
```python
228+
import asyncio
229+
228230
async def stream_demo():
229231
llm = ChatBot(
230232
llm_provider="openai",
@@ -238,6 +240,9 @@ async def stream_demo():
238240
async for chunk in llm.astream(messages=messages):
239241
print(chunk.delta or "", end="", flush=True)
240242
print() # New line at end
243+
244+
if __name__ == "__main__":
245+
asyncio.run(stream_demo())
241246
```
242247

243248
## Full Example Code

0 commit comments

Comments
 (0)