Refactor STT architecture

This commit is contained in:
dwrz
2026-06-15 10:51:17 +00:00
parent 70e1a995f3
commit c71300b1bf
12 changed files with 321 additions and 634 deletions

View File

@@ -9,7 +9,6 @@ import (
"code.chimeric.al/chimerical/odidere/internal/job"
"code.chimeric.al/chimerical/odidere/internal/llm"
"code.chimeric.al/chimerical/odidere/internal/stt"
"code.chimeric.al/chimerical/odidere/internal/tool"
"gopkg.in/yaml.v3"
@@ -25,10 +24,6 @@ type TTS struct {
// Timeout is the maximum duration for a synthesis request.
// Defaults to 60s if empty.
Timeout string `yaml:"timeout"`
// VoiceMap maps whisper language names to voice IDs.
// Used by SelectVoice to auto-select voices based on detected
// language.
VoiceMap map[string]string `yaml:"voice_map"`
}
func (cfg TTS) Validate() error {
@@ -46,6 +41,22 @@ func (cfg TTS) Validate() error {
return nil
}
// STT holds the configuration for the frontend-facing speech-to-text server.
// The URL is passed to the browser via a meta tag; the browser calls
// whisper-server directly.
type STT struct {
// URL is the base URL of the whisper-server.
// For example, "http://localhost:8178".
URL string `yaml:"url"`
}
func (cfg STT) Validate() error {
if cfg.URL == "" {
return fmt.Errorf("missing URL")
}
return nil
}
// Config holds all application configuration sections.
type Config struct {
// Address is the host:port to listen on.
@@ -59,8 +70,8 @@ type Config struct {
// LLM configures the language model client.
LLM llm.Config `yaml:"llm"`
// STT configures the speech-to-text client.
STT stt.Config `yaml:"stt"`
// STT configures the speech-to-text server URL passed to the frontend.
STT STT `yaml:"stt"`
// Jobs defines scheduled autonomous tasks.
Jobs []job.Config `yaml:"jobs"`
// Tools defines external commands available to the LLM.

View File

@@ -215,7 +215,7 @@ llm:
url: http://localhost:8080
stt:
timeout: "30s"
url: ""
tts:
url: http://localhost:8880