File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/backend/src/managers Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -505,7 +505,7 @@ export class ApiServer implements Disposable {
505
505
res . write (
506
506
JSON . stringify ( {
507
507
model : modelName ,
508
- response : chunk . choices [ 0 ] . delta . content ,
508
+ response : chunk . choices [ 0 ] . delta . content ?? '' ,
509
509
done : chunk . choices [ 0 ] . finish_reason === 'stop' ,
510
510
done_reason : chunk . choices [ 0 ] . finish_reason === 'stop' ? 'stop' : undefined ,
511
511
} ) + '\n' ,
@@ -516,7 +516,7 @@ export class ApiServer implements Disposable {
516
516
onNonStreamResponse : response => {
517
517
res . status ( 200 ) . json ( {
518
518
model : modelName ,
519
- response : response . choices [ 0 ] . message . content ,
519
+ response : response . choices [ 0 ] . message . content ?? '' ,
520
520
done : true ,
521
521
done_reason : 'stop' ,
522
522
} ) ;
You can’t perform that action at this time.
0 commit comments