File tree 2 files changed +4
-4
lines changed
src/base/common/language-models/providers
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,10 @@ export class OpenAILanguageModelProvider implements ILanguageModelProvider {
48
48
for await ( const chunk of completion ) {
49
49
const [ choice ] = chunk . choices || [ ] ;
50
50
51
- part = choice . delta . content ;
51
+ part = choice . delta . content || '' ;
52
52
53
53
// Note: Empty if finish_reason exists.
54
- if ( choice . finish_reason || part == null ) {
54
+ if ( choice . finish_reason ) {
55
55
break ;
56
56
}
57
57
Original file line number Diff line number Diff line change @@ -60,10 +60,10 @@ export class ZhipuAILanguageModelProvider implements ILanguageModelProvider {
60
60
for await ( const chunk of completion ) {
61
61
const [ choice ] = chunk . choices || [ ] ;
62
62
63
- part = choice . delta . content ;
63
+ part = choice . delta . content || '' ;
64
64
65
65
// Note: Empty if finish_reason exists.
66
- if ( choice . finish_reason || part == null ) {
66
+ if ( choice . finish_reason ) {
67
67
break ;
68
68
}
69
69
You can’t perform that action at this time.
0 commit comments