feat: harden analytics dashboard
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { TranslationKey } from "@/lib/i18n";
|
||||
import { quotaToUsd } from "@/lib/metrics";
|
||||
|
||||
export type DetailStatKey =
|
||||
| "calls"
|
||||
@@ -32,7 +33,7 @@ export function getDetailStats(data: DetailStatsData): DetailStatItem[] {
|
||||
return [
|
||||
{ key: "calls", labelKey: "dash.totalCalls", value: data.calls },
|
||||
{ key: "total_tokens", labelKey: "th.totalToken", value: data.total_tokens, format: "tokens" },
|
||||
{ key: "quota", labelKey: "th.cost", value: data.quota / 500000, format: "usd" },
|
||||
{ key: "quota", labelKey: "th.cost", value: quotaToUsd(data.quota), format: "usd" },
|
||||
{ key: "prompt_tokens", labelKey: "th.input", value: data.prompt_tokens, format: "tokens" },
|
||||
{ key: "completion_tokens", labelKey: "th.output", value: data.completion_tokens, format: "tokens" },
|
||||
{ key: "cache_creation_tokens", labelKey: "th.cacheCreation", value: data.cache_creation_tokens, format: "tokens" },
|
||||
|
||||
Reference in New Issue
Block a user