fix(litellm): guard args map against nil arguments
This commit is contained in:
@@ -233,6 +233,9 @@ func oaiChoiceToContent(choice oaiChoice) *genai.Content {
|
|||||||
for _, tc := range msg.ToolCalls {
|
for _, tc := range msg.ToolCalls {
|
||||||
var args map[string]any
|
var args map[string]any
|
||||||
_ = json.Unmarshal([]byte(tc.Function.Arguments), &args)
|
_ = json.Unmarshal([]byte(tc.Function.Arguments), &args)
|
||||||
|
if args == nil {
|
||||||
|
args = map[string]any{}
|
||||||
|
}
|
||||||
parts = append(parts, &genai.Part{
|
parts = append(parts, &genai.Part{
|
||||||
FunctionCall: &genai.FunctionCall{
|
FunctionCall: &genai.FunctionCall{
|
||||||
ID: tc.ID,
|
ID: tc.ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user