mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix: remove extra fields from ToolCall JSON serialization
Mistral's API strictly validates tool_calls in assistant messages and rejects non-standard fields. The ToolCall struct had Name and Arguments as top-level JSON fields, duplicating data already in Function.Name and Function.Arguments. OpenAI silently ignored these extras but Mistral returns 422. Change json tags to "-" so these internal fields are no longer serialized to API payloads while remaining available in Go code.
This commit is contained in:
@@ -4,8 +4,8 @@ type ToolCall struct {
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Function *FunctionCall `json:"function,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Arguments map[string]any `json:"arguments,omitempty"`
|
||||
Name string `json:"-"`
|
||||
Arguments map[string]any `json:"-"`
|
||||
ThoughtSignature string `json:"-"` // Internal use only
|
||||
ExtraContent *ExtraContent `json:"extra_content,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user