Skip to main content
This example demonstrates how to handle different types of events during agent run streaming. It shows how to capture and process content events, tool call started events, and tool call completed events.

Code

run_response_events.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Install libraries

3

Export your ANTHROPIC API key

4

Create a Python file

Create a Python file and add the above code.
5

Run Agent

6

Find All Cookbooks

Explore all the available cookbooks in the Agno repository. Click the link below to view the code on GitHub:Agno Cookbooks on GitHub