feat(billing): enhance task billing process with video input detection and updated pricing logic
- Added `EstimateBilling` function to check for video input in request metadata and return corresponding discount ratios. - Updated `ModelPriceHelperPerCall` to incorporate new pricing logic based on model ratios and video input. - Enhanced task billing logs to include model ratio information and adjusted calculations for actual quota based on additional multipliers. - Introduced `renderTaskBillingProcess` to improve rendering of task billing information in the UI.
This commit is contained in:
Vendored
+12
@@ -1620,6 +1620,18 @@ function renderPriceSimpleCore({
|
||||
return result;
|
||||
}
|
||||
|
||||
export function renderTaskBillingProcess(other, content) {
|
||||
if (other?.task_id != null) {
|
||||
return renderBillingArticle(
|
||||
[content].filter(Boolean),
|
||||
{ showReferenceNote: false },
|
||||
);
|
||||
}
|
||||
return renderBillingArticle([
|
||||
buildBillingText('任务预扣费(将在任务完成后按实际token重算)'),
|
||||
]);
|
||||
}
|
||||
|
||||
export function renderModelPrice(
|
||||
inputTokens,
|
||||
completionTokens,
|
||||
|
||||
+5
-1
@@ -36,6 +36,7 @@ import {
|
||||
renderAudioModelPrice,
|
||||
renderClaudeModelPrice,
|
||||
renderModelPrice,
|
||||
renderTaskBillingProcess,
|
||||
} from '../../helpers';
|
||||
import { ITEMS_PER_PAGE } from '../../constants';
|
||||
import { useTableCompactMode } from '../common/useTableCompactMode';
|
||||
@@ -497,7 +498,10 @@ export const useLogsData = () => {
|
||||
|
||||
let content = '';
|
||||
if (!isViolationFeeLog) {
|
||||
if (other?.ws || other?.audio) {
|
||||
const isTaskLog = other?.is_task === true || other?.task_id != null;
|
||||
if (isTaskLog && other?.model_price === -1) {
|
||||
content = renderTaskBillingProcess(other, logs[i].content);
|
||||
} else if (other?.ws || other?.audio) {
|
||||
content = renderAudioModelPrice(
|
||||
other?.text_input,
|
||||
other?.text_output,
|
||||
|
||||
Reference in New Issue
Block a user