{"record":{"id":"9a9d41fedd943613","repo":"BerriAI/litellm","slug":"for-sap-masking-module-config-you-must-provide-pr","errorCode":null,"errorMessage":"For SAP Masking Module Config you must provide 'providers'.","messagePattern":"For SAP Masking Module Config you must provide 'providers'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"litellm/llms/sap/chat/models.py","lineNumber":379,"sourceCode":"    Configuration for the data masking module.\n\n    Args:\n        providers: list of masking service provider configurations\n        masking_providers: list of masking provider configurations\n    IMPORTANT: use exactly one of the parameters to set the list of masking provider configurations.\n    DEPRECATED: parameter 'masking_providers' will be removed Sept 15, 2026. Use 'providers' instead.\n    \"\"\"\n\n    providers: list[MaskingProviderConfig] | None = Field(min_length=1, default=None)\n    masking_providers: list[MaskingProviderConfig] | None = Field(min_length=1, default=None)\n\n    @model_validator(mode=\"after\")\n    def enforce_exactly_one_provider_list(self):\n        has_providers: Final = self.providers is not None\n        has_masking_providers: Final = self.masking_providers is not None\n\n        if not has_providers and not has_masking_providers:\n            raise ValueError(\"For SAP Masking Module Config you must provide 'providers'.\")\n        if has_providers and has_masking_providers:\n            raise ValueError(\n                \"For SAP Masking Module Config you must set exactly one of: 'providers' or 'masking_providers', not both.\"\n            )\n\n        if has_masking_providers:\n            warnings.warn(\n                \"The 'masking_providers' parameter is deprecated and will be removed on Sept 15, 2026. \"\n                \"Use 'providers' instead.\",\n                DeprecationWarning,\n                stacklevel=5,\n            )\n\n        return self\n\n\nclass AzureThreshold(int, Enum):\n    \"\"\"","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sap/chat/models.py#L361-L397","documentation":"MaskingModuleConfig for SAP requires exactly one provider list: the current 'providers' field or the deprecated 'masking_providers' field. A model_validator raises this ValueError when neither is present, so an empty masking module config (MaskingModuleConfig() or {'masking': {}}) fails fast at request-build time.","triggerScenarios":"Sending module config with an empty masking object - e.g. {'masking': {}} - because a template always includes the masking key, or constructing MaskingModuleConfig() to 'enable later'.","commonSituations":"Config templates that instantiate every module with defaults; merging user config over a base dict that has masking: {} as a placeholder; upgrading code from the old masking_providers field while the new providers list is conditionally empty.","solutions":["Provide at least one masking provider: {'providers': [{'type': 'masking', 'providers_config': [...]}]}.","If masking is not needed, remove the masking key from the module config entirely.","If you were using the old field, switch to 'providers' (masking_providers is deprecated, removal Sept 15, 2026)."],"exampleFix":"# before\nmodules={'masking': {}}\n# after - either drop it or configure providers\nmodules={'masking': {'providers': [my_masking_provider]}}","handlingStrategy":"validation","validationCode":"def build_masking(providers=None) -> dict | None:\n    if not providers:\n        return None  # omit the module instead of sending an empty one\n    return {'masking': {'providers': providers}}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build module dicts conditionally: only include keys that carry real configuration.","Unit-test that generated configs pass Pydantic validation before they ship."],"tags":["sap","masking","validation","required-field"],"backgroundTag":"missing-required-parameter","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}