style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -44,9 +44,13 @@ export function calculateTokenCost(
|
||||
const pricing = TOKEN_PRICING[model] ?? TOKEN_PRICING["gemini-2.5-flash"];
|
||||
const inputTokens = Math.max(0, Number(usage?.promptTokenCount || 0));
|
||||
const outputTokens = Math.max(0, Number(usage?.candidatesTokenCount || 0));
|
||||
const totalTokens = Math.max(0, Number(usage?.totalTokenCount || inputTokens + outputTokens));
|
||||
const totalTokens = Math.max(
|
||||
0,
|
||||
Number(usage?.totalTokenCount || inputTokens + outputTokens),
|
||||
);
|
||||
|
||||
const inputUsd = (inputTokens / 1_000_000) * pricing.inputPerMillionTextImageVideo;
|
||||
const inputUsd =
|
||||
(inputTokens / 1_000_000) * pricing.inputPerMillionTextImageVideo;
|
||||
const outputUsd = (outputTokens / 1_000_000) * pricing.outputPerMillion;
|
||||
const totalUsd = inputUsd + outputUsd;
|
||||
|
||||
@@ -58,4 +62,4 @@ export function calculateTokenCost(
|
||||
outputUsd,
|
||||
totalUsd,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user