fix: tool calling (#2297)

This commit is contained in:
yetone
2025-06-22 21:50:26 +08:00
committed by GitHub
parent db39f5fe1b
commit 3033556d5b
12 changed files with 127 additions and 99 deletions

View File

@@ -243,7 +243,7 @@ function M:parse_response(ctx, data_stream, _, opts)
if not ctx.function_call_id then ctx.function_call_id = 0 end
ctx.function_call_id = ctx.function_call_id + 1
local tool_use = {
id = ctx.session_id .. "-" .. tostring(ctx.function_call_id),
id = ctx.turn_id .. "-" .. tostring(ctx.function_call_id),
name = part.functionCall.name,
input_json = vim.json.encode(part.functionCall.args),
}