Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion integrations/langchain-py/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# braintrust-langchain
# braintrust-langchain (DEPRECATED)

[![PyPI version](https://img.shields.io/pypi/v/braintrust-langchain.svg)](https://pypi.org/project/braintrust-langchain/)

SDK for integrating [Braintrust](https://braintrust.dev) with [LangChain](https://langchain.com/). This package provides a callback handler to automatically log LangChain executions to Braintrust.

> **This package is deprecated.** The LangChain integration is now included in the main [`braintrust`](https://pypi.org/project/braintrust/) package.

## Migration

1. Remove `braintrust-langchain` from your dependencies
2. Install or upgrade `braintrust`:
```bash
pip install --upgrade braintrust
```
3. Update your imports:
```python
# Before
from braintrust_langchain import BraintrustCallbackHandler, set_global_handler

# After (option 1: auto-instrument langchain library)
import braintrust
braintrust.auto_instrument()

# After (option 2: explicit)
from braintrust.integrations.langchain import BraintrustCallbackHandler, set_global_handler
```

The API is identical - no code changes needed beyond the import path.

---

## Installation

```bash
Expand Down
7 changes: 3 additions & 4 deletions integrations/langchain-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "braintrust-langchain"
version = "0.2.1"
description = "Integration for LangChain and Braintrust Tracing"
description = "DEPRECATED: LangChain integration is now included in the main braintrust package. Install braintrust instead."
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
Expand All @@ -10,9 +10,9 @@ dependencies = [
]
license = "MIT"
authors = [{ name = "Braintrust", email = "info@braintrust.dev" }]
keywords = ["braintrust", "langchain", "llm", "tracing", "ai", "agents"]
keywords = ["braintrust", "langchain", "llm", "tracing", "ai", "agents", "deprecated"]
classifiers = [
"Development Status :: 4 - Beta",
"Development Status :: 7 - Inactive",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -73,4 +73,3 @@ known-third-party = ["braintrust", "langchain"]
[tool.pytest.ini_options]
testpaths = ["src/tests"]
python_files = ["test_*.py"]
addopts = "-v"
30 changes: 27 additions & 3 deletions integrations/langchain-py/src/braintrust_langchain/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
from .callbacks import BraintrustCallbackHandler
from .context import set_global_handler
"""
DEPRECATED: braintrust-langchain is now part of the main braintrust package.

__all__ = ["BraintrustCallbackHandler", "set_global_handler"]
Install `braintrust` and use `braintrust.integrations.langchain` or
`braintrust.auto_instrument()` instead. This package now re-exports from
`braintrust.integrations.langchain` for backward compatibility.
"""

import warnings

warnings.warn(
"braintrust-langchain is deprecated. The LangChain integration is now included in the "
"main 'braintrust' package. Use 'from braintrust.integrations.langchain import "
"BraintrustCallbackHandler' or 'braintrust.auto_instrument()' instead. "
"This package will be removed in a future release.",
DeprecationWarning,
stacklevel=2,
)

# Re-export public API from the new location for backward compatibility
from braintrust.integrations.langchain import ( # noqa: E402, F401
BraintrustCallbackHandler,
BraintrustTracer,
clear_global_handler,
set_global_handler,
)

__all__ = ["BraintrustCallbackHandler", "BraintrustTracer", "set_global_handler", "clear_global_handler"]
Loading