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:
Dmitry Torokhov
2025-07-18 15:08:19 -07:00
committed by yetone
parent 2d9f8fd252
commit aa606b6147
9 changed files with 171 additions and 252 deletions

View File

@@ -263,10 +263,7 @@ When you're done, provide a clear and concise summary of what you found.]]):gsub
.. elapsed_time
.. "s)"
if session_ctx.on_messages_add then
local message = History.Message:new({
role = "assistant",
content = "\n\n" .. summary,
}, {
local message = History.Message:new("assistant", "\n\n" .. summary, {
just_for_display = true,
})
session_ctx.on_messages_add({ message })