From b8641b5f8c335158383f6fae3138121bfbf66fec Mon Sep 17 00:00:00 2001 From: mathias Date: Sat, 23 May 2026 08:13:48 +0000 Subject: [PATCH] fix(litellm): guard args map against nil arguments --- pkg/litellm/model.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/litellm/model.go b/pkg/litellm/model.go index 6970240..bd87afd 100644 --- a/pkg/litellm/model.go +++ b/pkg/litellm/model.go @@ -233,6 +233,9 @@ func oaiChoiceToContent(choice oaiChoice) *genai.Content { for _, tc := range msg.ToolCalls { var args map[string]any _ = json.Unmarshal([]byte(tc.Function.Arguments), &args) + if args == nil { + args = map[string]any{} + } parts = append(parts, &genai.Part{ FunctionCall: &genai.FunctionCall{ ID: tc.ID,