Files
crewAI/lib/crewai-files
Greyson LaLonde 3b280e41fb
Some checks failed
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
chore: bump pypdf to 6.10.0 for GHSA-3crg-w4f6-42mx
Resolves CVE-2026-40260 where manipulated XMP metadata entity
declarations can exhaust RAM in pypdf <6.10.0.
2026-04-11 05:56:11 +08:00
..

crewai-files

File handling utilities for CrewAI multimodal inputs.

Supported File Types

  • ImageFile - PNG, JPEG, GIF, WebP
  • PDFFile - PDF documents
  • TextFile - Plain text files
  • AudioFile - MP3, WAV, FLAC, OGG, M4A
  • VideoFile - MP4, WebM, MOV, AVI

Usage

from crewai_files import File, ImageFile, PDFFile

# Auto-detect file type
file = File(source="document.pdf")  # Resolves to PDFFile

# Or use specific types
image = ImageFile(source="chart.png")
pdf = PDFFile(source="report.pdf")

Passing Files to Crews

crew.kickoff(
    input_files={"chart": ImageFile(source="chart.png")}
)

Passing Files to Tasks

task = Task(
    description="Analyze the chart",
    expected_output="Analysis",
    agent=agent,
    input_files=[ImageFile(source="chart.png")],
)