Skip to main content
AgentOps provides seamless integration with IBM Watsonx.ai Python SDK, allowing you to track and analyze all your Watsonx.ai model interactions automatically.

Installation

Setting Up API Keys

Before using IBM Watsonx.ai with AgentOps, you need to set up your API keys. You can obtain:
  • IBM_WATSONX_API_KEY: From your IBM Cloud account
  • IBM_WATSONX_URL: The URL for your Watsonx.ai instance, typically found in your IBM Cloud dashboard.
  • IBM_WATSONX_PROJECT_ID: The project ID for your Watsonx.ai project, which you can find in the Watsonx.ai console.
  • AGENTOPS_API_KEY: From your AgentOps Dashboard
Then to set them up, you can either export them as environment variables or set them in a .env file.
Then load the environment variables in your Python code:

Usage

Initialize AgentOps at the beginning of your application to automatically track all IBM Watsonx.ai API calls:

Examples

Watsonx Text Chat

Basic text generation and chat

Watsonx Streaming

Demonstrates streaming responses with Watsonx.ai.

Watsonx Tokenization

Example of text tokenization with Watsonx.ai models.

Additional Resources