From 2580360f919c234deba0756f99d25f44046bf667 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 28 Feb 2026 09:13:05 +0300 Subject: Fix: removed code that deletes tool calls --- models/models.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'models/models.go') diff --git a/models/models.go b/models/models.go index 200d898..b9e9fad 100644 --- a/models/models.go +++ b/models/models.go @@ -102,7 +102,7 @@ type RoleMsg struct { Content string `json:"-"` ContentParts []any `json:"-"` ToolCallID string `json:"tool_call_id,omitempty"` // For tool response messages - ToolCalls []ToolCall `json:"tool_calls,omitempty"` // For assistant messages with tool calls + ToolCall *ToolCall `json:"tool_call,omitempty"` // For assistant messages with tool calls IsShellCommand bool `json:"is_shell_command,omitempty"` // True for shell command outputs (always shown) KnownTo []string `json:"known_to,omitempty"` Stats *ResponseStats `json:"stats"` @@ -119,7 +119,7 @@ func (m RoleMsg) MarshalJSON() ([]byte, error) { Role string `json:"role"` Content []any `json:"content"` ToolCallID string `json:"tool_call_id,omitempty"` - ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCall *ToolCall `json:"tool_call,omitempty"` IsShellCommand bool `json:"is_shell_command,omitempty"` KnownTo []string `json:"known_to,omitempty"` Stats *ResponseStats `json:"stats,omitempty"` @@ -127,7 +127,7 @@ func (m RoleMsg) MarshalJSON() ([]byte, error) { Role: m.Role, Content: m.ContentParts, ToolCallID: m.ToolCallID, - ToolCalls: m.ToolCalls, + ToolCall: m.ToolCall, IsShellCommand: m.IsShellCommand, KnownTo: m.KnownTo, Stats: m.Stats, @@ -139,7 +139,7 @@ func (m RoleMsg) MarshalJSON() ([]byte, error) { Role string `json:"role"` Content string `json:"content"` ToolCallID string `json:"tool_call_id,omitempty"` - ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCall *ToolCall `json:"tool_call,omitempty"` IsShellCommand bool `json:"is_shell_command,omitempty"` KnownTo []string `json:"known_to,omitempty"` Stats *ResponseStats `json:"stats,omitempty"` @@ -147,7 +147,7 @@ func (m RoleMsg) MarshalJSON() ([]byte, error) { Role: m.Role, Content: m.Content, ToolCallID: m.ToolCallID, - ToolCalls: m.ToolCalls, + ToolCall: m.ToolCall, IsShellCommand: m.IsShellCommand, KnownTo: m.KnownTo, Stats: m.Stats, @@ -163,7 +163,7 @@ func (m *RoleMsg) UnmarshalJSON(data []byte) error { Role string `json:"role"` Content []any `json:"content"` ToolCallID string `json:"tool_call_id,omitempty"` - ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCall *ToolCall `json:"tool_call,omitempty"` IsShellCommand bool `json:"is_shell_command,omitempty"` KnownTo []string `json:"known_to,omitempty"` Stats *ResponseStats `json:"stats,omitempty"` @@ -172,7 +172,7 @@ func (m *RoleMsg) UnmarshalJSON(data []byte) error { m.Role = structured.Role m.ContentParts = structured.Content m.ToolCallID = structured.ToolCallID - m.ToolCalls = structured.ToolCalls + m.ToolCall = structured.ToolCall m.IsShellCommand = structured.IsShellCommand m.KnownTo = structured.KnownTo m.Stats = structured.Stats @@ -185,7 +185,7 @@ func (m *RoleMsg) UnmarshalJSON(data []byte) error { Role string `json:"role"` Content string `json:"content"` ToolCallID string `json:"tool_call_id,omitempty"` - ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCall *ToolCall `json:"tool_call,omitempty"` IsShellCommand bool `json:"is_shell_command,omitempty"` KnownTo []string `json:"known_to,omitempty"` Stats *ResponseStats `json:"stats,omitempty"` @@ -196,7 +196,7 @@ func (m *RoleMsg) UnmarshalJSON(data []byte) error { m.Role = simple.Role m.Content = simple.Content m.ToolCallID = simple.ToolCallID - m.ToolCalls = simple.ToolCalls + m.ToolCall = simple.ToolCall m.IsShellCommand = simple.IsShellCommand m.KnownTo = simple.KnownTo m.Stats = simple.Stats -- cgit v1.2.3