-
Notifications
You must be signed in to change notification settings - Fork 10
feat(ai-proxy): add parallel_tool_calls support #1438
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
Conversation
Add parallel_tool_calls parameter to DispatchBody to match OpenAI API. When set to false, the model will call at most one tool per request. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. 🚦 See full report on Qlty Cloud »🛟 Help
|
Simplify dispatch() by inlining the tools binding logic directly, removing unnecessary method indirection for simple null check. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| } | ||
| } | ||
|
|
||
| private bindToolsIfNeeded( |
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.
simplify by adding a one liner
| tool_choice: toolChoice, | ||
| parallel_tool_calls: parallelToolCalls, | ||
| } = body; | ||
|
|
||
| const enrichedTools = this.enrichToolDefinitions(tools); | ||
| const model = this.bindToolsIfNeeded(this.chatModel, enrichedTools, toolChoice); | ||
| const model = enrichedTools?.length | ||
| ? this.chatModel.bindTools(enrichedTools, { | ||
| tool_choice: toolChoice, | ||
| parallel_tool_calls: parallelToolCalls, |
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.
| tool_choice: toolChoice, | |
| parallel_tool_calls: parallelToolCalls, | |
| } = body; | |
| const enrichedTools = this.enrichToolDefinitions(tools); | |
| const model = this.bindToolsIfNeeded(this.chatModel, enrichedTools, toolChoice); | |
| const model = enrichedTools?.length | |
| ? this.chatModel.bindTools(enrichedTools, { | |
| tool_choice: toolChoice, | |
| parallel_tool_calls: parallelToolCalls, | |
| // eslint-disable-next-line @typescript-eslint/naming-convention | |
| const { tools, messages, tool_choice, parallel_tool_calls } = body; | |
| const enrichedTools = this.enrichToolDefinitions(tools); | |
| const model = enrichedTools?.length | |
| ? this.chatModel.bindTools(enrichedTools, { | |
| tool_choice, | |
| parallel_tool_calls, |
# @forestadmin/ai-proxy [1.2.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/ai-proxy@1.1.0...@forestadmin/ai-proxy@1.2.0) (2026-01-27) ### Features * **ai-proxy:** add parallel_tool_calls support ([#1438](#1438)) ([ed3d091](ed3d091))

Add parallel_tool_calls parameter to DispatchBody to match OpenAI API. When set to false, the model will call at most one tool per request.
Definition of Done
General
Security