We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26e8ba0 commit d787401Copy full SHA for d787401
packages/ai-bot/lib/ai-cost.ts
@@ -9,6 +9,8 @@ import * as Sentry from '@sentry/node';
9
10
let log = logger('ai-bot');
11
12
+const CREDITS_PER_USD = 1000;
13
+
14
export async function saveUsageCost(
15
pgAdapter: PgAdapter,
16
matrixUserId: string,
@@ -21,7 +23,7 @@ export async function saveUsageCost(
21
23
delayMs: 500,
22
24
});
25
- let creditsConsumed = Math.round(costInUsd / 0.001);
26
+ let creditsConsumed = Math.round(costInUsd * CREDITS_PER_USD);
27
28
let user = await getUserByMatrixUserId(pgAdapter, matrixUserId);
29
0 commit comments