refactor: llm tool parameters (#2449)
This commit is contained in:
@@ -43,14 +43,15 @@ M.returns = {
|
||||
M.on_render = function() return {} end
|
||||
|
||||
---@type AvanteLLMToolFunc<{ id: string, status: string }>
|
||||
function M.func(opts, on_log, on_complete, session_ctx)
|
||||
function M.func(input, opts)
|
||||
local on_complete = opts.on_complete
|
||||
local sidebar = require("avante").get()
|
||||
if not sidebar then return false, "Avante sidebar not found" end
|
||||
local todos = sidebar.chat_history.todos
|
||||
if not todos or #todos == 0 then return false, "No todos found" end
|
||||
for _, todo in ipairs(todos) do
|
||||
if todo.id == opts.id then
|
||||
todo.status = opts.status
|
||||
if todo.id == input.id then
|
||||
todo.status = input.status
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user