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:
Betula-L
2026-05-09 06:35:35 -07:00
committed by GitHub
parent b77a074831
commit 6d50e2da42
4 changed files with 77 additions and 5 deletions

View File

@@ -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