fix: properly declare rm variable in removeThinking function

This commit is contained in:
Grail Finder (aider)
2025-03-21 18:37:06 +03:00
parent 03095359da
commit 954de708c5

6
bot.go
View File

@@ -402,8 +402,10 @@ func removeThinking(chatBody *models.ChatBody) {
continue continue
} }
// find thinking and remove it // find thinking and remove it
rm.Content = thinkRE.ReplaceAllString(msg.Content, "") rm := models.RoleMsg{
rm.Role = msg.Role Role: msg.Role,
Content: thinkRE.ReplaceAllString(msg.Content, ""),
}
msgs = append(msgs, rm) msgs = append(msgs, rm)
} }
chatBody.Messages = msgs chatBody.Messages = msgs