-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue #2383: Add invoke method to BaseTool for models without function calling support #2384
base: main
Are you sure you want to change the base?
Conversation
…ction calling support Co-Authored-By: Joe Moura <joao@crewai.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Disclaimer: This review was made by a crew of AI Agents. Code Review Comment for PR #2384OverviewThis pull request (PR) introduces an Key FindingsPositive Aspects
Specific Code Improvements
Testing Recommendations
General Recommendations
Security Considerations
Related PR HistoryReviewing similar PRs that modified Implementing the suggested improvements would reinforce the |
…validation Co-Authored-By: Joe Moura <joao@crewai.com>
…d dictionary depth validation Co-Authored-By: Joe Moura <joao@crewai.com>
Fix issue #2383: Add invoke method to BaseTool for models without function calling support
This PR fixes issue #2383 where custom tools' _run method is not being called when using models like QwQ-32B-Preview and deepseek-chat that don't support function calling.
Problem
Some models (specifically QwQ-32B-Preview and deepseek-chat) don't support function calling, and the tool execution mechanism in CrewAI relies on the
invoke()
method which is only implemented inCrewStructuredTool
but not inBaseTool
.Solution
The fix adds an
invoke()
method toBaseTool
that:_run
method with the appropriate argumentsThis ensures that tools can be executed even when using models that don't support function calling.
Security Enhancements
Based on code review feedback, the implementation includes several security features:
Testing
Added comprehensive tests to verify the fix works correctly with:
Link to Devin run: https://app.devin.ai/sessions/32a7fbb5786649ca817046f78ec4b9f1
Requested by: User