feat: Add renderModelPriceSimple function and update LogsTable component

- Introduced a new helper function `renderModelPriceSimple` to simplify the rendering of model price information.
- Updated the `LogsTable` component to utilize `renderModelPriceSimple`, enhancing the display of model pricing and grouping information.
- Removed the previous implementation of `renderModelPrice` from the `LogsTable` for cleaner code.
This commit is contained in:
CalciumIon
2024-12-11 21:06:26 +08:00
parent 77b8d918de
commit 60710d6c68
2 changed files with 20 additions and 10 deletions

View File

@@ -175,6 +175,19 @@ export function renderModelPrice(
}
}
export function renderModelPriceSimple(
modelRatio,
modelPrice = -1,
groupRatio,
) {
// 1 ratio = $0.002 / 1K tokens
if (modelPrice !== -1) {
return '价格:$' + modelPrice + ' * 分组:' + groupRatio;
} else {
return '模型: ' + modelRatio + ' * 分组: ' + groupRatio;
}
}
export function renderAudioModelPrice(
inputTokens,
completionTokens,