mirror of
https://github.com/alibaba/higress.git
synced 2026-07-24 05:10:34 +08:00
bugfix: map bedrock tool-call indexes and tool_choice (#3786)
Signed-off-by: Betula-L <6059935+Betula-L@users.noreply.github.com> Co-authored-by: Betula-L <6059935+Betula-L@users.noreply.github.com>
This commit is contained in:
@@ -178,12 +178,19 @@ func (c *ClaudeToOpenAIConverter) ConvertClaudeRequestToOpenAI(body []byte) ([]b
|
||||
},
|
||||
}
|
||||
} else {
|
||||
// For other types like "auto", "none", etc.
|
||||
openaiRequest.ToolChoice = claudeRequest.ToolChoice.Type
|
||||
// Anthropic's "any" means the model must call at least one tool.
|
||||
// OpenAI-compatible requests express the same behavior as "required".
|
||||
if claudeRequest.ToolChoice.Type == "any" {
|
||||
openaiRequest.ToolChoice = "required"
|
||||
} else {
|
||||
// For other types like "auto", "none", etc.
|
||||
openaiRequest.ToolChoice = claudeRequest.ToolChoice.Type
|
||||
}
|
||||
}
|
||||
|
||||
// Handle parallel tool calls
|
||||
openaiRequest.ParallelToolCalls = !claudeRequest.ToolChoice.DisableParallelToolUse
|
||||
parallelToolCalls := !claudeRequest.ToolChoice.DisableParallelToolUse
|
||||
openaiRequest.ParallelToolCalls = ¶llelToolCalls
|
||||
}
|
||||
|
||||
// Convert thinking configuration if present
|
||||
|
||||
Reference in New Issue
Block a user