From bf27d39f1b0c98812266f032ba0bac2ce907669a Mon Sep 17 00:00:00 2001 From: "Harsh Gupta (aider)" Date: Wed, 14 Aug 2024 13:45:02 +0530 Subject: [PATCH] fix: Replace estimateToken with a mock implementation --- backend/functions/src/cloud-functions/crawler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/functions/src/cloud-functions/crawler.ts b/backend/functions/src/cloud-functions/crawler.ts index bb8ba1a..94242cb 100644 --- a/backend/functions/src/cloud-functions/crawler.ts +++ b/backend/functions/src/cloud-functions/crawler.ts @@ -17,7 +17,8 @@ import { Crawled } from '../db/crawled'; import { cleanAttribute } from '../utils/misc'; import { randomUUID } from 'crypto'; -import { countGPTToken as estimateToken } from '../shared/utils/openai'; +// Mock implementation of estimateToken +const estimateToken = (text: string) => Math.ceil(text.length / 4); import { CrawlerOptions, CrawlerOptionsHeaderOnly } from '../dto/scrapping-options'; import { PDFExtractor } from '../services/pdf-extract';