|
|
@@ -299,10 +299,12 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
|
|
|
...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }),
|
|
|
}
|
|
|
|
|
|
- // For native tool protocol, explicitly disable parallel tool calls.
|
|
|
+ // For native tool protocol, control parallel tool calls based on the metadata flag.
|
|
|
+ // When parallelToolCalls is true, allow parallel tool calls (OpenAI's parallel_tool_calls=true).
|
|
|
+ // When false (default), explicitly disable parallel tool calls (false).
|
|
|
// For XML or when protocol is unset, omit the field entirely so the API default applies.
|
|
|
if (metadata?.toolProtocol === "native") {
|
|
|
- body.parallel_tool_calls = false
|
|
|
+ body.parallel_tool_calls = metadata.parallelToolCalls ?? false
|
|
|
}
|
|
|
|
|
|
// Include text.verbosity only when the model explicitly supports it
|