Code
cookbook/models/ibm/watsonx/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
stream=True
when calling print_response()
or run()
enables token-by-token streaming, which can provide a more interactive user experience.