Skip to content

Commit

Permalink
chore: lint files (#4990)
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul authored Apr 5, 2024
1 parent fe75251 commit 2467f0c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions langchain-core/src/utils/testing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,24 @@ export class FakeStreamingChatModel extends BaseChatModel {
messages: BaseMessage[],
_options: this["ParsedCallOptions"],
_runManager?: CallbackManagerForLLMRun
): Promise<ChatResult> {
): Promise<ChatResult> {
if (this.thrownErrorString) {
throw new Error(this.thrownErrorString);
}

const content = this.responses?.[0].content ?? messages[0].content;
const generation: ChatResult = {
generations: [{
text: "",
message: new AIMessage({
content,
})
}]
}
generations: [
{
text: "",
message: new AIMessage({
content,
}),
},
],
};

return generation
return generation;
}

async *_streamResponseChunks(
Expand All @@ -253,7 +255,7 @@ export class FakeStreamingChatModel extends BaseChatModel {
message: new AIMessageChunk({
content,
}),
})
});
}
} else {
for (const _ of this.responses ?? messages) {
Expand All @@ -262,7 +264,7 @@ export class FakeStreamingChatModel extends BaseChatModel {
message: new AIMessageChunk({
content,
}),
})
});
}
}
}
Expand Down

0 comments on commit 2467f0c

Please sign in to comment.