Skip to content

Commit

Permalink
fix: json decode
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaGo authored Feb 28, 2024
1 parent ff458cb commit 475981e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/chatgpt/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ function Api.chat_completions(custom_params, cb, should_stop)
if raw_json == "[DONE]" then
cb(raw_chunks, "END")
else
ok, json = pcall(vim.json.decode, raw_json)
ok, json = pcall(vim.json.decode, raw_json, {
luanil = {
object = true,
array = true,
},
})
if ok and json ~= nil then
if
json
Expand Down

0 comments on commit 475981e

Please sign in to comment.