Commit Graph

2052 Commits

Author SHA1 Message Date
lorenzejay
f3951cb09d fix 2026-01-22 12:36:05 -08:00
Greyson LaLonde
b95a3a9bc8 refactor: extract files module to standalone crewai-files package 2026-01-22 15:06:20 -05:00
lorenzejay
77697c3ad9 fix cassettes 2026-01-22 11:43:07 -08:00
lorenzejay
a0fad289c5 Enhance tool handling and delegation tracking in agent executors
- Implemented immediate return for tools with result_as_answer=True in crew_agent_executor.py.
- Added delegation tracking functionality in agent_utils.py to increment delegations when specific tools are used.
- Updated tool usage logic to handle caching more effectively in tool_usage.py.
- Enhanced test cases to validate new delegation features and tool caching behavior.

This update improves the efficiency of tool execution and enhances the delegation capabilities of agents.
2026-01-22 11:42:52 -08:00
lorenzejay
458f6867f0 Enhance tool handling and delegation tracking in agent executors
- Implemented immediate return for tools with result_as_answer=True in crew_agent_executor.py.
- Added delegation tracking functionality in agent_utils.py to increment delegations when specific tools are used.
- Updated tool usage logic to handle caching more effectively in tool_usage.py.
- Enhanced test cases to validate new delegation features and tool caching behavior.

This update improves the efficiency of tool execution and enhances the delegation capabilities of agents.
2026-01-22 11:35:27 -08:00
Greyson LaLonde
a064b84ead feat: add URL file source support for multimodal content 2026-01-22 14:18:16 -05:00
Greyson LaLonde
4d0b6d834c test: add real video file tests for duration detection 2026-01-22 14:08:40 -05:00
Greyson LaLonde
9be88e05ee feat: add format hints to audio/video duration detection 2026-01-22 14:02:55 -05:00
lorenzejay
d0af4c6331 ensure we properly fail tools and emit their events 2026-01-22 10:36:11 -08:00
lorenzejay
0d4ff5d80c adjust 2026-01-22 10:18:35 -08:00
lorenzejay
a6a0bf6412 adjust cassettes and dropped tests due to native tool implementation 2026-01-22 10:15:18 -08:00
lorenzejay
bffe5aa877 revert crew agent executor 2026-01-22 09:28:00 -08:00
Greyson LaLonde
9fec81f976 refactor: improve factory typing with specific provider and uploader types 2026-01-22 12:22:28 -05:00
lorenzejay
85096ca086 regen cassette 2026-01-22 09:17:21 -08:00
lorenzejay
0d62d8dc0c updated cassette 2026-01-22 09:07:37 -08:00
lorenzejay
21911d2de5 linted 2026-01-22 08:49:03 -08:00
Greyson LaLonde
6147d4eb2e refactor: reorganize files module with centralized constants and utilities 2026-01-22 11:46:17 -05:00
lorenzejay
b40780f220 Merge branch 'main' of github.com:crewAIInc/crewAI into lorenze/imp/native-tool-calling 2026-01-22 08:38:57 -08:00
Vini Brasil
06d953bf46 Add model field to LLM failed events (#4267)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Move the `model` field from `LLMCallStartedEvent` and
`LLMCallCompletedEvent` to the base `LLMEventBase` class.
2026-01-22 16:19:18 +01:00
Greyson LaLonde
e2a5177da2 refactor: consolidate FileInput and MIME type definitions 2026-01-22 10:15:32 -05:00
Greyson LaLonde
da930fa1df refactor: extract helper functions to reduce code duplication 2026-01-22 09:52:23 -05:00
Greyson LaLonde
0a250a45ce refactor: fix IDE warnings and add Literal types to constraints
- Add Literal types for ImageFormat, AudioFormat, VideoFormat, ProviderName
- Convert methods to @staticmethod where appropriate
- Remove redundant default parameter values
- Fix variable shadowing in nested functions
- Make magic import optional with mimetypes fallback
- Add docstrings to inner functions
2026-01-22 02:54:29 -05:00
Greyson LaLonde
1353cb2a33 feat: add streaming uploads for large files
- OpenAI: Use Uploads API for files > 512MB with chunked streaming
- Gemini: Pass file path directly to SDK for FilePath sources
- Bedrock: Use upload_fileobj with TransferConfig for automatic multipart
2026-01-22 02:10:15 -05:00
Greyson LaLonde
5550c6df7e feat: promote files to first-class crewai.files package 2026-01-22 01:39:04 -05:00
lorenzejay
d9e4a2345b Remove debug print statements from AgentExecutor to clean up the code and improve readability. This change enhances the overall performance of the agent execution flow by eliminating unnecessary console output during LLM calls and iterations. 2026-01-21 17:53:35 -08:00
Greyson LaLonde
204a1cece7 chore: move file processing deps to optional dependencies 2026-01-21 20:52:15 -05:00
Greyson LaLonde
4c0d99601c chore: remove unnecessary comments and fix type errors
- Remove unnecessary block and inline comments from file utilities
- Fix mypy errors by using file.read() instead of file.source.read()
2026-01-21 20:40:13 -05:00
Greyson LaLonde
e2c517d0a2 feat: export file types and deprecate agent multimodal flag
- Export File type classes from crewai package
- Mark Agent.multimodal field as deprecated (use input_files instead)
2026-01-21 20:14:43 -05:00
Greyson LaLonde
af4523b2a1 chore: add file processing dependencies
- Add python-magic and aiocache to core dependencies
- Add optional image-processing group (Pillow)
- Add optional pdf-processing group (pypdf)
- Add optional file-processing group (both)
2026-01-21 20:13:26 -05:00
Greyson LaLonde
1fe020fa6f test: add file utilities tests
- Add tests for file processing constraints and validators
- Add tests for FileProcessor and FileResolver
- Add tests for resolved file types
- Add tests for file store operations
- Add unit tests for multimodal LLM support
2026-01-21 20:12:57 -05:00
Greyson LaLonde
b035aa8947 feat: add ReadFileTool for agent file access
- Create read_file tool for agents to access attached files
- Support reading by file name from crew/task file store
- Add unit tests for ReadFileTool
2026-01-21 20:12:11 -05:00
Greyson LaLonde
4ed5e4ca0e feat: add input_files support to Task and Crew
- Add input_files parameter to Task for file attachments
- Add file_handling mode to Crew for processing behavior
- Integrate file injection in CrewAgentExecutor
- Update prepare_kickoff to handle KickoffInputs type
2026-01-21 20:11:05 -05:00
Greyson LaLonde
771eccfcdf feat: add multimodal support to LLM providers
- Add format_multimodal_content() to all LLM providers
- Support inline base64 and file reference formats
- Add FileResolver integration for upload caching
- Add module exports for files package
2026-01-21 20:05:33 -05:00
Greyson LaLonde
50728b10e8 fix: resolve mypy type errors in file utilities 2026-01-21 19:43:46 -05:00
Greyson LaLonde
42ca4eacff feat: upgrade upload cache to aiocache with atexit cleanup 2026-01-21 19:35:56 -05:00
Greyson LaLonde
d8ebfe7ee0 feat: add module exports and file store 2026-01-21 19:28:40 -05:00
lorenzejay
422374a881 dropped unused 2026-01-21 16:06:33 -08:00
lorenzejay
659589e8ae organizae imports 2026-01-21 16:00:54 -08:00
lorenzejay
97766b3c58 fixing azure tests 2026-01-21 16:00:32 -08:00
Greyson LaLonde
8cf0cfa2b7 feat: add prompt caching support for Anthropic 2026-01-21 18:46:06 -05:00
Greyson LaLonde
3ad0af4934 feat: add file resolver for inline vs upload decisions 2026-01-21 18:41:34 -05:00
Greyson LaLonde
56946d309b feat: add provider file uploaders 2026-01-21 18:38:04 -05:00
Greyson LaLonde
5200ed4372 feat: add file upload cache 2026-01-21 18:37:22 -05:00
Greyson LaLonde
301a1da047 feat: add file processing infrastructure 2026-01-21 18:30:14 -05:00
Greyson LaLonde
22f1e21d69 feat: add core file types and content detection 2026-01-21 18:23:36 -05:00
lorenzejay
87088171d4 fix 2026-01-21 14:59:47 -08:00
lorenzejay
1757559a3d Merge branch 'main' of github.com:crewAIInc/crewAI into lorenze/imp/native-tool-calling 2026-01-21 13:59:44 -08:00
lorenzejay
6c5d6fb70c Update English translations for tool usage and reasoning instructions
- Revised the `post_tool_reasoning` message to clarify the analysis process after tool usage, emphasizing the need to provide only the final answer if requirements are met.
- Updated the `format` message to simplify the instructions for deciding between using a tool or providing a final answer, enhancing clarity for users.
- These changes improve the overall user experience by providing clearer guidance on task execution and response formatting.
2026-01-21 13:03:35 -08:00
lorenzejay
56dd2f82a4 Refactor AgentExecutor to support batch execution of native tool calls
- Updated the  method to process all tools from  in a single batch, enhancing efficiency and reducing the number of interactions with the LLM.
- Introduced a new utility function  to streamline the extraction of tool call details, improving compatibility with various tool formats.
- Removed the  parameter, simplifying the initialization of the .
- Enhanced logging and message handling to provide clearer insights during tool execution.
- This refactor improves the overall performance and usability of the agent execution flow.
2026-01-21 13:03:06 -08:00
lorenzejay
e562a06836 Add extract_tool_call_info function to handle various tool call formats
- Introduced a new utility function  to extract tool call ID, name, and arguments from different provider formats (OpenAI, Gemini, Anthropic, and dictionary).
- This enhancement improves the flexibility and compatibility of tool calls across multiple LLM providers, ensuring consistent handling of tool call information.
- The function returns a tuple containing the call ID, function name, and function arguments, or None if the format is unrecognized.
2026-01-21 13:02:22 -08:00