Transformers Overview
pkgs/genx/transformers converts one genx.Stream to another Stream. Provider adapters own external speech/realtime protocols; Stream Processing owns provider-neutral lifecycle, buffering, audio-byte stream filtering, TTS segmentation, and composition.
Adapter structure
| Adapter | Capabilities |
|---|---|
| Doubao Speech | ASR, TTS, Realtime, Realtime Duplex and speech translation. |
| DashScope | Realtime multimodal conversation. |
| MiniMax | Streaming TTS. |
| Stream Processing | Provider-neutral mux, Stream lifecycle, audio-byte stream filtering, and text segmentation. |
Provider implementations and the shared internal Stream lifecycle use independent packages:
pkgs/genx/transformers/
├── audiostream/
├── internal/streamkit/
├── doubaoasr/
├── doubaotts/
├── minimaxtts/
├── doubaoast/
├── doubaorealtime/
├── doubaorealtimeduplex/
└── dashscoperealtime/Each provider package supplies a typed constructor such as doubaoasr.New, doubaotts.NewSeedV2, or minimaxtts.New. Constructors only resolve immutable configuration and do not connect to the provider; each Transform(ctx, input) call creates and owns its provider session. Provider adapters are no longer exposed through flat transformers.New* constructors.
ASR, TTS, AST, and Doubao Realtime Dialogue are Stream-to-Stream Transformers, not agent-capable runtimes. Doubao Realtime Duplex and DashScope Realtime are the current provider packages whose protocols can support Toolkit continuation. StreamKit is independent of that classification and never owns tools.
Core structure and main function
| Symbol | Function |
|---|---|
Mux | Universal Transformer registry. |
Transform | Select and execute the Transformer via the default mux. |
Handle | Register a universal Transformer. |
ASR, TTS, Realtime and other capabilities all implement the same genx.Transformer and are registered through the same Mux. Guide does not define additional facade, session factory, or registry APIs for capability classes.