sgl-project/sglang · error · ValueError

composite_input event payload requires non-empty input_types

Error message

composite_input event payload requires non-empty input_types

What it means

composite_input payloads must include a non-empty list 'input_types' telling the adapter which input modalities the event carries. Missing, non-list, or empty input_types triggers this.

Source

Thrown at python/sglang/multimodal_gen/runtime/entrypoints/openai/realtime/adapters/lingbot_world_realtime_adapter.py:197

        return f"kind=prompt, prompt_len={len(prompt)}"

    @staticmethod
    def _validate_prompt_payload(payload: Any) -> str:
        if not isinstance(payload, str) or not payload:
            raise ValueError("prompt event payload must be a non-empty string")
        return payload

    def _ingest_composite_input(
        self,
        state: LingBotWorldRealtimeState,
        payload: Any,
        event_id: int | None,
    ) -> str:
        if not isinstance(payload, dict):
            raise ValueError("composite_input event payload must be a map")
        input_types = payload.get("input_types")
        if not isinstance(input_types, list) or not input_types:
            raise ValueError(
                "composite_input event payload requires non-empty input_types"
            )

        parsed_inputs = []
        for input_type in input_types:
            if not isinstance(input_type, str) or not input_type:
                raise ValueError(
                    "composite_input input_types must contain non-empty strings"
                )
            if input_type not in payload:
                raise ValueError(f"composite_input event payload requires {input_type}")
            parsed_inputs.append(
                (
                    input_type,
                    self._parse_composite_input_item(
                        state,
                        input_type,
                        payload[input_type],

View on GitHub (pinned to 0132848349)

Solutions

  1. Always include input_types: ["prompt"] (or with camera types) in every composite_input payload
  2. Make input_types mirror exactly the keys you actually send
  3. Validate the payload structure client-side before send

Example fix

// before
{input_types: [], prompt: "hi"}
// after
{input_types: ["prompt"], prompt: "hi"}
Defensive patterns

Strategy: validation

Validate before calling

types_ = payload.setdefault('input_types', ['prompt'])
assert isinstance(types_, list) and types_

Type guard

def has_input_types(x: dict) -> bool: return isinstance(x.get('input_types'), list) and len(x['input_types']) > 0

Prevention

When it happens

Trigger: {kind: "composite_input", payload: {prompt: "hi"}} — payload is a map but omits input_types, or sets it to [] or a string.

Common situations: Client assuming the adapter infers types from present keys; refactoring that drops the input_types field.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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