Files
crewAI/lib
Devin AI 90f4021071 feat(tools): allow tools to return File instances for multimodal context
Closes #5758

Tools can now return crewai_files.FileInput instances (or lists/dicts of
them) from their _run method to dynamically extend the agent's
multimodal context. The framework detects file returns, replaces the
raw return with a confirmation message, and attaches the files to the
most recent user message so subsequent LLM calls include them.

- Add extract_files_from_tool_result helper
- Extend ToolResult dataclass with optional files field
- Detect FileInput returns in ToolUsage._use / _ause
- Propagate files through execute_tool_and_check_finality
- Attach files to messages in CrewAgentExecutor (ReAct + native tool flows)
- Mirror file attachment in LiteAgent ReAct loop
- Add comprehensive unit tests
2026-05-09 02:38:28 +00:00
..
2026-05-09 03:08:22 +08:00