fix(ai): diagnose summary provider failures (#37)

This commit is contained in:
2026-11-24 15:06:01 +01:00
parent a53aec7947
commit 6e7fbb129a
10 changed files with 458 additions and 19 deletions

View File

@ -19,12 +19,13 @@ import (
)
type Dependencies struct {
CompanyCatalog companycatalog.CompanyCatalog
LayaRanker generation.LayaRanker
Feeds map[string]scraper.Scraper
IndexSearcher indices.IndexSearcher
GenerationFactory func(*ai.Pipeline) generation.UseCase
EnableScheduler bool
SummaryDiagnostics ai.SummaryDiagnosticCollector
CompanyCatalog companycatalog.CompanyCatalog
LayaRanker generation.LayaRanker
Feeds map[string]scraper.Scraper
IndexSearcher indices.IndexSearcher
GenerationFactory func(*ai.Pipeline) generation.UseCase
EnableScheduler bool
}
type App struct {
Router *gin.Engine
@ -34,6 +35,7 @@ type App struct {
func New(repo *models.Repository, cfg *config.Config, deps Dependencies) *App {
enc := crypto.New(cfg.EncryptionKey)
pipeline := ai.NewPipeline(repo, enc)
pipeline.SetSummaryDiagnosticCollector(deps.SummaryDiagnostics)
if names, ok := deps.CompanyCatalog.(generation.MentionNameResolver); ok {
pipeline.SetMentionNameResolver(names)
}