File tree 1 file changed +13
-11
lines changed
langchain-core/src/utils/testing
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -219,22 +219,24 @@ export class FakeStreamingChatModel extends BaseChatModel {
219
219
messages : BaseMessage [ ] ,
220
220
_options : this[ "ParsedCallOptions" ] ,
221
221
_runManager ?: CallbackManagerForLLMRun
222
- ) : Promise < ChatResult > {
222
+ ) : Promise < ChatResult > {
223
223
if ( this . thrownErrorString ) {
224
224
throw new Error ( this . thrownErrorString ) ;
225
225
}
226
226
227
227
const content = this . responses ?. [ 0 ] . content ?? messages [ 0 ] . content ;
228
228
const generation : ChatResult = {
229
- generations : [ {
230
- text : "" ,
231
- message : new AIMessage ( {
232
- content,
233
- } )
234
- } ]
235
- }
229
+ generations : [
230
+ {
231
+ text : "" ,
232
+ message : new AIMessage ( {
233
+ content,
234
+ } ) ,
235
+ } ,
236
+ ] ,
237
+ } ;
236
238
237
- return generation
239
+ return generation ;
238
240
}
239
241
240
242
async * _streamResponseChunks (
@@ -253,7 +255,7 @@ export class FakeStreamingChatModel extends BaseChatModel {
253
255
message : new AIMessageChunk ( {
254
256
content,
255
257
} ) ,
256
- } )
258
+ } ) ;
257
259
}
258
260
} else {
259
261
for ( const _ of this . responses ?? messages ) {
@@ -262,7 +264,7 @@ export class FakeStreamingChatModel extends BaseChatModel {
262
264
message : new AIMessageChunk ( {
263
265
content,
264
266
} ) ,
265
- } )
267
+ } ) ;
266
268
}
267
269
}
268
270
}
You can’t perform that action at this time.
0 commit comments