TinkerFin AG-UI Adapter
What it is
tinkerfin-agui-adapter converts caller-owned Deep Agents or LangGraph v2 stream
parts into validated AG-UI 0.1.19 events. It does not create a graph, query
checkpoints, authenticate requests, or provide HTTP routes.
Use it when an application already owns graph execution and only needs protocol
conversion. Applications that need Agent installation, execution scope, checkpoint
access, and SSE can use tinkerfin.
Installation
Python 3.11 or newer is required. The package is not published to PyPI. From the repository root, install the locked workspace:
uv sync --all-packages --locked
Quick Start
The converter accepts an asynchronous iterable of v2 parts. This minimal stream is self-contained and does not require Deep Agents or LangGraph at runtime:
import asyncio
from langchain_core.messages import AIMessageChunk
from tinkerfin_agui_adapter import astream_events
run_input = {
"threadId": "thread-1",
"runId": "run-1",
"state": {},
"messages": [{"id": "user-1", "role": "user", "content": "Hello"}],
"tools": [],
"context": [],
"forwardedProps": {},
}
async def parts():
yield {
"type": "messages",
"ns": (),
"data": (
AIMessageChunk(id="ai-1", content="Hello", chunk_position="last"),
{"lc_agent_name": None, "langgraph_node": "model"},
),
}
yield {"type": "values", "ns": (), "data": {}, "interrupts": ()}
async def main():
async for event in astream_events(input=run_input, parts=parts()):
print(event.type.value)
asyncio.run(main())
Real graph integration should provide live v2 messages, tasks, and values
parts. The adapter pulls with backpressure and closes the upstream iterator on
cancellation or early consumer exit when aclose() is available.
Event contract
- One request emits one
RUN_STARTEDand one main terminal event. - Text, reasoning, and Tool lifecycles close before state, interrupt, error, or completion events.
- Namespaces and protocol IDs correlate concurrent messages, Tool calls, results, and subagents; arrival order is not identity.
- Provider-private reasoning is excluded from public payloads.
expose_reasoning_events=Trueenables only supported reasoning fields. expose_subagent_events=Falsestill validates subgraph parts while suppressing their public events.encode_sse(event, event_id=...)encodes one event; transport order, delivery, retry, and cancellation remain the caller's responsibility.
License
Apache License 2.0. See LICENSE.
Metadata
Release files for tinkerfin-agui-adapter 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 | |
|---|---|---|---|
| tinkerfin_agui_adapter-0.1.0.tar.gz | 70.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tinkerfin_agui_adapter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 117.5 kB
Release files / tinkerfin_agui_adapter-0.1.0.tar.gz
| Download URL | tinkerfin_agui_adapter-0.1.0.tar.gz |
|---|---|
| Size | 70.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7a0bb758f01a5e7be0b7608139db9f5f99046e82c338dc6f75a29a78f139716
|
|
BLAKE2b-256 checksum How to use checksums |
6b1c0232eafef9ea94ba1265ce6e1635e866400c7345efcd43978c4e61a028d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / tinkerfin_agui_adapter-0.1.0-py3-none-any.whl
| Download URL | tinkerfin_agui_adapter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 46.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a53e76d6885d94dae29ef278dfcf7bebb9a98e7f0cc121f7a6973d57ee21b2ab
|
|
BLAKE2b-256 checksum How to use checksums |
0505647c2e4ba3acc7ff3eaa720e2577e708130617f1cf1e3e44d8185a86e364
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|