mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-16 04:18:35 +00:00
Fixes #3984 AddImageTool now converts local file paths to base64 data URLs before returning them to the LLM. This enables multimodal functionality with Anthropic models (Claude 3.5 Sonnet, etc.) which require images in base64 format. Changes: - Add _normalize_image_url method to detect and convert local files - Support absolute paths, relative paths, file:// URLs, and ~ expansion - Preserve HTTP/HTTPS URLs and existing data URLs unchanged - Add comprehensive tests for all conversion scenarios Co-Authored-By: João <joao@crewai.com>