fix: do not modify the tool_use input

This commit is contained in:
yetone
2025-07-16 20:15:14 +08:00
parent ae06698c30
commit 2a16e7d4d9
9 changed files with 37 additions and 35 deletions

View File

@@ -413,6 +413,10 @@ function M:parse_response(ctx, data_stream, _, opts)
if usage then opts.update_tokens_usage(usage) end
end
end
if jsn.error and jsn.error ~= vim.NIL then
opts.on_stop({ reason = "error", error = vim.inspect(jsn.error) })
return
end
---@cast jsn AvanteOpenAIChatResponse
if not jsn.choices then return end
local choice = jsn.choices[1]