From 64607f3f20fb20159feae046ffcc36e4042a93e8 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 18 Jan 2025 22:40:53 -0300 Subject: [PATCH] Update extraction-service.ts --- apps/api/src/lib/extract/extraction-service.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/api/src/lib/extract/extraction-service.ts b/apps/api/src/lib/extract/extraction-service.ts index 1835e3258..1f0a19248 100644 --- a/apps/api/src/lib/extract/extraction-service.ts +++ b/apps/api/src/lib/extract/extraction-service.ts @@ -675,12 +675,11 @@ export async function performExtraction( const totalTokensUsed = tokenUsage.reduce((a, b) => a + b.totalTokens, 0); const llmUsage = estimateTotalCost(tokenUsage); - const tokensToBill = calculateFinalResultCost(finalResult); + let tokensToBill = calculateFinalResultCost(finalResult); - let linksBilled = links.length * 5; if (CUSTOM_U_TEAMS.includes(teamId)) { - linksBilled = 1; + tokensToBill = 1; } // Bill team for usage billTeam(teamId, subId, tokensToBill, logger, true).catch((error) => {