Skip to content

Commit aa50235

Browse files
committed
fix function crash
1 parent b3638a0 commit aa50235

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/api/chat/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function createSearchServer() {
3030
title: page.data.title,
3131
description: page.data.description,
3232
url: page.url,
33-
content: await page.data.getText('raw'),
33+
content: await page.data.getText('processed'),
3434
} as CustomDocument;
3535
}),
3636
);
@@ -69,7 +69,7 @@ export async function POST(req: Request) {
6969
if (reqJson.pageUrl) {
7070
const page = source.getPages().find((p) => p.url === reqJson.pageUrl);
7171
if (page && 'getText' in page.data) {
72-
const content = await page.data.getText('raw');
72+
const content = await page.data.getText('processed');
7373
contextPrompt += `\n\nThe user is currently viewing the page "${page.data.title}" (${reqJson.pageUrl}). Here is its content for context:\n\n${content}`;
7474
}
7575
}

0 commit comments

Comments
 (0)