Skip to main content

Code

image_agent_bytes.py

Usage

1

Set up your virtual environment

2

Set your API key

3

Install dependencies

4

Add sample image

Place a sample image named “sample.jpg” in the same directory as the script.
5

Run Agent

Save the code above as image_agent_bytes.py, then run:
The example loads an image from a file and passes it to an IBM WatsonX vision model along with a prompt.