xtekky/gpt4free · error · MissingRequirementsError

Install markitdown

Error message

Install markitdown

What it means

Error "Install markitdown" thrown in xtekky/gpt4free.

Source

Thrown at g4f/cli/client.py:363

        for idx, tok in enumerate(args.input):
            if tok.startswith(("http://", "https://")):
                try:
                    async with session.head(tok, allow_redirects=True) as resp:
                        is_ok = resp.status == 200
                        content_type = resp.headers.get("Content-Type", "")
                except Exception:
                    is_ok = False
                    content_type = ""

                if is_ok and content_type.startswith("image"):
                    media.append(tok)
                else:
                    try:
                        from g4f.integration.markitdown import MarkItDown
                    except ImportError:
                        from g4f.errors import MissingRequirementsError

                        raise MissingRequirementsError("Install markitdown")

                    def run_markitdown(url):
                        md = MarkItDown()
                        return md.convert_url(url).text_content

                    txt = await asyncio.to_thread(run_markitdown, tok)
                    input_txt += f"\n```source: {tok}\n{txt}\n```\n"
            elif os.path.isfile(tok):
                from g4f.image import is_accepted_format

                head = Path(tok).read_bytes()[:12]
                try:
                    if is_accepted_format(head):
                        media.append(Path(tok))
                        is_img = True
                    else:
                        is_img = False
                except ValueError:

View on GitHub (pinned to 973504e177)

Solutions

  1. Install markitdown: pip install markitdown.

When it happens

Trigger: Thrown at g4f/cli/client.py:363 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/5ecfd7c8c0e27f20. Report an issue: GitHub.