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
.env
file.
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.