calado LangChain callback handler — captures chain, LLM, tool, and retriever events and ships them to calado for analysis.
Project description
calado-langchain
Drop-in calado observability for LangChain and LangGraph agents.
Install
pip install 'calado-langchain==0.0.1'
Requires Python 3.9+ and langchain-core>=0.2.10,<0.5.
Quick start
import os
from calado_langchain import CaladoCallbackHandler
os.environ["CALADO_API_KEY"] = "cl_..."
handler = CaladoCallbackHandler()
# Per-chain mode
chain.invoke(
{"input": "..."},
config={
"callbacks": [handler],
"metadata": {"session_id": "user-42"},
},
)
The SDK reads session_id from metadata. It also picks up
thread_id (LangGraph convention) and langsmith_session_id /
langchain_session_id automatically, plus a session:<id> tag as
a fallback.
Or set CALADO_ENABLED=true plus CALADO_API_KEY=cl_... and the
handler attaches to every chain in the process automatically. No code
change required.
On the first successful POST a single line lands in stderr:
[calado] Connected. First batch sent. View at https://app.calado.ai/agents/<agent_id>
Public surface
CaladoCallbackHandler(
*,
api_key=None, # or env CALADO_API_KEY
base_url=None, # or env CALADO_BASE_URL, default https://app.calado.ai
batch_size=10,
flush_interval_s=30.0,
max_run_age_s=3600.0,
max_queue_bytes=10 * 1024 * 1024,
debug=False,
mask=None, # callable: dict -> dict | None (sync or async)
)
CaladoAsyncCallbackHandler(...) # same signature, for ainvoke / LangGraph
handler.status() # dict — see docs/transport-spec.md §3
await handler.astatus()
handler.flush(timeout_s=5.0)
handler.shutdown(timeout_s=5.0)
Constructor is keyword-only. The mask callable can be either sync or
async; the SDK detects which without invoking it. Returning None drops
that single child run (per-OV7 granularity). Patterns and recipes live
at https://docs.calado.ai/ingestion/redaction.
Diagnostics
python -m calado_langchain doctor
Prints the installed calado-langchain and langchain-core versions,
the supported range, and the fix command on resolver failure.
Pre-1.0 semver
calado-langchain is pre-1.0. Minor versions (0.x.0) may introduce
breaking changes. Pin exactly until 1.0 ships. See
CHANGELOG.md.
Links
- Docs — https://docs.calado.ai/ingestion/langchain
- Redaction patterns — https://docs.calado.ai/ingestion/redaction
- Shared transport spec —
docs/transport-spec.md - Plan + review trail —
plans/langchain_callback_handler.md
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 calado_langchain-0.0.1.tar.gz.
File metadata
- Download URL: calado_langchain-0.0.1.tar.gz
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a827ea8b5e3f63cf8bbd2a7cdef07ba15fc7cf4a82b0d52b207a7601b7106c39
|
|
| MD5 |
eb07a3d9b0b79d5a27c4580baa9b8085
|
|
| BLAKE2b-256 |
d7d65c5c8370f9ad80fe1eca88482874e9136a3bb0a292d69bb90a821c0af5b4
|
Provenance
The following attestation bundles were made for calado_langchain-0.0.1.tar.gz:
Publisher:
publish-python-langchain.yml on 43designstudio/calado
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calado_langchain-0.0.1.tar.gz -
Subject digest:
a827ea8b5e3f63cf8bbd2a7cdef07ba15fc7cf4a82b0d52b207a7601b7106c39 - Sigstore transparency entry: 1536819211
- Sigstore integration time:
-
Permalink:
43designstudio/calado@a23b99ca331cec801a7b65089eefd5dda774ae1a -
Branch / Tag:
refs/tags/langchain-py-v0.0.1 - Owner: https://github.com/43designstudio
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-langchain.yml@a23b99ca331cec801a7b65089eefd5dda774ae1a -
Trigger Event:
push
-
Statement type:
File details
Details for the file calado_langchain-0.0.1-py3-none-any.whl.
File metadata
- Download URL: calado_langchain-0.0.1-py3-none-any.whl
- Upload date:
- Size: 32.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b111f30fafdf0987ac3b41c1b87b87ac6a2263c28224de770f790382ad531dbf
|
|
| MD5 |
182cd204dfa299d562facc6b5782c0f8
|
|
| BLAKE2b-256 |
75653795fdee4f3afb9b1f87930ba6e470f7cb85346cac550d9c8e3a7c8166bf
|
Provenance
The following attestation bundles were made for calado_langchain-0.0.1-py3-none-any.whl:
Publisher:
publish-python-langchain.yml on 43designstudio/calado
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calado_langchain-0.0.1-py3-none-any.whl -
Subject digest:
b111f30fafdf0987ac3b41c1b87b87ac6a2263c28224de770f790382ad531dbf - Sigstore transparency entry: 1536819272
- Sigstore integration time:
-
Permalink:
43designstudio/calado@a23b99ca331cec801a7b65089eefd5dda774ae1a -
Branch / Tag:
refs/tags/langchain-py-v0.0.1 - Owner: https://github.com/43designstudio
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-langchain.yml@a23b99ca331cec801a7b65089eefd5dda774ae1a -
Trigger Event:
push
-
Statement type: