{"record":{"id":"e266c87dd496ad8e","repo":"BerriAI/litellm","slug":"unsupported-content-type-in-tuple-type-content","errorCode":null,"errorMessage":"Unsupported content type in tuple: {type(content)}","messagePattern":"Unsupported content type in tuple: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/audio_utils/utils.py","lineNumber":96,"sourceCode":"            if isinstance(content, (bytes, bytearray)):\n                file_content = bytes(content)\n            elif isinstance(content, str):\n                raise ValueError(\n                    \"process_audio_file does not accept bare str tuple \"\n                    \"contents. Pass bytes, an open file handle, or a \"\n                    \"pathlib.Path.\"\n                )\n            elif isinstance(content, os.PathLike):\n                # PathLike: SDK convenience for local-file uploads.\n                with open(str(content), \"rb\") as f:\n                    file_content = f.read()\n            elif hasattr(content, \"read\"):\n                # File-like object\n                file_content = content.read()\n                if hasattr(content, \"seek\"):\n                    content.seek(0)\n            else:\n                raise ValueError(f\"Unsupported content type in tuple: {type(content)}\")\n        else:\n            raise ValueError(\"Tuple must have at least 2 elements: (filename, content)\")\n    elif hasattr(audio_file, \"read\") and not isinstance(audio_file, (str, bytes, bytearray, tuple, os.PathLike)):\n        # File-like object (IO) - check this after all other types\n        filename = getattr(audio_file, \"name\", \"audio.wav\")\n        file_content = audio_file.read()\n        # Reset file pointer if possible\n        if hasattr(audio_file, \"seek\"):\n            audio_file.seek(0)\n    else:\n        raise ValueError(f\"Unsupported audio_file type: {type(audio_file)}\")\n\n    if file_content is None:\n        raise ValueError(\"Could not extract file content from audio_file\")\n\n    # Determine content type using LiteLLM's file type utilities\n    content_type = \"audio/wav\"  # Default fallback\n    if filename:","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/audio_utils/utils.py#L78-L114","documentation":"The content element of an audio tuple matched none of the accepted types (bytes, str-rejected, PathLike, file-like); the actual type is echoed so the caller can see which unsupported object was passed.","triggerScenarios":"Thrown at litellm/litellm_core_utils/audio_utils/utils.py:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass tuple content as bytes, a file-like object, or pathlib.Path; the received type is not supported.","Convert the content with .encode() or read it as bytes before passing."],"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"}