Skip to main content

Code

cookbook/models/ibm/watsonx/basic.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 creates an agent using the IBM WatsonX model and prints a response directly to the terminal. The markdown=True parameter tells the agent to format the output as markdown, which can be useful for displaying rich text content.