{"record":{"id":"231c92b085834501","repo":"BerriAI/litellm","slug":"translationmoduleconfig-requires-at-least-one-of","errorCode":null,"errorMessage":"TranslationModuleConfig requires at least one of 'input' or 'output'.","messagePattern":"TranslationModuleConfig requires at least one of 'input' or 'output'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"litellm/llms/sap/chat/models.py","lineNumber":689,"sourceCode":"\n\nclass TranslationModuleConfig(BaseModel):\n    \"\"\"\n    Configuration for translation module\n\n    Args:\n        input: Configuration for input translation\n\n        output: Configuration for output translation\n    \"\"\"\n\n    input: SAPDocumentTranslationInput | None = None\n    output: SAPDocumentTranslationOutput | None = None\n\n    @model_validator(mode=\"after\")\n    def enforce_min_properties(self) -> \"TranslationModuleConfig\":\n        if self.input is None and self.output is None:\n            raise ValueError(\"TranslationModuleConfig requires at least one of 'input' or 'output'.\")\n        return self\n\n\nclass ModuleConfig(BaseModel):\n    prompt_templating: PromptTemplatingModuleConfig\n    filtering: FilteringModuleConfig | None = None\n    masking: MaskingModuleConfig | None = None\n    grounding: GroundingModuleConfig | None = None\n    translation: TranslationModuleConfig | None = None\n\n\nclass GlobalStreamOptions(BaseModel):\n    enabled: bool = False\n    chunk_size: int | None = Field(default=None, ge=1)\n    delimiters: list[str] | None = None\n\n\nclass OrchestrationConfig(BaseModel):","sourceCodeStart":671,"sourceCodeEnd":707,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sap/chat/models.py#L671-L707","documentation":"TranslationModuleConfig (SAP document translation module) must configure at least one of 'input' or 'output' translation. Its model_validator raises this ValueError when both are None, rejecting empty translation modules at validation time.","triggerScenarios":"Passing {'translation': {}} or TranslationModuleConfig() in the module config - the translation module is declared but neither input nor output translation settings are given.","commonSituations":"Config builders that always emit all module keys; feature-flag code that enables the translation module but leaves the sub-config empty when the flag is off; refactors that moved translation settings and left the empty parent behind.","solutions":["Provide SAPDocumentTranslationInput and/or SAPDocumentTranslationOutput under the translation module.","If translation is not needed, delete the 'translation' key from the modules dict.","Sanitize config dicts to drop empty module objects before building the request."],"exampleFix":"# before\nmodules={'translation': {}}\n# after - either drop it or configure one side\nmodules={'translation': {'output': {'translate': [my_selector]}}}","handlingStrategy":"validation","validationCode":"def build_translation(input_cfg=None, output_cfg=None) -> dict | None:\n    if input_cfg is None and output_cfg is None:\n        return None\n    return {'translation': {'input': input_cfg, 'output': output_cfg}}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Construct SAP module configs from typed helper functions, not raw dicts.","Validate the full ModuleConfig with Pydantic in tests to catch empty modules early."],"tags":["sap","translation","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"}