feat(ai): test saved summary model generation (#43)

This commit is contained in:
2026-11-25 09:32:05 +01:00
parent 33dcc11aa5
commit a3738de516
27 changed files with 1595 additions and 43 deletions

View File

@ -100,3 +100,12 @@ func (r *Repository) ResolveSummaryModel(ctx context.Context, userID string, id
}
return m, nil
}
// GetSummaryModelForTest resolves the exact saved entry without requiring enabled,
// an active provider, a user preference, or a known synthesis capacity profile.
// It is read-only and belongs solely to the authenticated admin test use case.
func (r *Repository) GetSummaryModelForTest(ctx context.Context, id string) (ResolvedSummaryModel, error) {
var m ResolvedSummaryModel
err := r.db.QueryRowContext(ctx, `SELECT m.id,p.id,p.name,m.model,p.endpoint,p.api_key_encrypted FROM ai_provider_models m JOIN ai_providers p ON p.id=m.provider_id WHERE m.id=$1`, id).Scan(&m.ID, &m.ProviderID, &m.Provider, &m.Model, &m.Endpoint, &m.APIKeyEncrypted)
return m, err
}