Configure PromptKit transient retries
This commit is contained in:
@@ -167,6 +167,11 @@ func validateDocumentPromptKit(promptKit *PromptKitDocument, validation *configk
|
||||
if err := validatePromptKitProfileSources(profileDir, profileFile); err != nil {
|
||||
validation.Error(configkit.Keys("promptkit"), err.Error())
|
||||
}
|
||||
if promptKit.TransientRetries == nil {
|
||||
validation.Error(configkit.Keys("promptkit", "transient_retries"), "must be an integer")
|
||||
} else if err := validatePromptKitTransientRetries(*promptKit.TransientRetries); err != nil {
|
||||
validation.Error(configkit.Keys("promptkit", "transient_retries"), err.Error())
|
||||
}
|
||||
if promptKit.LocalBackend == nil {
|
||||
return
|
||||
}
|
||||
@@ -283,6 +288,13 @@ func validatePromptKitLocalBackendConcurrencyLimit(concurrencyLimit int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validatePromptKitTransientRetries(transientRetries int) error {
|
||||
if transientRetries < 0 {
|
||||
return fmt.Errorf("promptkit.transient_retries must not be negative")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateRequiredPath(name, value string) error {
|
||||
if strings.TrimSpace(value) == "" {
|
||||
return fmt.Errorf("%s must not be empty", name)
|
||||
|
||||
Reference in New Issue
Block a user