feat(ai): add provider connection test (#38)

This commit is contained in:
2026-11-24 16:21:48 +01:00
parent 2e865204c8
commit 54fced1ffb
16 changed files with 599 additions and 18 deletions

View File

@ -16,6 +16,9 @@ import (
)
type Handler struct {
connectionTester interface {
Test(context.Context, string) error
}
companyCatalog CompanyCatalog
indexSearcher indices.IndexSearcher
generationJobs interface {
@ -44,13 +47,16 @@ func New(
}
return &Handler{
companyCatalog: catalog,
repo: repo,
cfg: cfg,
enc: enc,
registry: registry,
pipeline: pipeline,
scheduler: sched,
reportManager: ai.NewReportManager(),
connectionTester: ai.NewConnectionTester(repo, enc, func(name, key, endpoint string) (ai.Provider, error) {
return ai.NewProvider(name, key, "", endpoint)
}),
repo: repo,
cfg: cfg,
enc: enc,
registry: registry,
pipeline: pipeline,
scheduler: sched,
reportManager: ai.NewReportManager(),
}
}