refactor: llm tool parameters (#2449)

This commit is contained in:
yetone
2025-07-15 16:40:25 +08:00
committed by GitHub
parent 0c6a8f5688
commit b8bb0fd969
25 changed files with 627 additions and 381 deletions

View File

@@ -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