update see calss

This commit is contained in:
2026-08-23 22:03:57 +02:00
parent f3d4fb56ed
commit 8983cfc8a1
32 changed files with 1884 additions and 22 deletions
+5 -1
View File
@@ -8,6 +8,7 @@ import (
"strings"
"time"
"github.com/descrybe/descrybe-v2/apps/api/internal/aiaudit"
"github.com/descrybe/descrybe-v2/apps/api/internal/platformsettings"
"github.com/descrybe/descrybe-v2/apps/api/internal/processing"
"github.com/descrybe/descrybe-v2/apps/api/internal/security"
@@ -40,6 +41,9 @@ type Service struct {
// When nil or a role is unset, ResolveCompleterForRole falls back to Resolve.
Roles RoleEndpointSource
HTTPClient *http.Client
// Audit optionally captures every resolved Completer's prompts/responses for
// the admin AI inspector. Nil disables capture (see audit.go).
Audit *aiaudit.Recorder
}
func NewService(pool *pgxpool.Pool, env EnvConfig) *Service {
@@ -339,7 +343,7 @@ func (s *Service) ResolveCompleter(ctx context.Context, companyID uuid.UUID) (pr
if err != nil {
return nil, ModeInternalLabel, false, err
}
return r.Completer, r.ModeLabel, r.UsingBYOK, nil
return s.wrapAudit(r.Completer, companyID, RoleProcessing, r.ModeLabel), r.ModeLabel, r.UsingBYOK, nil
}
// TestPlatformRole probes admin platform AI role credentials (not company BYOK).