Audita API key credentials are now optional
This commit is contained in:
@@ -83,9 +83,6 @@ func NewSubprocessRunner(cfg SubprocessRunnerConfig) (*SubprocessRunner, error)
|
||||
if cfg.Timeout <= 0 {
|
||||
return nil, fmt.Errorf("audita timeout must be > 0")
|
||||
}
|
||||
if strings.TrimSpace(cfg.LLMAPIKeyEnv) == "" {
|
||||
return nil, fmt.Errorf("audita llm api key env var name is required")
|
||||
}
|
||||
if len(cfg.Modules) == 0 {
|
||||
return nil, fmt.Errorf("audita modules must include at least one module")
|
||||
}
|
||||
@@ -160,13 +157,14 @@ func (r *SubprocessRunner) Run(ctx context.Context, req PolishRequest) (PolishRe
|
||||
}
|
||||
args := r.buildArgs(req, reqModules)
|
||||
|
||||
credential, credentialPresent := os.LookupEnv(r.llmAPIKeyEnv)
|
||||
if !credentialPresent || strings.TrimSpace(credential) == "" {
|
||||
return PolishResult{}, fmt.Errorf("audita credential env var %q is required but not set", r.llmAPIKeyEnv)
|
||||
}
|
||||
|
||||
env := map[string]string{
|
||||
"AUDITA_LLM_API_KEY": credential,
|
||||
credentialPresent := false
|
||||
env := map[string]string{}
|
||||
if strings.TrimSpace(r.llmAPIKeyEnv) != "" {
|
||||
credential, ok := os.LookupEnv(r.llmAPIKeyEnv)
|
||||
if ok && strings.TrimSpace(credential) != "" {
|
||||
env["AUDITA_LLM_API_KEY"] = credential
|
||||
credentialPresent = true
|
||||
}
|
||||
}
|
||||
primaryConcurrencyViaEnv := false
|
||||
if r.llmConcurrency != nil {
|
||||
|
||||
Reference in New Issue
Block a user