{"record":{"id":"58e33ffbf56723a8","repo":"BerriAI/litellm","slug":"tuple-must-have-at-least-2-elements-filename-co","errorCode":null,"errorMessage":"Tuple must have at least 2 elements: (filename, content)","messagePattern":"Tuple must have at least 2 elements: \\(filename, content\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/audio_utils/utils.py","lineNumber":98,"sourceCode":"            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:\n        try:\n            # Extract extension from filename","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/audio_utils/utils.py#L80-L116","documentation":"Error \"Tuple must have at least 2 elements: (filename, content)\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/audio_utils/utils.py:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a tuple of at least (filename, content)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}