Adopt Audita v2 configuration and subprocess contract
This commit is contained in:
@@ -207,35 +207,18 @@ func buildDefaultAuditaRunner(cfg *config.Config) (audita.Runner, error) {
|
||||
return &audita.NoopRunner{}, nil
|
||||
}
|
||||
|
||||
report := false
|
||||
if a.Report != nil {
|
||||
report = *a.Report
|
||||
timeout, err := time.ParseDuration(a.Timeout)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parse pipeline.audita.timeout %q: %w", a.Timeout, err)
|
||||
}
|
||||
llmAPIKey := ""
|
||||
llmAPIKeyReference := ""
|
||||
if a.LLMAPIKey != nil {
|
||||
llmAPIKey = a.LLMAPIKey.Value()
|
||||
llmAPIKeyReference = a.LLMAPIKey.EnvName()
|
||||
}
|
||||
|
||||
runner, err := audita.NewSubprocessRunnerFromConfigValues(
|
||||
a.Binary,
|
||||
a.Timeout,
|
||||
llmAPIKey,
|
||||
llmAPIKeyReference,
|
||||
append([]string(nil), a.Modules...),
|
||||
a.BaseURL,
|
||||
a.Model,
|
||||
a.TranscriptDescription,
|
||||
a.ConfigPath,
|
||||
a.OutputSchema,
|
||||
a.WorkDirRetention,
|
||||
a.TotalLLMConcurrency,
|
||||
a.ProposalLLMConcurrency,
|
||||
a.ValidationModel,
|
||||
a.ValidationLLMConcurrency,
|
||||
report,
|
||||
)
|
||||
runner, err := audita.NewSubprocessRunner(audita.SubprocessRunnerConfig{
|
||||
Binary: a.Binary, Timeout: timeout, Credentials: a.Credentials,
|
||||
Modules: append(a.Modules[:0:0], a.Modules...),
|
||||
Overlay: a.Overlay, ProposalProfile: a.ProposalProfile,
|
||||
ValidationProfile: a.ValidationProfile,
|
||||
TranscriptDescription: a.TranscriptDescription, ConfigPath: a.ConfigPath,
|
||||
OutputSchema: a.OutputSchema,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("from pipeline.audita: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user