LangChain
AgentOps provides first class support for LangChain applications
AgentOps works seamlessly with applications built using LangChain.
Adding AgentOps to LangChain applications
Install the AgentOps SDK and the additional LangChain dependency
Set up your import statements
Import the following LangChain and AgentOps dependencies
Set up your LangChain handler to make the calls
Note that you don’t need to set up a separate agentops.init() call, as the LangChain callback handler will automatically initialize the AgentOps client for you.
Set up your LangChain agent with the AgentOps callback handler, and AgentOps will automatically record your LangChain sessions.
Set your API key as an .env
variable for easy access.
Read more about environment variables in Advanced Configuration
Run your agent
Execute your program and visit app.agentops.ai/drilldown to observe your LangChain Agent! 🕵️
After your run, AgentOps prints a clickable URL to the console linking directly to your session in the Dashboard
Clickable link to session