Fix: removed code that deletes tool calls
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user