feat(laya): integrate HTTP ranking service

Add the pinned Laya HTTP ranker and production composition, configure the CPU Compose service and cache, and document operations. Cover protocol validation, generation orchestration, sanitized logging, and Compose wiring.

Refs #17

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 00:55:18 +01:00
parent 89503c52fc
commit 1123360914
15 changed files with 1023 additions and 9 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"log"
"github.com/tradarr/backend/internal/ai"
"github.com/tradarr/backend/internal/config"
"github.com/tradarr/backend/internal/crypto"
"github.com/tradarr/backend/internal/database"
@ -22,6 +23,10 @@ func main() {
log.Fatalf("config: %v", err)
}
laya, err := ai.NewLayaHTTPRanker(ai.LayaHTTPConfig{BaseURL: cfg.LayaURL, Timeout: cfg.LayaTimeout, APIKey: cfg.LayaAPIKey})
if err != nil {
log.Fatalf("config: %v", err)
}
db, err := database.Connect(cfg.DatabaseURL)
if err != nil {
log.Fatalf("database: %v", err)
@ -45,7 +50,7 @@ func main() {
models.SourceWatcherGuru: watcherguru.New(),
}
app := server.New(repo, cfg, server.Dependencies{Feeds: feeds, IndexSearcher: openfigi.New(openfigi.Config{APIKey: cfg.OpenFIGIAPIKey, Timeout: cfg.OpenFIGITimeout}, nil), EnableScheduler: true})
app := server.New(repo, cfg, server.Dependencies{LayaRanker: laya, Feeds: feeds, IndexSearcher: openfigi.New(openfigi.Config{APIKey: cfg.OpenFIGIAPIKey, Timeout: cfg.OpenFIGITimeout}, nil), EnableScheduler: true})
defer app.Close()
addr := fmt.Sprintf(":%s", cfg.Port)