Documentation
Getting Started
Concepts
Integrations
JavaScript
Python
Browser
LangChain
Others
Features
Analytics
Logging
Tracing
Users
Chat Replays
Feedback
Tags
Tests
More
Data API
Self Hosting
LangChain
We provide callback handler that can be used to track LangChain calls, chains and agents.
Setup
First, install the relevant llmonitor
package:
Then, set the LLMONITOR_APP_ID
environment variable to your app tracking id.
If you'd prefer not to set an environment variable, you can pass the key directly when initializing the callback handler:
Usage with LLM calls
You can use the callback handler with any LLM or Chat class from LangChain.
Usage with agents
The callback handler works seamlessly with LangChain agents and chains.
For agents, it is recommended to pass a name in the metadatas to track them in the dashboard.
Note
Example:
Usage with custom agents
If you're partially using LangChain, you can use the callback handler combined with the llmonitor
module to track custom agents: