fix(openai): handle nil function arguments in tool calls (#2425)
This commit is contained in:
@@ -459,6 +459,7 @@ function M:parse_response(ctx, data_stream, _, opts)
|
|||||||
self:add_tool_use_message(ctx, tool_use, "generating", opts)
|
self:add_tool_use_message(ctx, tool_use, "generating", opts)
|
||||||
else
|
else
|
||||||
local tool_use = ctx.tool_use_list[tool_call.index + 1]
|
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
|
tool_use.input_json = tool_use.input_json .. tool_call["function"].arguments
|
||||||
-- self:add_tool_use_message(ctx, tool_use, "generating", opts)
|
-- self:add_tool_use_message(ctx, tool_use, "generating", opts)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user