-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(providers): correct tool calling message format across all providers #3132
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
base: staging
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR corrects tool calling message formats across multiple LLM providers to align with their respective API specifications. The key changes ensure proper batching of parallel tool calls and preservation of tool IDs. Major Changes:
Architecture Impact: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Provider as Provider (Anthropic/Gemini/etc)
participant LLM as LLM API
participant Tools as Tool Executor
User->>Provider: Send request with tools
Provider->>LLM: API call with tool definitions
alt Multiple Tool Calls (Parallel)
LLM->>Provider: Response with multiple tool_use blocks
Note over Provider: Collect all tool_use blocks
par Execute tools in parallel
Provider->>Tools: Execute tool 1
Provider->>Tools: Execute tool 2
Provider->>Tools: Execute tool N
end
Tools-->>Provider: Results for all tools
Note over Provider: Batch into single messages:<br/>ONE assistant msg with ALL tool_use<br/>ONE user msg with ALL tool_result
Provider->>LLM: Continue with batched messages
LLM->>Provider: Final response
end
Provider->>User: Return final response
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 2 comments
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/providers/gemini/core.ts
Line: 84:177
Comment:
Dead code - `executeToolCall` function is no longer called after introducing `executeToolCallsBatch`. Consider removing this function to reduce maintenance burden.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, no comments
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| endTime: new Date(toolCallEndTime).toISOString(), | ||
| duration, | ||
| result: resultContent, | ||
| const batchStartTime = Date.now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.


Summary
max_tokensparameternamefield to tool result messages for Mistral and GroqType of Change
Testing
Tested TypeScript compilation passes
Checklist