mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge pull request #1663 from hyperwd/fix/glm-nil-input
fix(providers): handle nil input in GLM series tool_use blocks
This commit is contained in:
@@ -221,11 +221,17 @@ func buildRequestBody(
|
||||
|
||||
// Add tool_use blocks
|
||||
for _, tc := range msg.ToolCalls {
|
||||
// Handle nil Arguments (GLM-4 may return null input)
|
||||
input := tc.Arguments
|
||||
if input == nil {
|
||||
input = map[string]any{}
|
||||
}
|
||||
|
||||
toolUse := map[string]any{
|
||||
"type": "tool_use",
|
||||
"id": tc.ID,
|
||||
"name": tc.Name,
|
||||
"input": tc.Arguments,
|
||||
"input": input,
|
||||
}
|
||||
content = append(content, toolUse)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user