mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 06:37:26 +08:00
fix(ai-proxy): preserve empty Claude tool inputs (#3799)
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:
@@ -1506,7 +1506,7 @@ func claudeContentBlocksToBedrockContents(blocks []claudeChatMessageContent) []b
|
||||
}
|
||||
case "tool_use":
|
||||
result = append(result, bedrockMessageContent{ToolUse: &toolUseBlock{
|
||||
Input: block.Input,
|
||||
Input: claudeToolUseInput(block.Input),
|
||||
Name: block.Name,
|
||||
ToolUseId: block.Id,
|
||||
}})
|
||||
@@ -1525,6 +1525,13 @@ func claudeContentBlocksToBedrockContents(blocks []claudeChatMessageContent) []b
|
||||
return result
|
||||
}
|
||||
|
||||
func claudeToolUseInput(input *map[string]interface{}) map[string]interface{} {
|
||||
if input == nil {
|
||||
return map[string]interface{}{}
|
||||
}
|
||||
return *input
|
||||
}
|
||||
|
||||
func bedrockThinkingFromClaudeConfig(thinking *claudeThinkingConfig) map[string]interface{} {
|
||||
if thinking == nil || thinking.Type == "" || thinking.Type == "disabled" {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user