Skip to content

Commit

Permalink
fix: json decode (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaGo authored Mar 6, 2024
1 parent c2376d2 commit df53728
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 df53728

Please sign in to comment.