Skip to content

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.

Go API References

Adapter structure

AdapterCapabilities
Doubao SpeechASR, TTS, Realtime, Realtime Duplex and speech translation.
DashScopeRealtime multimodal conversation.
MiniMaxStreaming TTS.
Stream ProcessingProvider-neutral mux, Stream lifecycle, audio-byte stream filtering, and text segmentation.

Provider implementations and the shared internal Stream lifecycle use independent packages:

text
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

SymbolFunction
MuxUniversal Transformer registry.
TransformSelect and execute the Transformer via the default mux.
HandleRegister 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.