{"record":{"id":"b0fb9447ed7c07eb","repo":"sgl-project/sglang","slug":"composite-input-input-types-must-contain-non-empty","errorCode":null,"errorMessage":"composite_input input_types must contain non-empty strings","messagePattern":"composite_input input_types must contain non-empty strings","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/openai/realtime/adapters/lingbot_world_realtime_adapter.py","lineNumber":204,"sourceCode":"\n    def _ingest_composite_input(\n        self,\n        state: LingBotWorldRealtimeState,\n        payload: Any,\n        event_id: int | None,\n    ) -> str:\n        if not isinstance(payload, dict):\n            raise ValueError(\"composite_input event payload must be a map\")\n        input_types = payload.get(\"input_types\")\n        if not isinstance(input_types, list) or not input_types:\n            raise ValueError(\n                \"composite_input event payload requires non-empty input_types\"\n            )\n\n        parsed_inputs = []\n        for input_type in input_types:\n            if not isinstance(input_type, str) or not input_type:\n                raise ValueError(\n                    \"composite_input input_types must contain non-empty strings\"\n                )\n            if input_type not in payload:\n                raise ValueError(f\"composite_input event payload requires {input_type}\")\n            parsed_inputs.append(\n                (\n                    input_type,\n                    self._parse_composite_input_item(\n                        state,\n                        input_type,\n                        payload[input_type],\n                        event_id,\n                    ),\n                )\n            )\n\n        input_logs = []\n        for input_type, parsed_payload in parsed_inputs:","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/openai/realtime/adapters/lingbot_world_realtime_adapter.py#L186-L222","documentation":"Each element of composite_input's input_types must be a non-empty string naming a supported input modality. Non-string, empty, or None elements are rejected.","triggerScenarios":"input_types: [null], input_types: [\"\"], or input_types: [1] in a composite_input payload.","commonSituations":"Programmatically building input_types from optional values that end up None/empty; trimming whitespace into empty strings.","solutions":["Filter falsy entries out of input_types before sending: [t for t in types if isinstance(t, str) and t]","Only use known type names ('prompt', camera types)","Assert the list is non-empty after filtering"],"exampleFix":"// before\ninput_types = [maybe_prompt]  # maybe_prompt may be None\n// after\ninput_types = [t for t in [maybe_prompt] if isinstance(t, str) and t]","handlingStrategy":"type-guard","validationCode":"payload['input_types'] = [t for t in payload['input_types'] if isinstance(t, str) and t]","typeGuard":"def valid_input_types(ts: object) -> bool: return isinstance(ts, list) and all(isinstance(t, str) and t for t in ts) and bool(ts)","tryCatchPattern":null,"preventionTips":["Filter falsy entries from input_types","Only use known type names"],"tags":["realtime","event-validation","composite-input","type-mismatch"],"backgroundTag":"event-payload-type-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}