Use server enterprise video pricing
Web Quality / verify (push) Has been cancelled
Web Quality / verify (pull_request) Has been cancelled

This commit is contained in:
2026-06-10 14:27:42 +08:00
parent d28889fd0c
commit 9e080bbb8f
5 changed files with 330 additions and 49 deletions
+16 -6
View File
@@ -72,7 +72,11 @@ import {
import { isViduModel } from "../../utils/viduRouting";
import { isPixverseModel } from "../../utils/pixverseRouting";
import { resolveVideoRequestModel } from "../../utils/resolveVideoModel";
import { calculateEnterpriseVideoCredits, ENTERPRISE_DEFAULT_VIDEO_MODEL } from "../../utils/enterpriseVideoPolicy";
import {
calculateEnterpriseVideoCredits,
ENTERPRISE_DEFAULT_VIDEO_MODEL,
type EnterpriseVideoPricingConfig,
} from "../../utils/enterpriseVideoPolicy";
import { resolveTextTokenCreditRate } from "../../utils/modelPricing";
import {
getImageQualityOptionsForContext,
@@ -408,6 +412,7 @@ function WorkbenchPage({
const [chatModel, setChatModel] = useState(CHAT_MODEL_OPTIONS[0].value);
const [modelPrices, setModelPrices] = useState<PublicModelPrice[]>([]);
const [enterpriseVideoPricing, setEnterpriseVideoPricing] = useState<EnterpriseVideoPricingConfig | null>(null);
const [thinkingSpeed, setThinkingSpeed] = useState(THINKING_SPEED_OPTIONS[0].value);
const [thinkingDepth, setThinkingDepth] = useState(THINKING_DEPTH_OPTIONS[0].value);
@@ -415,12 +420,16 @@ function WorkbenchPage({
let cancelled = false;
publicPricingClient
.getPrices()
.then((prices) => {
if (!cancelled) setModelPrices(prices);
.getPricing()
.then((pricing) => {
if (cancelled) return;
setModelPrices(pricing.modelPrices);
setEnterpriseVideoPricing(pricing.enterpriseVideoPricing);
})
.catch(() => {
if (!cancelled) setModelPrices([]);
if (cancelled) return;
setModelPrices([]);
setEnterpriseVideoPricing(null);
});
return () => {
@@ -566,7 +575,7 @@ function WorkbenchPage({
durationSeconds,
muted: false,
hasReferenceVideo: referenceItems.some((item) => item.kind === "video"),
});
}, enterpriseVideoPricing || undefined);
return {
label: `预计 ${formatCreditValue(credits)} 积分`,
title: `${activeModel}${videoQualityLabel}${durationSeconds} 秒,预计 ${formatCreditValue(credits)} 积分`,
@@ -589,6 +598,7 @@ function WorkbenchPage({
activeModel,
activeModelValue,
imageSettingsSummary,
enterpriseVideoPricing,
referenceItems,
selectedChatTokenRate,
videoDuration,