fix(openai): handle nil function arguments in tool calls (#2425)

This commit is contained in:
Kyle
2025-07-09 14:19:29 +08:00
committed by GitHub
parent 30eb77af04
commit 9f4da7ea09

View File

@@ -459,6 +459,7 @@ function M:parse_response(ctx, data_stream, _, opts)
self:add_tool_use_message(ctx, tool_use, "generating", opts)
else
local tool_use = ctx.tool_use_list[tool_call.index + 1]
if tool_call["function"].arguments == vim.NIL then tool_call["function"].arguments = "" end
tool_use.input_json = tool_use.input_json .. tool_call["function"].arguments
-- self:add_tool_use_message(ctx, tool_use, "generating", opts)
end