File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ parse_chat_response = types.partial {
83
83
84
84
85
85
parse_completion_chunk = types. partial {
86
- object : " chat.completion.chunk"
86
+ -- object: "chat.completion.chunk"
87
87
-- not sure of the whole range of chunks, so for now we strictly parse an append
88
88
choices : types. shape {
89
89
types. partial {
@@ -190,7 +190,8 @@ class ChatSession
190
190
191
191
parts = {}
192
192
f = @client \ create_stream_filter ( c) ->
193
- table.insert parts, c. content
193
+ if c = parse_completion_chunk c
194
+ table.insert parts, c. content
194
195
195
196
f response
196
197
message = {
@@ -250,7 +251,7 @@ class OpenAI
250
251
break
251
252
252
253
accumulation_buffer = rest
253
- if chunk = parse_completion_chunk cjson. decode json_blob
254
+ if chunk = cjson. decode json_blob
254
255
chunk_callback chunk
255
256
256
257
...
You can’t perform that action at this time.
0 commit comments