fix: tool calling (#2297)
This commit is contained in:
@@ -133,6 +133,8 @@ function M.func(opts, on_log, on_complete, session_ctx)
|
||||
|
||||
local is_streaming = opts.streaming or false
|
||||
|
||||
if is_streaming then return end
|
||||
|
||||
session_ctx.prev_streaming_diff_timestamp_map = session_ctx.prev_streaming_diff_timestamp_map or {}
|
||||
local current_timestamp = os.time()
|
||||
if is_streaming then
|
||||
|
||||
@@ -58,7 +58,10 @@ M.returns = {
|
||||
--- IMPORTANT: Using "the_content" instead of "content" is to avoid LLM streaming generating function parameters in alphabetical order, which would result in generating "path" after "content", making it impossible to achieve a stream diff view.
|
||||
---@type AvanteLLMToolFunc<{ path: string, content: string, the_content?: string, streaming?: boolean, tool_use_id?: string }>
|
||||
function M.func(opts, on_log, on_complete, session_ctx)
|
||||
if opts.the_content ~= nil then opts.content = opts.the_content end
|
||||
if opts.the_content ~= nil then
|
||||
opts.content = opts.the_content
|
||||
opts.the_content = nil
|
||||
end
|
||||
if not on_complete then return false, "on_complete not provided" end
|
||||
local abs_path = Helpers.get_abs_path(opts.path)
|
||||
if not Helpers.has_permission_to_access(abs_path) then return false, "No permission to access path: " .. abs_path end
|
||||
|
||||
Reference in New Issue
Block a user