mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
feat: show dash instead of zero for missing data on evals page (#7748)
Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
parent
079b37a85d
commit
9378a4e2ad
4 changed files with 19 additions and 8 deletions
|
|
@ -129,15 +129,13 @@ export function Evals({
|
|||
<TableRow key={run.id}>
|
||||
<TableCell title={run.model?.description}>
|
||||
<div className="font-sans">{run.label}</div>
|
||||
<div className="text-xs opacity-50">
|
||||
{formatTokens(run.modelInfo?.contextWindow ?? 0)}
|
||||
</div>
|
||||
<div className="text-xs opacity-50">{formatTokens(run.modelInfo?.contextWindow)}</div>
|
||||
</TableCell>
|
||||
<TableCell className="border-r">
|
||||
<div className="flex flex-row gap-2">
|
||||
<div>{formatCurrency(run.modelInfo?.inputPrice ?? 0)}</div>
|
||||
<div>{formatCurrency(run.modelInfo?.inputPrice)}</div>
|
||||
<div className="opacity-25">/</div>
|
||||
<div>{formatCurrency(run.modelInfo?.outputPrice ?? 0)}</div>
|
||||
<div>{formatCurrency(run.modelInfo?.outputPrice)}</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell className="font-mono">{formatDuration(run.taskMetrics.duration)}</TableCell>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@ const formatter = new Intl.NumberFormat("en-US", {
|
|||
currency: "USD",
|
||||
})
|
||||
|
||||
export const formatCurrency = (amount: number) => formatter.format(amount)
|
||||
export const formatCurrency = (amount: number | null | undefined) => {
|
||||
if (amount === null || amount === undefined) {
|
||||
return "-"
|
||||
}
|
||||
return formatter.format(amount)
|
||||
}
|
||||
|
||||
export const parsePrice = (price?: string) => (price ? parseFloat(price) * 1_000_000 : undefined)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
export const formatDuration = (durationMs: number) => {
|
||||
export const formatDuration = (durationMs: number | null | undefined) => {
|
||||
if (durationMs === null || durationMs === undefined) {
|
||||
return "-"
|
||||
}
|
||||
|
||||
const seconds = Math.floor(durationMs / 1000)
|
||||
const hours = Math.floor(seconds / 3600)
|
||||
const minutes = Math.floor((seconds % 3600) / 60)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
export const formatTokens = (tokens: number, decimals = 0) => {
|
||||
export const formatTokens = (tokens: number | null | undefined, decimals = 0) => {
|
||||
if (tokens === null || tokens === undefined) {
|
||||
return "-"
|
||||
}
|
||||
|
||||
if (tokens < 1000) {
|
||||
return tokens.toString()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue