{"record":{"id":"ee31d18e69fd2ee6","repo":"infiniflow/ragflow","slug":"is-not-supported-it-should-be-in","errorCode":null,"errorMessage":" {} is not supported, it should be in {}","messagePattern":" (.+?) is not supported, it should be in (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/component/base.py","lineNumber":301,"sourceCode":"    @staticmethod\n    def check_decimal_float(param, description):\n        if type(param).__name__ not in [\"float\", \"int\"] or param < 0 or param > 1:\n            raise ValueError(description + \" {} not supported, should be a float number in range [0, 1]\".format(param))\n\n    @staticmethod\n    def check_boolean(param, description):\n        if type(param).__name__ != \"bool\":\n            raise ValueError(description + \" {} not supported, should be bool type\".format(param))\n\n    @staticmethod\n    def check_open_unit_interval(param, description):\n        if type(param).__name__ not in [\"float\"] or param <= 0 or param >= 1:\n            raise ValueError(description + \" should be a numeric number between 0 and 1 exclusively\")\n\n    @staticmethod\n    def check_valid_value(param, description, valid_values):\n        if param not in valid_values:\n            raise ValueError(description + \" {} is not supported, it should be in {}\".format(param, valid_values))\n\n    @staticmethod\n    def check_defined_type(param, description, types):\n        if type(param).__name__ not in types:\n            raise ValueError(description + \" {} not supported, should be one of {}\".format(param, types))\n\n    @staticmethod\n    def check_and_change_lower(param, valid_list, description=\"\"):\n        if type(param).__name__ != \"str\":\n            raise ValueError(description + \" {} not supported, should be one of {}\".format(param, valid_list))\n\n        lower_param = param.lower()\n        if lower_param in valid_list:\n            return lower_param\n        else:\n            raise ValueError(description + \" {} not supported, should be one of {}\".format(param, valid_list))\n\n    @staticmethod","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/component/base.py#L283-L319","documentation":"Raised by ComponentParamBase.check_valid_value in agent/component/base.py when a parameter's value is not a member of the caller-supplied valid_values list. This is an enum-style whitelist check used for parameters like output formats, engines, or modes. The message shows the offending value and the allowed list, making it self-diagnosing.","triggerScenarios":"Calling a component whose check() does e.g. check_valid_value(self.output_format, '...', ['pdf','docx','txt','markdown','html']) with a value not in that exact list — wrong casing ('PDF'), a typo ('mkardown'), an empty string, or a value valid in a newer/older version but not the current one.","commonSituations":"Version drift: a valid option removed or renamed between RAGFlow releases; case-sensitive values entered by hand; frontend dropdown out of sync with backend whitelist; localized values ('pdf' vs 'PDF').","solutions":["Read the message: it prints the allowed list — set the parameter to exactly one of those values, matching case","If you believe the value should be valid, check the component source for the current valid_values list at your RAGFlow version and align","Normalize input with str(value).strip().lower() if the whitelist is lowercase before assigning the param"],"exampleFix":"# before\nself.check_valid_value(self.output_format, \"fmt\", [\"pdf\", \"docx\"])\noutput_format = \"PDF\"\n\n# after\noutput_format = \"pdf\"","handlingStrategy":"validation","validationCode":"ALLOWED_FORMATS = ['pdf', 'docx', 'txt', 'markdown', 'html']\n\nfmt = config.get('output_format')\nif fmt not in ALLOWED_FORMATS:\n    raise ValueError(f\"output_format must be one of {ALLOWED_FORMATS}, got {fmt!r}\")","typeGuard":"def is_valid_choice(v, choices) -> bool:\n    return v in choices","tryCatchPattern":"try:\n    component._param.check()\nexcept ValueError as e:\n    # message contains the allowed list; surface it to the config UI\n    report_config_error(str(e))","preventionTips":["Source dropdown options from the same whitelist the backend validates against","Normalize casing/whitespace before submitting enum fields","After upgrading RAGFlow, re-validate saved canvases against current valid_values"],"tags":["validation","agent-component","enum","python"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}