refactor(history): change HistoryMessage:new() to accept role and item
Change the constructor to accept role and a single content item instead of raw AvanteLLMMessage instance. This will help when we will start changing message.content from being a string or a list of tables to just a string or a single table.
This commit is contained in:
@@ -231,7 +231,10 @@ L5: pass
|
||||
},
|
||||
}
|
||||
|
||||
local history_messages = vim.iter(llm_messages):map(function(msg) return HistoryMessage:new(msg) end):totable()
|
||||
local history_messages = vim
|
||||
.iter(llm_messages)
|
||||
:map(function(msg) return HistoryMessage:new(msg.role, msg.content) end)
|
||||
:totable()
|
||||
|
||||
local diagnostics = Utils.lsp.get_diagnostics(bufnr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user