feat(audio): wire Scribe STT + legacy bridge in gateway setup

Register ElevenLabs Scribe and proxy STT providers in gateway initialization. Auto-wire legacy STT bridge from existing channel STTProxyURL configs. Implement setupAudioExtras() with RegisterSTT and SetSTTChain calls. Maintains backward compat with per-channel configs.
This commit is contained in:
viettranx
2026-04-15 11:24:57 +07:00
parent 0977952110
commit b7002a67d1
2 changed files with 15 additions and 1 deletions
+12
View File
@@ -315,4 +315,16 @@ func setupAudioExtras(cfg *config.Config, mgr *tts.Manager) {
slog.Info("audio.music: minimax registered")
}
}
// ElevenLabs STT (Scribe v2) — reuse TTS credentials. Registered as tenant-scope
// default; per-request tenant override lands via builtin_tools[stt] in Phase 5
// channel migration. Legacy per-channel STTProxyURL is bridged separately.
if ellKey != "" {
mgr.RegisterSTT(elevenlabs.NewSTTProvider(elevenlabs.Config{
APIKey: ellKey,
BaseURL: ellBase,
}))
mgr.SetSTTChain([]string{"elevenlabs", "proxy"})
slog.Info("audio.stt: elevenlabs registered")
}
}
+3 -1
View File
@@ -10,6 +10,7 @@ import (
"github.com/google/uuid"
"github.com/nextlevelbuilder/goclaw/internal/audio"
"github.com/nextlevelbuilder/goclaw/internal/bootstrap"
"github.com/nextlevelbuilder/goclaw/internal/bus"
"github.com/nextlevelbuilder/goclaw/internal/config"
@@ -139,7 +140,8 @@ func setupToolRegistry(
if ttsMgr == nil {
ttsMgr = tts.NewManager(tts.ManagerConfig{})
}
setupAudioExtras(cfg, ttsMgr) // Phase 3: registers Music + SFX providers.
setupAudioExtras(cfg, ttsMgr) // Phase 3: registers Music + SFX providers.
audio.BridgeLegacySTT(ttsMgr, cfg) // Phase 4: bridge per-channel STTProxyURL → channel-scoped providers.
// Audio generation tool — backed by audio.Manager (Music + SFX).
toolsReg.Register(tools.NewCreateAudioTool(ttsMgr))