mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-15 10:14:51 +00:00
feat(tts): add test-connection endpoint, hot-reload support, and Telegram voice messages
- Add POST /v1/tts/test-connection for testing TTS credentials before saving - Add UpdateManager() with RWMutex for thread-safe HTTP handler hot-reload - Add sendVoice() for Telegram voice bubble support via audio_as_voice metadata - Wire ttsHandler into gateway deps for config reload propagation
This commit is contained in:
1 parent
c81cf6cf39
commit
34172d2767
9 files changed
+600
-6
No files matched your search
+3
-1
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/nextlevelbuilder/goclaw/internal/config"
|
||||
"github.com/nextlevelbuilder/goclaw/internal/eventbus"
|
||||
"github.com/nextlevelbuilder/goclaw/internal/gateway"
|
||||
httpapi "github.com/nextlevelbuilder/goclaw/internal/http"
|
||||
"github.com/nextlevelbuilder/goclaw/internal/providers"
|
||||
"github.com/nextlevelbuilder/goclaw/internal/skills"
|
||||
"github.com/nextlevelbuilder/goclaw/internal/store"
|
||||
@@ -34,5 +35,6 @@ type gatewayDeps struct {
|
||||
workspace string
|
||||
dataDir string
|
||||
domainBus eventbus.DomainEventBus
|
||||
audioMgr *audio.Manager // nil if TTS not configured; used by TTSHandler
|
||||
audioMgr *audio.Manager // nil if TTS not configured; used by TTSHandler
|
||||
ttsHandler *httpapi.TTSHandler // nil if TTS not configured; for hot-reload
|
||||
}
|
||||
@@ -255,6 +255,7 @@ func (d *gatewayDeps) wireHTTPHandlersOnServer(
|
||||
ttsH.SetRateLimiter(rl.Allow)
|
||||
}
|
||||
d.server.SetTTSHandler(ttsH)
|
||||
d.ttsHandler = ttsH // store for hot-reload
|
||||
}
|
||||
|
||||
// Seed + apply builtin tool disables
|
||||
|
||||
@@ -103,6 +103,9 @@ func (d *gatewayDeps) runLifecycle(
|
||||
return
|
||||
}
|
||||
deps.ttsTool.UpdateManager(newMgr)
|
||||
if d.ttsHandler != nil {
|
||||
d.ttsHandler.UpdateManager(newMgr)
|
||||
}
|
||||
slog.Info("tts config reloaded", "provider", newMgr.PrimaryProvider(), "auto", string(newMgr.AutoMode()))
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user