fix(ai): diagnose summary provider failures (#37)
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user