File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -635,25 +635,19 @@ function Copilot:ask(prompt, opts)
635
635
636
636
last_message = content
637
637
local choice = content .choices [1 ]
638
-
639
- if choice .finish_reason then
640
- if job then
641
- finish_stream (nil , job )
642
- end
643
- return
644
- end
645
-
646
638
content = choice .message and choice .message .content or choice .delta and choice .delta .content
647
639
648
- if not content then
649
- return
640
+ if content then
641
+ full_response = full_response .. content
650
642
end
651
643
652
- if on_progress then
644
+ if content and on_progress then
653
645
on_progress (content )
654
646
end
655
647
656
- full_response = full_response .. content
648
+ if choice .finish_reason and job then
649
+ finish_stream (nil , job )
650
+ end
657
651
end
658
652
659
653
local function parse_stream_line (line , job )
You can’t perform that action at this time.
0 commit comments