Respan instrumentation plugin for LangChain, LangGraph, and Langflow
Project description
respan-instrumentation-langchain
Python instrumentation for LangChain-compatible callback flows. It emits
Respan/Traceloop spans through respan-tracing, so LangChain chains, chat
models, tools, retrievers, LangGraph runs, and Langflow components that execute
LangChain/LangGraph callbacks are exported into the normal Respan trace pipeline.
Configuration
1. Install
pip install respan-instrumentation-langchain
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai. |
Quickstart
3. Run Script
from respan import Respan
from respan_instrumentation_langchain import LangChainInstrumentor
respan = Respan(instrumentations=[LangChainInstrumentor()])
chain.invoke({"question": "hello"})
respan.flush()
For explicit per-run callbacks:
from respan_instrumentation_langchain import add_respan_callback
chain.invoke(
{"question": "hello"},
config=add_respan_callback({"tags": ["demo"]}),
)
The same config helper works with LangGraph:
graph.invoke(
{"messages": [{"role": "user", "content": "hi"}]},
config=add_respan_callback({"configurable": {"thread_id": "thread-1"}}),
)
Langflow custom components can use get_callback_handler() or
add_respan_callback() when invoking LangChain or LangGraph objects.
4. View Dashboard
After running the script, traces appear on your Respan dashboard.
Further Reading
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_langchain-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_langchain-0.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
451a989575bbc1a11c14196eacfbf6c3cbc1f3419fbb2377225ea712d60e8a25
|
|
| MD5 |
575dc8f91fda324191a07386e0afd3f9
|
|
| BLAKE2b-256 |
0483fba3ad6e858bb3e1431cd2710e69da3318ae03b16de6b949b9c7d11edd2f
|
File details
Details for the file respan_instrumentation_langchain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_langchain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d35c70ea3ae0028fde3bc78261c76199857c9974c6fa2ab14bc286f19fb03199
|
|
| MD5 |
4dc37bee190fb1445c96f873bd537ba6
|
|
| BLAKE2b-256 |
f92b0a4b41a19980f2df775b10a3dbab69e41285517ddcdb82c81137c9b72921
|