{"record":{"id":"c9805ff40b357823","repo":"deepset-ai/haystack","slug":"unknown-link-format-string-supported-formats","errorCode":null,"errorMessage":"Unknown link format '{string}'. Supported formats are: {list(enum_map.keys())}","messagePattern":"Unknown link format '(.+?)'\\. Supported formats are: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"haystack/components/converters/utils.py","lineNumber":34,"sourceCode":"    \"\"\"\n\n    MARKDOWN = \"markdown\"\n    PLAIN = \"plain\"\n    NONE = \"none\"\n\n    def __str__(self) -> str:\n        return self.value\n\n    @staticmethod\n    def from_str(string: str) -> \"LinkFormat\":\n        \"\"\"\n        Convert a string to a LinkFormat enum.\n        \"\"\"\n        enum_map = {e.value: e for e in LinkFormat}\n        link_format = enum_map.get(string.lower())\n        if link_format is None:\n            msg = f\"Unknown link format '{string}'. Supported formats are: {list(enum_map.keys())}\"\n            raise ValueError(msg)\n        return link_format\n\n\ndef get_bytestream_from_source(source: str | Path | ByteStream, guess_mime_type: bool = False) -> ByteStream:\n    \"\"\"\n    Creates a ByteStream object from a source.\n\n    :param source:\n        A source to convert to a ByteStream. Can be a string (path to a file), a Path object, or a ByteStream.\n    :param guess_mime_type:\n        Whether to guess the mime type from the file.\n    :return:\n        A ByteStream object.\n    \"\"\"\n\n    if isinstance(source, ByteStream):\n        return source\n    if isinstance(source, (str, Path)):","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/components/converters/utils.py#L16-L52","documentation":"LinkFormat.from_str converts a string into a LinkFormat enum used by converter utilities. The lookup lowercases the input but otherwise requires it to exactly equal one of the enum's values; otherwise a ValueError with the supported list is raised. It validates the link_format option of converters that render HTML links.","triggerScenarios":"Passing a string (directly via from_str or via a component's link_format parameter resolved through it) that is not one of the LinkFormat values, e.g. 'url', 'href', or 'md' instead of a supported value like 'markdown'/'plain'/'none'.","commonSituations":"Typo or wrong concept in pipeline YAML (confusing link format with table format); inventing a format name; migrating from a component that accepted different strings.","solutions":["Use exactly one of the supported formats listed in the message (lowercase accepted due to .lower(), but the word must match).","Inspect LinkFormat's values with [e.value for e in LinkFormat] to see the valid set.","If the intent was table output format, that is a separate parameter (table_format) — set that instead."],"exampleFix":"# before\nconverter.component.link_format = \"md\"\n# after\nconverter.component.link_format = \"markdown\"","handlingStrategy":"validation","validationCode":"from haystack.components.converters.utils import LinkFormat\n\ndef is_valid_link_format(fmt: str) -> bool:\n    return fmt.lower() in {e.value for e in LinkFormat}\n\nassert is_valid_link_format(link_format), f\"{link_format!r} not in {sorted(e.value for e in LinkFormat)}\"","typeGuard":"from haystack.components.converters.utils import LinkFormat\n\ndef is_link_format(s: str) -> bool:\n    return s.lower() in {e.value for e in LinkFormat}","tryCatchPattern":"try:\n    converter.run(sources=srcs, link_format=fmt)\nexcept ValueError as e:\n    logger.warning(\"Falling back to default link format: %s\", e)\n    converter.run(sources=srcs)","preventionTips":["Use LinkFormat.from_str() at config boundaries so errors surface early with the valid list","Store link_format in your pipeline YAML exactly as the enum values are spelled","Write a smoke test that instantiates all components from your config at CI time"],"tags":["python","valueerror","enum","invalid-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}