Skip to main content

Code

cookbook/models/ibm/watsonx/async_basic_stream.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Set your API key

3

Install libraries

4

Run Agent

This example combines asynchronous execution with streaming. It creates an agent with debug_mode=True for additional logging and uses the asynchronous API with streaming to get and display responses as they’re generated.