Skip to content

Commit e724860

Browse files
committed
don't assert this to ignore empty chunks
1 parent a4d8ab8 commit e724860

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openai/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ do
243243
end
244244
accumulation_buffer = rest
245245
do
246-
chunk = assert(parse_completion_chunk(cjson.decode(json_blob)))
246+
chunk = parse_completion_chunk(cjson.decode(json_blob))
247247
if chunk then
248248
chunk_callback(chunk)
249249
end

openai/init.moon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class OpenAI
253253
break
254254

255255
accumulation_buffer = rest
256-
if chunk = assert parse_completion_chunk cjson.decode json_blob
256+
if chunk = parse_completion_chunk cjson.decode json_blob
257257
chunk_callback chunk
258258

259259
...

0 commit comments

Comments
 (0)