feat: trim think content in history messages (#1178)
This commit is contained in:
@@ -1638,7 +1638,11 @@ function Sidebar:create_input_container(opts)
|
||||
then
|
||||
break
|
||||
end
|
||||
table.insert(history_messages, 1, { role = "assistant", content = entry.original_response })
|
||||
table.insert(
|
||||
history_messages,
|
||||
1,
|
||||
{ role = "assistant", content = Utils.trim_think_content(entry.original_response) }
|
||||
)
|
||||
local user_content = ""
|
||||
if entry.selected_file ~= nil then
|
||||
user_content = user_content .. "SELECTED FILE: " .. entry.selected_file.filepath .. "\n\n"
|
||||
|
||||
@@ -858,4 +858,6 @@ end
|
||||
|
||||
function M.is_same_file(filepath_a, filepath_b) return M.uniform_path(filepath_a) == M.uniform_path(filepath_b) end
|
||||
|
||||
function M.trim_think_content(content) return content:gsub("^<think>.-</think>", "", 1) end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user