Fix verified image pricing and settle async image usage
This commit is contained in:
1 parent
4c4f5ad68d
commit
8a13ef9c02
22 files changed
+506
-40
No files matched your search
@@ -31,6 +31,7 @@ test('catalog summary distinguishes published models, ready models, ready routes
|
||||
route('hidden', 'hidden'),
|
||||
route('hidden-unpriced', 'hidden', { pricingConfigured: false }),
|
||||
route('orphan-definition', 'missing'),
|
||||
route('deferred', 'pricing-only', { integrationDeferred: true, pricingConfigured: false }),
|
||||
]
|
||||
|
||||
assert.deepEqual(summarizeModelCatalog(definitions, routes, providers), {
|
||||
|
||||
@@ -6,10 +6,15 @@ test('fixed-unit pricing shows platform task price without inventing a standard
|
||||
const tripo = { price: 1.44, unit: 'CNY / task', upstreamCredits: 20, exchangeRate: 7.2, priceSource: 'Tripo 官方', standardPrice: { price: 0.2, unit: 'USD / task', credits: 20 } }
|
||||
assert.equal(standardPriceLabel(tripo), '$0.2 / task')
|
||||
assert.equal(modelStandardPriceLabel([tripo]), '$0.2 / task')
|
||||
assert.equal(platformPriceLabel(tripo), '平台售价 ¥1.44 / task')
|
||||
assert.equal(platformPriceLabel(tripo), '平台售价 ¥1.44 / 任务')
|
||||
assert.equal(groupDiscountLabel(tripo), '折扣未提供')
|
||||
})
|
||||
|
||||
test('image prices distinguish per-image and text/image token inputs', () => {
|
||||
assert.equal(platformPriceLabel({price:0.4032,unit:'CNY / image'}),'平台售价 ¥0.4032 / 张(单张请求)')
|
||||
assert.equal(platformPriceLabel({input:20.16,imageInput:32.256,output:120.96,unit:'CNY / 1M tokens'}),'¥20.16 文字输入 / ¥32.256 图像输入 / ¥120.96 输出 · 人民币 / 1M(一百万 Token)')
|
||||
})
|
||||
|
||||
test('official standard price source is displayed, while a standard-price marker is not treated as a discount', () => {
|
||||
const tripo = { price: 1.44, unit: 'CNY / task', discountLabel: '标准价', standardPrice: { price: 0.2, unit: 'USD / task', credits: 20, priceSource: 'Tripo 官方 API 定价' } }
|
||||
assert.equal(standardPriceLabel(tripo), '$0.2 / task · Tripo 官方 API 定价')
|
||||
|
||||
Reference in new issue
Block a user