Update 4
release-tag / release-image (push) Successful in 1m42s

This commit is contained in:
2026-08-04 14:23:48 +02:00
parent e94fb23f0c
commit 5387563e4e
14 changed files with 883 additions and 165 deletions
+10
View File
@@ -48,6 +48,8 @@ type Config struct {
ArticleMinConfidence float64
ArticleMinTextChars int
ArticleMinAnswerChars int
ArticleMaxResearchQueries int
ArticleResearchResults int
TopK int
MaxContextChars int
AutoEnrich bool
@@ -130,6 +132,8 @@ func Load() (Config, error) {
ArticleMinConfidence: number("BRAIN_ARTICLE_MIN_CONFIDENCE", 0.74),
ArticleMinTextChars: integer("BRAIN_ARTICLE_MIN_TEXT_CHARS", 180),
ArticleMinAnswerChars: integer("BRAIN_ARTICLE_MIN_ANSWER_CHARS", 420),
ArticleMaxResearchQueries: integer("BRAIN_ARTICLE_MAX_RESEARCH_QUERIES", 3),
ArticleResearchResults: integer("BRAIN_ARTICLE_RESEARCH_RESULTS", 4),
TopK: integer("BRAIN_TOP_K", 8),
MaxContextChars: integer("BRAIN_MAX_CONTEXT_CHARS", 16000),
AutoEnrich: boolean("BRAIN_AUTO_ENRICH", true),
@@ -203,6 +207,12 @@ func Load() (Config, error) {
if cfg.ArticleMinAnswerChars < 100 || cfg.ArticleMinAnswerChars > 50000 {
return Config{}, fmt.Errorf("BRAIN_ARTICLE_MIN_ANSWER_CHARS must be between 100 and 50000")
}
if cfg.ArticleMaxResearchQueries < 1 || cfg.ArticleMaxResearchQueries > 10 {
return Config{}, fmt.Errorf("BRAIN_ARTICLE_MAX_RESEARCH_QUERIES must be between 1 and 10")
}
if cfg.ArticleResearchResults < 1 || cfg.ArticleResearchResults > 10 {
return Config{}, fmt.Errorf("BRAIN_ARTICLE_RESEARCH_RESULTS must be between 1 and 10")
}
if cfg.ResearchEnabled && cfg.SearXNGURL == "" {
return Config{}, fmt.Errorf("BRAIN_RESEARCH_ENABLED requires SEARXNG_URL")
}