Skip to main content
This example demonstrates external tool execution using OpenAI Responses API with gpt-4.1-mini model. It shows how to handle tool-call IDs and execute multiple external tools in a loop until completion.

Code

external_tool_execution_async_responses.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Install libraries

3

Export your OpenAI 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