We provide callback handler that can be used to track LangChain calls, chains and agents.
First, install the relevant
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.
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: