crewAIInc/crewAI · error · FileNotFoundError

Document not found: {file_path}

Error message

Document not found: {file_path}

What it means

Error "Document not found: {file_path}" thrown in crewAIInc/crewAI.

Source

Thrown at lib/crewai-tools/src/crewai_tools/tools/contextualai_parse_tool/contextual_parse_tool.py:59

        parse_mode: str = "standard",
        figure_caption_mode: str = "concise",
        enable_document_hierarchy: bool = True,
        page_range: str | None = None,
        output_types: list[str] | None = None,
    ) -> str:
        """Parse a document using Contextual AI's parser."""
        if output_types is None:
            output_types = ["markdown-per-page"]
        file_path = validate_file_path(file_path)
        try:
            import json
            import os
            from time import sleep

            import requests

            if not os.path.exists(file_path):
                raise FileNotFoundError(f"Document not found: {file_path}")

            base_url = "https://api.contextual.ai/v1"
            headers = {
                "accept": "application/json",
                "authorization": f"Bearer {self.api_key}",
            }

            # Submit parse job
            url = f"{base_url}/parse"
            config = {
                "parse_mode": parse_mode,
                "figure_caption_mode": figure_caption_mode,
                "enable_document_hierarchy": enable_document_hierarchy,
            }

            if page_range:
                config["page_range"] = page_range

View on GitHub (pinned to 754d7323be)

Solutions

  1. Verify the document path exists and is readable.
  2. Use an absolute path or a path relative to the current working directory.

When it happens

Trigger: Thrown at lib/crewai-tools/src/crewai_tools/tools/contextualai_parse_tool/contextual_parse_tool.py:59 when the library encounters an invalid state.

Common situations: Occurs when the document path passed to the Contextual AI parse tool does not exist. Verify the path and that the file is accessible.


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/6c0c91f4d3e2d579. Report an issue: GitHub.