Reference for the brain slot. For worked examples and guidance, see
Bring Your Agent; this page is the contract.
The DialogAdapter protocol
Defined in unpod.adapters.base. Runtime-checkable - any object with these
three methods passes isinstance(obj, DialogAdapter); no base class required.
stream() now receives a language keyword argument on every turn. Any custom
adapter whose stream() does not accept language=... raises TypeError on the
first user turn. Add language: str | None = None to the signature.
session.run() calls only stream(). A single-chunk stream() fallback
(await the full reply, yield once) produces choppy, high-latency audio with no
error anywhere. See
Streaming is the hot path.
Auto-wrapping
The ctx.session.dialog_machine setter accepts, in order:
- A superdialog
DialogMachine or LLMAgent - wrapped in a
SuperDialogAdapter automatically.
- Any object satisfying the
DialogAdapter protocol - used as-is.
- Anything else - raises
TypeError.
Bundled adapters
All importable from unpod.adapters:
AnthropicAdapter, DialogAdapter, HTTPAdapter, LangChainAdapter,
MCPAdapter, OpenAIAdapter, SuperDialogAdapter.
Constructor signatures
Streaming behavior
assist() semantics
Beyond the protocol, SuperDialogAdapter exposes the wrapped agent’s controls:
is_complete and state work on both engines; on the Playbook engine state
returns {"checkpoint": ..., "slots": ..., "ended": ...}. switch_flow applies
only to the legacy graph engine (a DialogMachine built from a FlowSet).
See SuperDialog for the agent itself.
Error surfaces