{"record":{"id":"70097ea4aec9f13a","repo":"BerriAI/litellm","slug":"unsupported-call-type-call-type-r-for-compressio","errorCode":null,"errorMessage":"Unsupported call_type={call_type!r} for compression. Expected one of: {sorted(_SUPPORTED_CALL_TYPES)}.","messagePattern":"Unsupported call_type=(.+?) for compression\\. Expected one of: (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/compression/compress.py","lineNumber":110,"sourceCode":"            if item_type == \"text\":\n                parts.append(str(item.get(\"text\", \"\")))\n            elif item_type == \"tool_result\":\n                stack.append(item.get(\"content\", \"\"))\n    return \" \".join(parts)\n\n\ndef _normalize_messages_for_compression(\n    messages: list[dict],\n    call_type: str,\n) -> tuple[list[dict], list[dict]]:\n    \"\"\"\n    Normalize each original message to a text-surrogate content for scoring.\n\n    Returns:\n        (normalized_messages, original_messages_copy)\n    \"\"\"\n    if call_type not in _SUPPORTED_CALL_TYPES:\n        raise ValueError(\n            f\"Unsupported call_type={call_type!r} for compression. Expected one of: {sorted(_SUPPORTED_CALL_TYPES)}.\"\n        )\n\n    original_messages: Final[list[dict[str, Any]]] = [dict(m) for m in messages]\n\n    normalized_messages: Final[list[dict]] = []\n    for msg in original_messages:\n        normalized_messages.append(\n            {\n                **msg,\n                \"content\": _content_to_text(msg.get(\"content\", \"\")),\n            }\n        )\n    return normalized_messages, original_messages\n\n\ndef _extract_last_user_message(messages: list[dict]) -> str:\n    \"\"\"Return the text content of the last user message.\"\"\"","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/compression/compress.py#L92-L128","documentation":"The prompt-compression normalizer only knows how to flatten messages for specific call types (e.g. completion-style chats); the call_type passed in is outside _SUPPORTED_CALL_TYPES, so messages cannot be scored for compression and the request is rejected.","triggerScenarios":"Thrown at litellm/compression/compress.py:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call compression only with a supported call_type from the list shown in the error.","Check that you are routing a supported operation (e.g. completion) through the compression layer."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}