BerriAI/litellm · error · ValueError

Unsupported content type in tuple: {type(content)}

Error message

Unsupported content type in tuple: {type(content)}

What it means

Error "Unsupported content type in tuple: {type(content)}" thrown in BerriAI/litellm.

Source

Thrown at litellm/litellm_core_utils/audio_utils/utils.py:96

            if isinstance(content, (bytes, bytearray)):
                file_content = bytes(content)
            elif isinstance(content, str):
                raise ValueError(
                    "process_audio_file does not accept bare str tuple "
                    "contents. Pass bytes, an open file handle, or a "
                    "pathlib.Path."
                )
            elif isinstance(content, os.PathLike):
                # PathLike: SDK convenience for local-file uploads.
                with open(str(content), "rb") as f:
                    file_content = f.read()
            elif hasattr(content, "read"):
                # File-like object
                file_content = content.read()
                if hasattr(content, "seek"):
                    content.seek(0)
            else:
                raise ValueError(f"Unsupported content type in tuple: {type(content)}")
        else:
            raise ValueError("Tuple must have at least 2 elements: (filename, content)")
    elif hasattr(audio_file, "read") and not isinstance(audio_file, (str, bytes, bytearray, tuple, os.PathLike)):
        # File-like object (IO) - check this after all other types
        filename = getattr(audio_file, "name", "audio.wav")
        file_content = audio_file.read()
        # Reset file pointer if possible
        if hasattr(audio_file, "seek"):
            audio_file.seek(0)
    else:
        raise ValueError(f"Unsupported audio_file type: {type(audio_file)}")

    if file_content is None:
        raise ValueError("Could not extract file content from audio_file")

    # Determine content type using LiteLLM's file type utilities
    content_type = "audio/wav"  # Default fallback
    if filename:

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Use a supported content type (bytes, file handle, Path) in the tuple.

When it happens

Trigger: Thrown at litellm/litellm_core_utils/audio_utils/utils.py:96 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/e266c87dd496ad8e. Report an issue: GitHub.