refactor(voice): introduce Transcriber interface for pluggable STT#353
Open
emadomedher wants to merge 1 commit intosipeed:mainfrom
Open
refactor(voice): introduce Transcriber interface for pluggable STT#353emadomedher wants to merge 1 commit intosipeed:mainfrom
emadomedher wants to merge 1 commit intosipeed:mainfrom
Conversation
Currently Discord, Slack, and Telegram all hardcode *voice.GroqTranscriber
as their transcription dependency. This makes it impossible to swap in a
different STT backend without changing each channel file.
Add a Transcriber interface to pkg/voice/transcriber.go:
type Transcriber interface {
Transcribe(ctx context.Context, audioFilePath string) (*TranscriptionResponse, error)
IsAvailable() bool
}
GroqTranscriber already implements this interface (no change to its
implementation). Update Discord, Slack, and Telegram to depend on the
interface instead of the concrete type.
No behaviour change — this is a pure refactor that enables future STT
providers (e.g. local Whisper) to be dropped in without modifying channel
code.
This was referenced Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Currently Discord, Slack, and Telegram all hardcode
*voice.GroqTranscriberas their transcription dependency. This makes it impossible to swap in a different STT backend without modifying every channel file.This PR adds a
Transcriberinterface topkg/voice/transcriber.goand updates the three channels to depend on it instead of the concrete type.Changes
pkg/voice/transcriber.go: addTranscriberinterface (Transcribe+IsAvailable)pkg/channels/discord.go:*voice.GroqTranscriber→voice.Transcriberpkg/channels/slack.go: samepkg/channels/telegram.go: sameGroqTranscriberalready satisfies the interface — zero behaviour change.Why
This unblocks adding alternative STT providers (e.g. local Whisper — see follow-up PR) without touching channel code. It also aligns with how the
Synthesizerinterface works for TTS.Tests
All existing tests pass (
go test ./...).