diff options
| author | Grail Finder <wohilas@gmail.com> | 2025-12-23 22:41:21 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2025-12-23 22:42:24 +0300 |
| commit | 3c6f9b624ec4ef6f2e92ddb2ba794a0d8cddd6cf (patch) | |
| tree | a782fce61c1388b547e274e2e64ebd6829247d57 | |
| parent | bc49f37dce78f24f62eee1b4d5c8e41a3a38048a (diff) | |
| -rw-r--r-- | bot.go | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -91,11 +91,8 @@ func cleanToolCalls(messages []models.RoleMsg) []models.RoleMsg { cleaned := make([]models.RoleMsg, 0, len(messages)) for i, msg := range messages { // recognize the message as the tool call and remove it - if msg.ToolCallID == "" { - cleaned = append(cleaned, msg) - } // tool call in last msg should stay - if i == len(messages)-1 { + if msg.ToolCallID == "" || i == len(messages)-1 { cleaned = append(cleaned, msg) } } |
