summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-28 09:13:05 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-28 09:13:05 +0300
commit2580360f919c234deba0756f99d25f44046bf667 (patch)
tree5ea6c9d69684a8246b3da560bb208b65074ce10e /models
parentfe4dd0c982bae14cecb535b0f8c899a9992bdaa6 (diff)
Fix: removed code that deletes tool calls
Diffstat (limited to 'models')
-rw-r--r--models/models.go18
1 files changed, 9 insertions, 9 deletions
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