{"record":{"id":"c6cda50b180744fa","repo":"BerriAI/litellm","slug":"for-using-sap-filtering-module-you-must-provide-at","errorCode":null,"errorMessage":"For using SAP Filtering Module you must provide at least one property: input or output filters.","messagePattern":"For using SAP Filtering Module you must provide at least one property: input or output filters\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"litellm/llms/sap/chat/models.py","lineNumber":600,"sourceCode":"class FilteringModuleConfig(BaseModel):\n    \"\"\"Module for managing and applying content filters.\n\n    Args:\n        input: Module for filtering and validating input content before processing.\n\n        output: Module for filtering and validating output content after generation.\n    \"\"\"\n\n    input: InputFiltering | None = None\n    output: OutputFiltering | None = None\n\n    @model_validator(mode=\"after\")\n    def enforce_min_properties(self) -> \"FilteringModuleConfig\":\n        \"\"\"\n        Ensure at least one of input or output filtering is provided.\n        \"\"\"\n        if self.input is None and self.output is None:\n            raise ValueError(\n                \"For using SAP Filtering Module you must provide at least one property: input or output filters.\"\n            )\n        return self\n\n\nclass SAPDocumentTranslationApplyToSelector(BaseModel):\n    \"\"\"\n    This selector allows you to define the scope of translation, such as specific placeholders or\n    messages with specific roles.\n    For example, {\"category\": \"placeholders\",\n                \"items\": [\"user_input\"],\n                \"source_language\": \"de-DE\"}\n                targets the value of \"user_input\" in placeholder_values specified in the request payload;\n                and considers the value to be in German.\n    \"\"\"\n\n    category: Literal[\"placeholders\", \"template_roles\"]\n    items: list[str]","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sap/chat/models.py#L582-L618","documentation":"FilteringModuleConfig models SAP's input and output content filtering; at least one of 'input' or 'output' must be configured. A model_validator raises this ValueError when both are None, i.e. an empty filtering module was passed.","triggerScenarios":"Sending {'filtering': {}} (or FilteringModuleConfig()) in the module config of a sap/ request - the filtering key exists but neither input nor output filter settings were provided.","commonSituations":"Scaffolded request templates that include every module key by default; toggling filters off by emptying the dict instead of removing the key; YAML/JSON configs where the filter sub-keys are commented out but the parent remains.","solutions":["Configure at least one side, e.g. {'filtering': {'input': {'filters': [my_filter]}}} or an output filter.","If no filtering is wanted, remove the 'filtering' key from the module config entirely.","Add a pre-flight check that strips empty module dicts before sending to SAP."],"exampleFix":"# before\nmodules={'filtering': {}}\n# after - either drop it or configure one side\nmodules={'filtering': {'input': {'filters': [my_input_filter]}}}","handlingStrategy":"validation","validationCode":"def build_filtering(input_filters=None, output_filters=None) -> dict | None:\n    cfg = {}\n    if input_filters:\n        cfg['input'] = {'filters': input_filters}\n    if output_filters:\n        cfg['output'] = {'filters': output_filters}\n    return {'filtering': cfg} if cfg else None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never emit empty module objects; omit unused modules entirely.","Add a lint rule that rejects empty dicts under module keys in request templates."],"tags":["sap","filtering","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"}