Files
crewAI/lib
Devin AI 0f5639e460 fix: convert local file paths to base64 in AddImageTool for Anthropic compatibility
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>
2025-11-27 19:07:20 +00:00
..