sgl-project/sglang · error · ValueError

content must be a ImageInput, but got {type(self.content)}

Error message

content must be a ImageInput, but got {type(self.content)}

What it means

Error "content must be a ImageInput, but got {type(self.content)}" thrown in sgl-project/sglang.

Source

Thrown at python/sglang/srt/multimodal/processors/mimo_v2.py:199

    content: TextInput | ImageInput | VideoInput | AudioInput | VideoAudioInput
    is_target: Optional[bool] = None

    def __post_init__(self):
        if self.type not in ["text", "image", "video", "audio", "video_audio"]:
            raise ValueError(
                f"type must be one of text, image, video, audio, video_audio, but got {self.type}"
            )
        if self.type == "text":
            if not isinstance(self.content, (str, list)) or (
                isinstance(self.content, list)
                and not all(isinstance(item, int) for item in self.content)
            ):
                raise ValueError(
                    f"content must be a str or a list of ints, but got {type(self.content)}"
                )
        elif self.type == "image":
            if not isinstance(self.content, ImageInput):
                raise ValueError(
                    f"content must be a ImageInput, but got {type(self.content)}"
                )
        elif self.type == "video":
            if not isinstance(self.content, VideoInput):
                raise ValueError(
                    f"content must be a VideoInput, but got {type(self.content)}"
                )
        elif self.type == "audio":
            if not isinstance(self.content, AudioInput):
                raise ValueError(
                    f"content must be a AudioInput, but got {type(self.content)}"
                )
        elif self.type == "video_audio":
            if not isinstance(self.content, VideoAudioInput):
                raise ValueError(
                    f"content must be a VideoAudioInput, but got {type(self.content)}"
                )

View on GitHub (pinned to 0132848349)

When it happens

Trigger: Thrown at python/sglang/srt/multimodal/processors/mimo_v2.py:199 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/1ba1d1788546dc3e. Report an issue: GitHub.