Steps to integrate AI21 with AgentOps
1
Install the AgentOps SDK
2
Install the AI21 SDK
We currently support v2.x.x of the AI21 SDK and plan to support v3.x.x in the future.
3
Add AgentOps to your code
Make sure to call
agentops.init before calling any openai, cohere, crew, etc models.4
Run your Agent
Execute your program and visit app.agentops.ai/drilldown to observe your Agent! 🕵️

Full Examples
Streaming Examples
Task-Specific Models
AI21 v2.x.x provides specialized models called Task Specific Models for specific tasks. Here’s an example using the contextual answers endpoint:If you want to stream the response, you can use the stream=True flag. The streaming response is handled by the AI21 SDK.

