Use this file to discover all available pages before exploring further.
Every STT provider implements three methods. Adding a new provider means creating the implementation, reading vault credentials, and registering in the factory.
// api/assistant-api/internal/transformer/myprovider/stt.gopackage myprovidertype myProviderSTT struct { opt *myProviderOption onPacket func(STTPacket) // callback invoked with each transcript client interface{} // your provider's streaming client}func NewMyProviderSTT(opt *myProviderOption, onPacket func(STTPacket)) *myProviderSTT { return &myProviderSTT{opt: opt, onPacket: onPacket}}// Initialize opens the streaming connection to your provider.func (s *myProviderSTT) Initialize() error { // Connect to your provider's real-time STT endpoint // Register s.onPacket to be called with each transcription result return nil}// Transform sends one audio packet — in.Audio is raw PCM 16-bit mono 16kHz.func (s *myProviderSTT) Transform(ctx context.Context, in UserAudioPacket) error { // Forward in.Audio bytes to your provider's streaming client return nil}// Close tears down the connection.func (s *myProviderSTT) Close(ctx context.Context) error { return nil}
Input format:UserAudioPacket.Audio = raw PCM 16-bit signed mono, 16000 Hz sample rate.