Commit 3be7801d by Calcium-Ion Committed by GitHub

Merge pull request #2765 from seefs001/fix/2763

fix: remove disable_parallel_tool_use if tool_choice=none
parents f470310d b063b259
...@@ -838,9 +838,12 @@ func mapToolChoice(toolChoice any, parallelToolCalls *bool) *dto.ClaudeToolChoic ...@@ -838,9 +838,12 @@ func mapToolChoice(toolChoice any, parallelToolCalls *bool) *dto.ClaudeToolChoic
} }
} }
// 设置 disable_parallel_tool_use // Anthropic schema: tool_choice.type=none does not accept extra fields.
// 如果 parallel_tool_calls 为 true,则 disable_parallel_tool_use 为 false // When tools are disabled, parallel_tool_calls is irrelevant, so we drop it.
claudeToolChoice.DisableParallelToolUse = !*parallelToolCalls if claudeToolChoice.Type != "none" {
// 如果 parallel_tool_calls 为 true,则 disable_parallel_tool_use 为 false
claudeToolChoice.DisableParallelToolUse = !*parallelToolCalls
}
} }
return claudeToolChoice return claudeToolChoice
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment