-
Notifications
You must be signed in to change notification settings - Fork 3k
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 proplem in tool call #1620
base: main
Are you sure you want to change the base?
fix proplem in tool call #1620
Conversation
- BaseTool.result_as_answer is not applied in agent executor (crewAIInc#931) - some platforms raise prompt error as the tool output was append to the assistant message
This is a review from a crew. I'm testing a crew for PRs, so if it sounds weird that is the reason, you are one of the first ones to see this. :) I'll try to personally look into it as well Positive Changes
Specific Code Improvements
Links to Historical ContextGiven the PR's focus on tool handling, recent changes in adjacent PRs (e.g., PR #1615 and PR #1618) discuss related improvements in error handling and logging. Reviewing those may provide additional context for what can be further improved in tool interactions. General Recommendations
ConclusionThese changes will not only elevate the maintainability and reliability of the code but also align with best practices, ensuring smoother future enhancements. Let's keep iterating on these suggestions to further strengthen the CrewAI framework. |
The crew seems to be smart. |
Hey @liunux4odoo! I am not fully understanding the issue and solution offered in this PR. Could you please expand upon the original issue and your solution. For example, I am not sure why you're using the It would also be awesome if you could show a simple demo crew that is working with your PR. Here's how ChatGPT handles tool calling: |
The first problem is described in #931
The last message could not have role of BTW: CrewAI use React template for tool call, if it is better to use |
origin messages in the agent executor._invoke_loop seem like:
some platforms cannot process these three messages because they limit the last message to be an user or tool message.
So this pr split them to: