infiniflow/ragflow · error · ValueError

Unsupported language: {v}

Error message

Unsupported language: {v}

What it means

Error "Unsupported language: {v}" thrown in infiniflow/ragflow.

Source

Thrown at agent/tools/code_exec.py:233

    @field_validator("code_b64")
    @classmethod
    def validate_base64(cls, v: str) -> str:
        try:
            base64.b64decode(v, validate=True)
            return v
        except Exception as e:
            raise ValueError(f"Invalid base64 encoding: {str(e)}")

    @field_validator("language", mode="before")
    @classmethod
    def normalize_language(cls, v) -> str:
        if isinstance(v, str):
            low = v.lower()
            if low in ("python", "python3"):
                return "python"
            elif low in ("javascript", "nodejs"):
                return "nodejs"
        raise ValueError(f"Unsupported language: {v}")


class CodeExecParam(ToolParamBase):
    """
    Define the code sandbox component parameters.
    """

    def __init__(self):
        self.meta: ToolMeta = {
            "name": "execute_code",
            "description": """
This tool has a sandbox that can execute code written in 'Python'/'Javascript'. It receives a piece of code and return a Json string.

Here's a code example for Python(`main` function MUST be included):
def main() -> dict:
    \"\"\"
    Generate Fibonacci numbers within 100.
    \"\"\"

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Use a language supported by the CodeExec sandbox (e.g. python).
  2. Check the allowed language list in the tool configuration.

Example fix

params = {'language': 'python', 'code': code}

When it happens

Trigger: Thrown at agent/tools/code_exec.py:233 when the library encounters an invalid state.

Common situations: The CodeExec tool is invoked with an unsupported or misspelled language identifier; restricting input to the supported language set prevents this error.


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/f2ea6bc25c53ca61. Report an issue: GitHub.