LangChainJS
LangChainJS is the Javascript package for LangChain which allows you to develop applications powered by Large Language Models.
Opik provides an integration that allows you to log all your chain executions to the Opik dashboard, making it easier to debug your chains and monitor your applicaation in production.
If you are using the Python LangChain package, refer to this integration guide
Getting Started
To use Opik with LangChainJS, make sure you have the following installed:
In addition you will need to set the following environment variables to make sure the data is logged to Opik if you are using the Cloud platform:
Logging a chain
In order to log a chain, you will need to create the Opik callback:
You can then use this callback in your LangChain chain:
Settings tags and metadata
You can also customize the OpikCallbackHandler
to include additional metadata,
tags. For example:
Logging to a specific project
You can also log to a specific project by setting the project
parameter:
Or alternatively, you can use the environment variable: