Add load job configuration

This commit is contained in:
dwrz
2026-06-02 12:03:15 +00:00
parent 9751a24c1e
commit e5238e4081
3 changed files with 199 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import (
"regexp"
"time"
"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"
@@ -30,6 +31,8 @@ type Config struct {
LLM llm.Config `yaml:"llm"`
// STT configures the speech-to-text client.
STT stt.Config `yaml:"stt"`
// Jobs defines scheduled autonomous tasks.
Jobs []job.Config `yaml:"jobs"`
// Tools defines external commands available to the LLM.
Tools []tool.Tool `yaml:"tools"`
// TTS configures the text-to-speech client.
@@ -74,6 +77,11 @@ func (cfg *Config) Validate() error {
cfg.ShutdownTimeout, err,
)
}
for i, jc := range cfg.Jobs {
if err := jc.Validate(); err != nil {
return fmt.Errorf("jobs[%d] invalid: %w", i, err)
}
}
for i, t := range cfg.Tools {
if err := t.Validate(); err != nil {
return fmt.Errorf("tools[%d] invalid: %w", i, err)