mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat:OpaqueErrors
to hide error information (#2486)
* adds a new configuration option to hide all error message information from http requests --------- Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
17cf6c4a4d
commit
d072835796
10 changed files with 78 additions and 41 deletions
|
@ -31,6 +31,7 @@ type ApplicationConfig struct {
|
|||
PreloadModelsFromPath string
|
||||
CORSAllowOrigins string
|
||||
ApiKeys []string
|
||||
OpaqueErrors bool
|
||||
|
||||
ModelLibraryURL string
|
||||
|
||||
|
@ -287,6 +288,12 @@ func WithApiKeys(apiKeys []string) AppOption {
|
|||
}
|
||||
}
|
||||
|
||||
func WithOpaqueErrors(opaque bool) AppOption {
|
||||
return func(o *ApplicationConfig) {
|
||||
o.OpaqueErrors = opaque
|
||||
}
|
||||
}
|
||||
|
||||
// ToConfigLoaderOptions returns a slice of ConfigLoader Option.
|
||||
// Some options defined at the application level are going to be passed as defaults for
|
||||
// all the configuration for the models.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue