fix: routerai cost_rub was 0 — o?.promptTokens → promptTokens in computeCostRub
aiUsage.js: computeCostRub получает распакованные параметры, не объект o Backfill: UPDATE 8 записей с cost_rub=0 → ₽3.12
This commit is contained in:
@@ -74,7 +74,7 @@ async function computeCostRub({ requestType, model, promptTokens, completionToke
|
|||||||
// Routerai — цены в рублях, считаем по image токенам
|
// Routerai — цены в рублях, считаем по image токенам
|
||||||
const routeraiRate = ROUTERAI_IMAGE_RUB_PER_TOKEN[model];
|
const routeraiRate = ROUTERAI_IMAGE_RUB_PER_TOKEN[model];
|
||||||
if (routeraiRate !== undefined) {
|
if (routeraiRate !== undefined) {
|
||||||
const inputCost = ((o?.promptTokens || 0) / 1_000_000) * 233;
|
const inputCost = ((promptTokens || 0) / 1_000_000) * 233;
|
||||||
return +(ROUTERAI_IMAGE_TOKENS * routeraiRate + inputCost).toFixed(4);
|
return +(ROUTERAI_IMAGE_TOKENS * routeraiRate + inputCost).toFixed(4);
|
||||||
}
|
}
|
||||||
const perImage = IMAGE_PRICES_USD[model];
|
const perImage = IMAGE_PRICES_USD[model];
|
||||||
|
|||||||
Reference in New Issue
Block a user