Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update extraction-service.ts

Nicolas64607f3f20fb
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) => {