{"record":{"id":"f2ea6bc25c53ca61","repo":"infiniflow/ragflow","slug":"unsupported-language-v","errorCode":null,"errorMessage":"Unsupported language: {v}","messagePattern":"Unsupported language: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/tools/code_exec.py","lineNumber":233,"sourceCode":"    @field_validator(\"code_b64\")\n    @classmethod\n    def validate_base64(cls, v: str) -> str:\n        try:\n            base64.b64decode(v, validate=True)\n            return v\n        except Exception as e:\n            raise ValueError(f\"Invalid base64 encoding: {str(e)}\")\n\n    @field_validator(\"language\", mode=\"before\")\n    @classmethod\n    def normalize_language(cls, v) -> str:\n        if isinstance(v, str):\n            low = v.lower()\n            if low in (\"python\", \"python3\"):\n                return \"python\"\n            elif low in (\"javascript\", \"nodejs\"):\n                return \"nodejs\"\n        raise ValueError(f\"Unsupported language: {v}\")\n\n\nclass CodeExecParam(ToolParamBase):\n    \"\"\"\n    Define the code sandbox component parameters.\n    \"\"\"\n\n    def __init__(self):\n        self.meta: ToolMeta = {\n            \"name\": \"execute_code\",\n            \"description\": \"\"\"\nThis tool has a sandbox that can execute code written in 'Python'/'Javascript'. It receives a piece of code and return a Json string.\n\nHere's a code example for Python(`main` function MUST be included):\ndef main() -> dict:\n    \\\"\\\"\\\"\n    Generate Fibonacci numbers within 100.\n    \\\"\\\"\\\"","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/tools/code_exec.py#L215-L251","documentation":"Error \"Unsupported language: {v}\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at agent/tools/code_exec.py:233 when the library encounters an invalid state.","commonSituations":"The CodeExec tool is invoked with an unsupported or misspelled language identifier; restricting input to the supported language set prevents this error.","solutions":["Use a language supported by the CodeExec sandbox (e.g. python).","Check the allowed language list in the tool configuration."],"exampleFix":"params = {'language': 'python', 'code': code}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}