fix: set the content property to the empty string (#2566)

Co-authored-by: Jared Weiss <jared.weiss@quiq.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
PlacidFireball
2025-08-02 00:37:19 -07:00
committed by GitHub
parent 7965546a34
commit 6d372a9135

View File

@@ -158,8 +158,10 @@ function M:parse_messages(opts)
local last_message = messages[#messages]
if last_message and last_message.role == self.role_map["assistant"] and last_message.tool_calls then
last_message.tool_calls = vim.list_extend(last_message.tool_calls, tool_calls)
if not last_message.content then last_message.content = "" end
else
table.insert(messages, { role = self.role_map["assistant"], tool_calls = tool_calls })
table.insert(messages, { role = self.role_map["assistant"], tool_calls = tool_calls, content = "" })
end
end
if #tool_results > 0 then