chore: make tool func type more accurate (#1369)

This commit is contained in:
Peter Cardenas
2025-02-24 05:49:06 -08:00
committed by GitHub
parent c2188e1afd
commit fe496a9573
3 changed files with 37 additions and 69 deletions

View File

@@ -2292,8 +2292,7 @@ function Sidebar:create_input_container(opts)
name = "add_file_to_context",
description = "Add a file to the context",
---@param input { rel_path: string }
---@return string | nil result
---@return string | nil error
---@type AvanteLLMToolFunc
func = function(input)
self.file_selector:add_selected_file(input.rel_path)
return "Added file to context", nil
@@ -2309,8 +2308,7 @@ function Sidebar:create_input_container(opts)
name = "remove_file_from_context",
description = "Remove a file from the context",
---@param input { rel_path: string }
---@return string | nil result
---@return string | nil error
---@type AvanteLLMToolFunc
func = function(input)
self.file_selector:remove_selected_file(input.rel_path)
return "Removed file from context", nil