File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -179,14 +179,14 @@ function setResponseContentPart(
179
179
180
180
if ( requestType === 'chatComplete' ) {
181
181
updatedJson . choices = [ ...json . choices ] ;
182
- const lastChoice = {
183
- ...updatedJson . choices [ updatedJson . choices . length - 1 ] ,
182
+ const firstChoice = {
183
+ ...updatedJson . choices [ 0 ] ,
184
184
} ;
185
- lastChoice . message = {
186
- ...lastChoice . message ,
187
- content : textArray [ 0 ] || lastChoice . message . content ,
185
+ firstChoice . message = {
186
+ ...firstChoice . message ,
187
+ content : textArray [ 0 ] || firstChoice . message . content ,
188
188
} ;
189
- updatedJson . choices [ updatedJson . choices . length - 1 ] = lastChoice ;
189
+ updatedJson . choices [ 0 ] = firstChoice ;
190
190
} else if ( requestType === 'complete' ) {
191
191
updatedJson . choices = [ ...json . choices ] ;
192
192
updatedJson . choices [ json . choices . length - 1 ] . text =
You can’t perform that action at this time.
0 commit comments