Metadata-Version: 2.4
Name: rbtrace
Version: 1.0.0
Summary: Run labels for agents behind a ReasonBlocks capture gateway: two lines, two headers, no dependencies.
Author: ReasonBlocks
License: Proprietary
Project-URL: Documentation, https://docs.reasonblocks.com
Project-URL: Homepage, https://reasonblocks.com
Keywords: llm,agents,observability,tracing,anthropic,openai
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# rbtrace

Run labels for agents running behind a [ReasonBlocks](https://reasonblocks.com) capture
gateway.

```bash
pip install rbtrace
```

```python
import rbtrace.client as shim; shim.install()
```

Two lines at process startup, before your agent's first LLM call. Nothing inside your LLM
SDK or agent framework changes.

## What it does

`install()` stamps two HTTP headers — `X-RB-Run` and `X-RB-Seq` — on your agent's outbound
LLM API calls, so the gateway can tell one job's calls from another's instead of inferring
it from timing and content. That is the difference between a run whose boundaries are
**proven** and one that is guessed at, and it is what makes a trace eligible for training.

It reads no request bodies, sends nothing of its own, and has **no dependencies** — it
patches whichever HTTP transport your agent already uses (`httpx`, `httpx2`, `aiohttp`,
`botocore`) and never installs one.

## Scoping runs

When one process handles many logical jobs — a queue worker, a batch loop, a thread pool —
scope each one so they do not merge into a single run:

```python
import rbtrace.client as shim

shim.install()

for job in jobs:
    with shim.run():
        handle(job)
```

For a boto3 session or client built *before* `install()` ran:

```python
shim.install_botocore(session_or_client)
```

`shim.installed_transports()` reports which transports were actually patched.

## Turning it off

`RBTRACE_DISABLE=1` disables stamping without removing the import. Capture continues
through the gateway; run boundaries fall back to inference.

## Documentation

Full integration guide, gateway setup and per-provider details:
**[docs.reasonblocks.com](https://docs.reasonblocks.com)**
