Commit Graph

1995 Commits

Author SHA1 Message Date
Greyson LaLonde
80f7410683 Merge branch 'lorenze/imp/native-tool-calling' of https://github.com/crewAIInc/crewAI into lorenze/imp/native-tool-calling 2026-01-22 20:05:41 -05:00
Greyson LaLonde
b104d64b39 fix: sanitize tool names in native tool call processing
- Update extract_tool_call_info to return sanitized tool names
- Fix delegation tool name matching to use sanitized names
- Add sanitization in crew_agent_executor tool call extraction
- Add sanitization in experimental agent_executor
- Add sanitization in LLM.call function lookup
- Update streaming utility to use sanitized names
- Update base_agent_executor_mixin delegation check
2026-01-22 20:05:20 -05:00
lorenzejay
a54005459d Merge branch 'lorenze/imp/native-tool-calling' of github.com:crewAIInc/crewAI into lorenze/imp/native-tool-calling 2026-01-22 16:53:16 -08:00
lorenzejay
ec3a65b529 regen 2026-01-22 16:53:00 -08:00
Greyson LaLonde
242757f67b fix: apply sanitize_tool_name consistently across codebase
Unify tool name sanitization to ensure consistency between tool names
shown to LLMs and tool name matching/lookup logic.
2026-01-22 19:52:25 -05:00
Greyson LaLonde
8310ca1369 fix: update sanitize_tool_name test expectations
Align test expectations with unified sanitize_tool_name behavior
that lowercases and splits camelCase for LLM provider compatibility.
2026-01-22 19:17:42 -05:00
Greyson LaLonde
edae4e889c fix: include tool role messages in save_last_messages 2026-01-22 19:10:33 -05:00
Greyson LaLonde
846133310b fix: unify tool name sanitization across codebase 2026-01-22 19:01:14 -05:00
lorenzejay
e9ca6e89d8 regen again placeholder for cassette matching 2026-01-22 14:49:07 -08:00
lorenzejay
11c96d6e3c regen all azure cassettes 2026-01-22 14:14:21 -08:00
lorenzejay
f1bad9c748 regen 2026-01-22 14:09:16 -08:00
lorenzejay
73963b8e65 better tests 2026-01-22 14:08:02 -08:00
lorenzejay
249b118e9e drop logs 2026-01-22 13:54:27 -08:00
lorenzejay
51c5973033 fix test 2026-01-22 13:52:38 -08:00
lorenzejay
c7a83c8c36 fix other test 2026-01-22 13:47:52 -08:00
lorenzejay
ba15fbf8ea Implement max usage count tracking for tools in agent executors
- Added functionality to check if a tool has reached its maximum usage count before execution in both crew_agent_executor.py and agent_executor.py.
- Enhanced error handling to return a message when a tool's usage limit is reached.
- Updated tool usage logic in tool_usage.py to increment usage counts and print current usage status.
- Introduced tests to validate max usage count behavior for native tool calling, ensuring proper enforcement and tracking.

This update improves tool management by preventing overuse and providing clear feedback when limits are reached.
2026-01-22 13:47:36 -08:00
lorenzejay
90ab4d2527 regen azure cassettes 2026-01-22 13:40:10 -08:00
lorenzejay
65746137fe supporting bedrock 2026-01-22 13:31:56 -08:00
lorenzejay
89e961e08e ensure we support bedrock 2026-01-22 13:29:49 -08:00
lorenzejay
a61cfb258f regen gemini 2026-01-22 13:02:14 -08:00
lorenzejay
2f300bf86e regen cassettes 2026-01-22 12:49:56 -08:00
lorenzejay
f3951cb09d fix 2026-01-22 12:36:05 -08: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
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
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
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
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
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
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
lorenzejay
edd1fd73cd for fixing model dump with state 2026-01-21 13:01:42 -08:00
lorenzejay
b0abf169b0 drop max_tools_iterations 2026-01-21 13:00:23 -08:00
lorenzejay
7d5a64af0d fix llm_call_completed event serialization issue 2026-01-21 12:59:28 -08:00
Greyson LaLonde
f997b73577 fix: bump mcp to ~=1.23.1
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
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- resolves [cve](https://nvd.nist.gov/vuln/detail/CVE-2025-66416)
2026-01-21 12:43:48 -05:00
Greyson LaLonde
7a65baeb9c feat: add event ordering and parent-child hierarchy
adds emission sequencing, parent-child event hierarchy with scope management, and integrates both into the event bus. introduces flush() for deterministic handling, resets emission counters for test isolation, and adds chain tracking via previous_event_id/triggered_by_event_id plus context variables populated during emit and listener execution. includes tracing listener typing/sorting improvements, safer tool event pairing with try/finally, additional stack checks and cache-hit formatting, context isolation fixes, cassette regen/decoding, and test updates to handle vcr race conditions and flaky behavior.
2026-01-21 11:12:10 -05:00
lorenzejay
d6e04ba24d fix sync main issues 2026-01-21 07:40:27 -08:00
lorenzejay
1b67629149 Merge branch 'main' of github.com:crewAIInc/crewAI into lorenze/imp/native-tool-calling 2026-01-20 22:05:33 -08:00