MCPcopy Index your code
hub / github.com/mudler/LocalAI / PIIPolicyResolver

Method PIIPolicyResolver

core/application/application.go:367–375  ·  view source on GitHub ↗

PIIPolicyResolver adapts ResolvePIIPolicy to pii.PolicyResolver for pii.WithPolicyResolver. The middleware carries the resolved model config as `any` (the MODEL_CONFIG context value, a *config.ModelConfig); this asserts it back and applies the instance-wide defaults.

()

Source from the content-addressed store, hash-verified

365// `any` (the MODEL_CONFIG context value, a *config.ModelConfig); this asserts
366// it back and applies the instance-wide defaults.
367func (a *Application) PIIPolicyResolver() pii.PolicyResolver {
368 return func(modelCfg any) (bool, []string) {
369 cfg, ok := modelCfg.(*config.ModelConfig)
370 if !ok {
371 return false, nil
372 }
373 return a.ResolvePIIPolicy(cfg)
374 }
375}
376
377// MITMCA returns the cloudproxy MITM proxy's CA, or nil when the
378// MITM listener is disabled.

Callers 5

RegisterOllamaRoutesFunction · 0.80
RegisterAnthropicRoutesFunction · 0.80
RegisterOpenAIRoutesFunction · 0.80
PIIAnalyzeEndpointFunction · 0.80
PIIRedactEndpointFunction · 0.80

Calls 1

ResolvePIIPolicyMethod · 0.95

Tested by

no test coverage detected