deepset-ai/haystack · error

Unknown link format '{link_format}'. Supported formats are:

Error message

Unknown link format '{link_format}'. Supported formats are: 'markdown', 'plain', 'none'

What it means

PPTXToDocument formats hyperlinks according to the link_format option, which must be one of 'markdown', 'plain', or 'none'. Any other value fails fast in __init__ with ValueError listing the supported formats.

Source

Thrown at haystack/components/converters/pptx.py:62

    def __init__(
        self, store_full_path: bool = False, link_format: Literal["markdown", "plain", "none"] = "none"
    ) -> None:
        """
        Create a PPTXToDocument component.

        :param store_full_path:
            If True, the full path of the file is stored in the metadata of the document.
            If False, only the file name is stored.
        :param link_format: The format for link output. Possible options:
            - `"markdown"`: `[text](url)`
            - `"plain"`: `text (url)`
            - `"none"`: Only the text is extracted, link addresses are ignored.
        """
        pptx_import.check()
        if link_format not in ("markdown", "plain", "none"):
            msg = f"Unknown link format '{link_format}'. Supported formats are: 'markdown', 'plain', 'none'"
            raise ValueError(msg)
        self.link_format = link_format
        self.store_full_path = store_full_path

    def to_dict(self) -> dict[str, Any]:
        """
        Serializes the component to a dictionary.

        :returns:
            Dictionary with serialized data.
        """
        return default_to_dict(self, link_format=self.link_format, store_full_path=self.store_full_path)

    def _convert(self, file_content: io.BytesIO) -> str:
        """
        Converts the PPTX file to text.
        """
        pptx_presentation = Presentation(file_content)
        text_all_slides = []

View on GitHub (pinned to e318778c9b)

Solutions

  1. Use one of the exact strings: 'markdown', 'plain', or 'none'
  2. Check for typos/case: values are lowercase
  3. If loading from YAML, fix the link_format value in the file

Example fix

// before
converter = PPTXToDocument(link_format="md")
// after
converter = PPTXToDocument(link_format="markdown")
Defensive patterns

Strategy: validation

Validate before calling

VALID_LINK_FORMATS = {"markdown", "plain", "none"}
def make_pptx_converter(link_format="plain", **kw):
    if link_format not in VALID_LINK_FORMATS:
        raise ValueError(f"link_format must be one of {sorted(VALID_LINK_FORMATS)}")
    return PPTXToDocument(link_format=link_format, **kw)

Try / catch

try:
    converter = PPTXToDocument(link_format=lf)
except ValueError as e:
    converter = PPTXToDocument(link_format="plain")  # safe default

Prevention

When it happens

Trigger: PPTXToDocument(link_format="html") or any misspelled/unsupported value (e.g. 'md', 'text', 'url'); also occurs after deserialization if a stored init_parameters link_format is invalid.

Common situations: Typos or guessing the format names; older serialized pipelines from before link_format existed or with different accepted values; passing a variable that was expected to be validated upstream.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of deepset-ai/haystack@e318778c9b (2026-08-30). Data as JSON: /api/errors/e004d977cdc3466d. Report an issue: GitHub.