refactor(history): start moving history-related code into avante/history
The utils module has grown too big and contains unrelated functionality. Start moving code related to managing history messages comprising chat history into lua/avante/history module to keep the code more manageable.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
local History = require("avante.history")
|
||||
local Utils = require("avante.utils")
|
||||
local Path = require("avante.path")
|
||||
local Config = require("avante.config")
|
||||
@@ -9,7 +10,7 @@ local M = {}
|
||||
---@param history avante.ChatHistory
|
||||
---@return table?
|
||||
local function to_selector_item(history)
|
||||
local messages = Utils.get_history_messages(history)
|
||||
local messages = History.get_history_messages(history)
|
||||
local timestamp = #messages > 0 and messages[#messages].timestamp or history.timestamp
|
||||
local name = history.title .. " - " .. timestamp .. " (" .. #messages .. ")"
|
||||
name = name:gsub("\n", "\\n")
|
||||
|
||||
Reference in New Issue
Block a user