File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ local parse_completion_chunk = types.partial({
6767 object = " chat.completion.chunk" ,
6868 choices = types .shape ({
6969 types .partial ({
70- delta = types .shape ({
70+ delta = types .partial ({
7171 [" content" ] = types .string :tag (" content" )
7272 }),
7373 index = types .number :tag (" index" )
243243 end
244244 accumulation_buffer = rest
245245 do
246- chunk = parse_completion_chunk (cjson .decode (json_blob ))
246+ chunk = assert ( parse_completion_chunk (cjson .decode (json_blob ) ))
247247 if chunk then
248248 chunk_callback (chunk )
249249 end
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ parse_completion_chunk = types.partial {
8989 -- not sure of the whole range of chunks, so for now we strictly parse an append
9090 choices : types. shape {
9191 types. partial {
92- delta : types. shape {
92+ delta : types. partial {
9393 " content" : types. string\ tag " content"
9494 }
9595 index : types. number\ tag " index"
@@ -253,7 +253,7 @@ class OpenAI
253253 break
254254
255255 accumulation_buffer = rest
256- if chunk = parse_completion_chunk cjson. decode json_blob
256+ if chunk = assert parse_completion_chunk cjson. decode json_blob
257257 chunk_callback chunk
258258
259259 ...
You can’t perform that action at this time.
0 commit comments