refactor: llm tool parameters (#2449)
This commit is contained in:
@@ -40,10 +40,12 @@ M.returns = {
|
||||
}
|
||||
|
||||
---@type AvanteLLMToolFunc<{ path: string, diff: string }>
|
||||
function M.func(opts, on_log, on_complete, session_ctx)
|
||||
if not opts.path then return false, "pathf are required" end
|
||||
if on_log then on_log("path: " .. opts.path) end
|
||||
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
|
||||
if not input.path then return false, "pathf are required" end
|
||||
if on_log then on_log("path: " .. input.path) end
|
||||
local abs_path = Helpers.get_abs_path(input.path)
|
||||
if not Helpers.has_permission_to_access(abs_path) then return false, "No permission to access path: " .. abs_path end
|
||||
if not on_complete then return false, "on_complete is required" end
|
||||
local diagnostics = Utils.lsp.get_diagnostics_from_filepath(abs_path)
|
||||
|
||||
Reference in New Issue
Block a user