Skip to main content
This example demonstrates how to use tool hooks with teams and agents for intercepting and monitoring tool function calls, providing logging, timing, and other observability features.

Code

team_with_tool_hooks.py

Usage

1

Create a Python file

Create team_with_tool_hooks.py with the code above.
2

Set up your virtual environment

3

Install dependencies

4

Export your OpenAI API key

5

Run Team