Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jun 26, 2024
1 parent ddcc08b commit 80b3ffe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions langchain/src/experimental/chrome_ai/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class ChatChromeAI extends SimpleChatModel<ChromeAICallOptions> {
throw new Error("ChatChromeAI can only be used in the browser.");
}

const {ai} = window as any;
const { ai } = window as any;
const canCreateTextSession = await ai.canCreateTextSession();
if (canCreateTextSession === AIModelAvailability.No) {
throw new Error("The AI model is not available.");
Expand Down Expand Up @@ -137,10 +137,10 @@ export class ChatChromeAI extends SimpleChatModel<ChromeAICallOptions> {
throw new Error("Session not found. Please call `.initialize()` first.");
}
const textPrompt = formatPrompt(messages);

const stream = this.session.promptStreaming(textPrompt);
const iterableStream = IterableReadableStream.fromReadableStream(stream);

let previousContent = "";
for await (const chunk of iterableStream) {
const newContent = chunk.slice(previousContent.length);
Expand Down

0 comments on commit 80b3ffe

Please sign in to comment.