fix: decrease history max tokens (#1709)

This commit is contained in:
yetone
2025-03-25 16:07:45 +08:00
committed by GitHub
parent 6443f1dc5e
commit 8c4244b940
2 changed files with 3 additions and 3 deletions

View File

@@ -344,7 +344,7 @@ M._defaults = {
use_cwd_as_project_root = false,
},
history = {
max_tokens = 8192,
max_tokens = 4096,
storage_path = vim.fn.stdpath("state") .. "/avante",
paste = {
extension = "png",

View File

@@ -2576,12 +2576,12 @@ function Sidebar:create_input_container(opts)
if self.chat_history.memory then prompts_opts.memory = self.chat_history.memory.content end
if not summarize_memory or #history_messages < 12 then
if not summarize_memory or #history_messages < 8 then
cb(prompts_opts)
return
end
prompts_opts.history_messages = vim.list_slice(prompts_opts.history_messages, 7)
prompts_opts.history_messages = vim.list_slice(prompts_opts.history_messages, 5)
Llm.summarize_memory(self.code.bufnr, self.chat_history, function(memory)
if memory then prompts_opts.memory = memory.content end