From 0c6a8f5688cefb37259d3404f0403075e033a182 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 13 Jul 2025 19:14:40 -0700 Subject: [PATCH] refactor(llm): remove dead code summarizing threads and generating todos (#2439) --- lua/avante/llm.lua | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/lua/avante/llm.lua b/lua/avante/llm.lua index c8ea14e..5c10394 100644 --- a/lua/avante/llm.lua +++ b/lua/avante/llm.lua @@ -22,44 +22,6 @@ M.CANCEL_PATTERN = "AvanteLLMEscape" local group = api.nvim_create_augroup("avante_llm", { clear = true }) ----@param content AvanteLLMMessageContent ----@param cb fun(title: string | nil): nil -function M.summarize_chat_thread_title(content, cb) - local system_prompt = - [[Summarize the content as a title for the chat thread. The title should be a concise and informative summary of the conversation, capturing the main points and key takeaways. It should be no longer than 100 words and should be written in a clear and engaging style. The title should be suitable for use as the title of a chat thread on a messaging platform or other communication medium. /no_think]] - local response_content = "" - local provider = Providers.get_memory_summary_provider() - M.curl({ - provider = provider, - prompt_opts = { - system_prompt = system_prompt, - messages = { - { role = "user", content = content }, - }, - }, - handler_opts = { - on_start = function(_) end, - on_chunk = function(chunk) - if not chunk then return end - response_content = response_content .. chunk - end, - on_stop = function(stop_opts) - if stop_opts.error ~= nil then - Utils.error(string.format("summarize chat thread title failed: %s", vim.inspect(stop_opts.error))) - return - end - if stop_opts.reason == "complete" then - response_content = Utils.trim_think_content(response_content) - response_content = Utils.trim(response_content, { prefix = "\n", suffix = "\n" }) - response_content = Utils.trim(response_content, { prefix = '"', suffix = '"' }) - local title = response_content - cb(title) - end - end, - }, - }) -end - ---@param prev_memory string | nil ---@param history_messages avante.HistoryMessage[] ---@param cb fun(memory: avante.ChatMemory | nil): nil