Skip to content

Commit 74a327d

Browse files
committed
feat(tools): allow passing a table as the callback of a tool.
1 parent 57ea8fe commit 74a327d

File tree

1 file changed

+4
-0
lines changed
  • lua/codecompanion/strategies/chat/tools

1 file changed

+4
-0
lines changed

lua/codecompanion/strategies/chat/tools/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ end
592592
function Tools.resolve(tool)
593593
local callback = tool.callback
594594

595+
if type(callback) == "table" then
596+
return callback --[[@as CodeCompanion.Tool]]
597+
end
598+
595599
local ok, module = pcall(require, "codecompanion." .. callback)
596600
if ok then
597601
log:debug("[Tools] %s identified", callback)

0 commit comments

Comments
 (0)