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:
parent
65422a16a4
commit
34a8ce5af0
1 changed files with 2 additions and 2 deletions
|
|
@ -4,8 +4,8 @@ type ToolCall struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
Function *FunctionCall `json:"function,omitempty"`
|
Function *FunctionCall `json:"function,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"-"`
|
||||||
Arguments map[string]any `json:"arguments,omitempty"`
|
Arguments map[string]any `json:"-"`
|
||||||
ThoughtSignature string `json:"-"` // Internal use only
|
ThoughtSignature string `json:"-"` // Internal use only
|
||||||
ExtraContent *ExtraContent `json:"extra_content,omitempty"`
|
ExtraContent *ExtraContent `json:"extra_content,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue