refactor: llm tool parameters (#2449)
This commit is contained in:
@@ -45,12 +45,14 @@ M.returns = {
|
||||
}
|
||||
|
||||
---@type AvanteLLMToolFunc<{ path: string, pattern: string }>
|
||||
function M.func(opts, on_log, on_complete, session_ctx)
|
||||
local abs_path = Helpers.get_abs_path(opts.path)
|
||||
function M.func(input, opts)
|
||||
local on_log = opts.on_log
|
||||
local on_complete = opts.on_complete
|
||||
local abs_path = Helpers.get_abs_path(input.path)
|
||||
if not Helpers.has_permission_to_access(abs_path) then return "", "No permission to access path: " .. abs_path end
|
||||
if on_log then on_log("path: " .. abs_path) end
|
||||
if on_log then on_log("pattern: " .. opts.pattern) end
|
||||
local files = vim.fn.glob(abs_path .. "/" .. opts.pattern, true, true)
|
||||
if on_log then on_log("pattern: " .. input.pattern) end
|
||||
local files = vim.fn.glob(abs_path .. "/" .. input.pattern, true, true)
|
||||
local truncated_files = {}
|
||||
local is_truncated = false
|
||||
local size = 0
|
||||
|
||||
Reference in New Issue
Block a user