Skip to content

Commit df53728

Browse files
authored
fix: json decode (#396)
1 parent c2376d2 commit df53728

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/chatgpt/api.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ function Api.chat_completions(custom_params, cb, should_stop)
5454
if raw_json == "[DONE]" then
5555
cb(raw_chunks, "END")
5656
else
57-
ok, json = pcall(vim.json.decode, raw_json)
57+
ok, json = pcall(vim.json.decode, raw_json, {
58+
luanil = {
59+
object = true,
60+
array = true,
61+
},
62+
})
5863
if ok and json ~= nil then
5964
if
6065
json

0 commit comments

Comments
 (0)