fix: tool_use_id is nil
This commit is contained in:
@@ -154,6 +154,7 @@ function M.generate_todos(user_input, cb)
|
|||||||
local result = LLMTools.process_tool_use(tools, pending_tool, {
|
local result = LLMTools.process_tool_use(tools, pending_tool, {
|
||||||
session_ctx = {},
|
session_ctx = {},
|
||||||
on_complete = function() cb() end,
|
on_complete = function() cb() end,
|
||||||
|
tool_use_id = pending_tool.id,
|
||||||
})
|
})
|
||||||
if result ~= nil then cb() end
|
if result ~= nil then cb() end
|
||||||
end
|
end
|
||||||
@@ -850,6 +851,7 @@ function M._stream(opts)
|
|||||||
on_log = opts.on_tool_log,
|
on_log = opts.on_tool_log,
|
||||||
set_tool_use_store = opts.set_tool_use_store,
|
set_tool_use_store = opts.set_tool_use_store,
|
||||||
on_complete = handle_tool_result,
|
on_complete = handle_tool_result,
|
||||||
|
tool_use_id = partial_tool_use.id,
|
||||||
})
|
})
|
||||||
if result ~= nil or error ~= nil then return handle_tool_result(result, error) end
|
if result ~= nil or error ~= nil then return handle_tool_result(result, error) end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1324,6 +1324,8 @@ function M.process_tool_use(tools, tool_use, opts)
|
|||||||
end
|
end
|
||||||
on_complete(result, err)
|
on_complete(result, err)
|
||||||
end,
|
end,
|
||||||
|
streaming = opts.streaming,
|
||||||
|
tool_use_id = opts.tool_use_id,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Result and error being nil means that the tool was executed asynchronously
|
-- Result and error being nil means that the tool was executed asynchronously
|
||||||
|
|||||||
Reference in New Issue
Block a user