refactor(llm_tools): use History.Helpers.get_tool_result_data()
Avoid poking into internals of avante.HistoryMessage, and use appropriate helper instead.
This commit is contained in:
@@ -148,14 +148,17 @@ function M.on_render(input, opts)
|
|||||||
local icon = Utils.icon("🔄 ")
|
local icon = Utils.icon("🔄 ")
|
||||||
local hl = Highlights.AVANTE_TASK_RUNNING
|
local hl = Highlights.AVANTE_TASK_RUNNING
|
||||||
if result_message then
|
if result_message then
|
||||||
if result_message.message.content[1].is_error then
|
local result = History.Helpers.get_tool_result_data(result_message)
|
||||||
state = "failed"
|
if result then
|
||||||
icon = Utils.icon("❌ ")
|
if result.is_error then
|
||||||
hl = Highlights.AVANTE_TASK_FAILED
|
state = "failed"
|
||||||
else
|
icon = Utils.icon("❌ ")
|
||||||
state = "completed"
|
hl = Highlights.AVANTE_TASK_FAILED
|
||||||
icon = Utils.icon("✅ ")
|
else
|
||||||
hl = Highlights.AVANTE_TASK_COMPLETED
|
state = "completed"
|
||||||
|
icon = Utils.icon("✅ ")
|
||||||
|
hl = Highlights.AVANTE_TASK_COMPLETED
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local lines = {}
|
local lines = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user