Skip to main content
The braintrust-langchain package provides seamless integration between Braintrust and LangChain for Python.

Installation

pip install braintrust-langchain

Quick start

from braintrust_langchain import BraintrustCallbackHandler
from langchain_openai import ChatOpenAI

# Create a callback handler
handler = BraintrustCallbackHandler()

# Use with any LangChain model
llm = ChatOpenAI(callbacks=[handler])

API Reference

Source Code

For the complete source code and additional examples, visit the braintrust-sdk repository.