reverie-adapter-openai
Zero-config Reverie instrumentation for the OpenAI Agents SDK.
Use
import reverie_openai
reverie_openai.auto()
# ... your normal Agents SDK code below ...
from agents import Agent, Runner
agent = Agent(name="my-agent", instructions="...")
result = await Runner.run(agent, "Do the thing.")
That's it. Every span produced by the SDK is translated into a Reverie
CognitiveEvent and posted to the backend (default http://127.0.0.1:8000).
What you get
| SDK span type | CognitiveEvent on start | CognitiveEvent on end |
|---|---|---|
agent |
goal.created |
goal.completed / goal.failed |
function |
tool.called |
tool.returned / tool.failed |
handoff |
subagent.spawned |
subagent.completed |
generation |
— | reasoning.extracted |
response |
— | reasoning.extracted |
guardrail |
— | validation.passed / validation.failed |
| Other types | (wrapped in GenericPayload for forward-compat) |
The full event tree (parentId + depth) is preserved.
Resilience
- Events are posted in batches of up to 50 every ~100ms.
- The emitter runs in a daemon thread with its own asyncio loop — the agent is never blocked.
- If the backend is unreachable, events are dropped silently. The agent always runs to completion.
- A bounded queue (10k events default) protects against memory blow-up.
Configuration
All optional, set as env vars before reverie_openai.auto():
| Var | Default | Description |
|---|---|---|
REVERIE_BACKEND_URL |
http://127.0.0.1:8000 |
Backend base URL |
REVERIE_AGENT_ID |
openai-agent |
Default agent id label |
REVERIE_QUEUE_SIZE |
10000 |
Max queued events |
REVERIE_BATCH_SIZE |
50 |
Max events per POST |
REVERIE_FLUSH_MS |
100 |
Max wait between flushes |
REVERIE_DISABLED |
(unset) | If set to 1, the adapter does nothing |
Install
uv pip install -e ".[dev]"
pytest
Metadata
Release files for reverie-adapter-openai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reverie_adapter_openai-0.1.0.tar.gz | 25.4 kB | Without provenance | Details for reverie_adapter_openai-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reverie_adapter_openai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for reverie_adapter_openai-0.1.0-py3-none-any.whl |
Total release size: 44.7 kB
Release files / reverie_adapter_openai-0.1.0.tar.gz
| Download URL | reverie_adapter_openai-0.1.0.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e24b971ee7f720329229add2a5040d83b16e4691151f8243c4d4ae0a2980e375
|
|
BLAKE2b-256 checksum How to use checksums |
425b06043f546f1acd679a2519dcaa8772f373db338c478675e45b3003a8a1cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / reverie_adapter_openai-0.1.0-py3-none-any.whl
| Download URL | reverie_adapter_openai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1beeefd8513f2149998143a79137b6fa1ff7d0944b4b0bacf33b498cf176fb0c
|
|
BLAKE2b-256 checksum How to use checksums |
44f8582a3a396f892e8ae34f03f04906fcde08c2a494a6605ec84d331e5bc020
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for reverie-adapter-openai 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.