mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-03 14:09:24 +00:00
Fixes #4746 - Security: Insecure Pickle Deserialization enables Arbitrary Code Execution - Replace pickle.load/dump with json.load/dump in PickleHandler (file_handler.py) - Add backward compatibility to auto-migrate legacy .pkl files to .json - Replace PickleSerializer with JSON-based _CachedUploadSerializer in upload_cache.py - Replace PickleSerializer with JsonSerializer in file_store.py and agent_card.py - Update and add comprehensive security tests for all changes Co-Authored-By: João <joao@crewai.com>
crewai-files
File handling utilities for CrewAI multimodal inputs.
Supported File Types
ImageFile- PNG, JPEG, GIF, WebPPDFFile- PDF documentsTextFile- Plain text filesAudioFile- MP3, WAV, FLAC, OGG, M4AVideoFile- 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")],
)