Installation
Install AgentOps and the necessary LangChain dependencies:Setting Up API Keys
You’ll need API keys for AgentOps and OpenAI (asChatOpenAI is commonly used with LangChain):
- OPENAI_API_KEY: From the OpenAI Platform
- AGENTOPS_API_KEY: From your AgentOps Dashboard
.env file.
Usage
Integrating AgentOps with LangChain involves using theLangchainCallbackHandler.
Here’s a basic example:
Examples
LangChain Example
A detailed notebook demonstrating the LangChain callback handler integration.

