From 3a11210f52a850f84771e1642cafcc3027b85075 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 31 Jan 2026 12:57:53 +0300 Subject: Enha: avoid recursion in llm calls --- models/models.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'models/models.go') diff --git a/models/models.go b/models/models.go index 69bdf02..76ef183 100644 --- a/models/models.go +++ b/models/models.go @@ -116,9 +116,9 @@ func (m RoleMsg) MarshalJSON() ([]byte, error) { } else { // Use simple content format aux := struct { - Role string `json:"role"` - Content string `json:"content"` - ToolCallID string `json:"tool_call_id,omitempty"` + Role string `json:"role"` + Content string `json:"content"` + ToolCallID string `json:"tool_call_id,omitempty"` KnownTo []string `json:"known_to,omitempty"` }{ Role: m.Role, @@ -150,9 +150,9 @@ func (m *RoleMsg) UnmarshalJSON(data []byte) error { // Otherwise, unmarshal as simple content format var simple struct { - Role string `json:"role"` - Content string `json:"content"` - ToolCallID string `json:"tool_call_id,omitempty"` + Role string `json:"role"` + Content string `json:"content"` + ToolCallID string `json:"tool_call_id,omitempty"` KnownTo []string `json:"known_to,omitempty"` } if err := json.Unmarshal(data, &simple); err != nil { @@ -540,3 +540,10 @@ func (lcp *LCPModels) ListModels() []string { } return resp } + +type ChatRoundReq struct { + UserMsg string + Role string + Regen bool + Resume bool +} -- cgit v1.2.3