From a38625951107a279fff7a843a394d8047a086e56 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 30 Apr 2024 16:35:44 -0700 Subject: [PATCH] Update scrape.ts --- apps/api/src/controllers/scrape.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/controllers/scrape.ts b/apps/api/src/controllers/scrape.ts index de02f4d..849500a 100644 --- a/apps/api/src/controllers/scrape.ts +++ b/apps/api/src/controllers/scrape.ts @@ -117,7 +117,7 @@ export async function scrapeController(req: Request, res: Response) { ); const endTime = new Date().getTime(); const timeTakenInSeconds = (endTime - startTime) / 1000; - const numTokens = numTokensFromString(result.data.markdown, "gpt-3.5-turbo") + const numTokens = (result.data && result.data.markdown) ? numTokensFromString(result.data.markdown, "gpt-3.5-turbo") : 0; logJob({ success: result.success,