fix(create): 参考内容 - 支持添加、独立删除与筛选管理
- 支持参考内容按稳定 ID 删除、筛选、清空、拖拽与触屏交互 - 保留 Vite 生产环境模型 Logo 加载并兼容 Bun 测试 - 同步最新 main,修正相关格式和陈旧测试断言 Co-authored-by: echoD886 <dingxiaojie66@gmail.com>
This commit is contained in:
@@ -13,16 +13,7 @@ type ModelCreditCost = {
|
||||
logicalPriceTiers?: ModelPriceTier[];
|
||||
};
|
||||
|
||||
export function requestCreditCost(options: {
|
||||
channelMode: string;
|
||||
modelCosts?: ModelCreditCost[];
|
||||
model: string;
|
||||
count?: string | number;
|
||||
seconds?: string | number;
|
||||
capability?: ModelCapability;
|
||||
config?: AiConfig;
|
||||
requirements?: ModelRequirements;
|
||||
}) {
|
||||
export function requestCreditCost(options: { channelMode: string; modelCosts?: ModelCreditCost[]; model: string; count?: string | number; seconds?: string | number; capability?: ModelCapability; config?: AiConfig; requirements?: ModelRequirements }) {
|
||||
if (options.channelMode !== "remote") return null;
|
||||
const cost = options.modelCosts?.find((item) => item.model === options.model) || null;
|
||||
if (!cost) return null;
|
||||
@@ -86,9 +77,7 @@ export function modelQuoteRequest(config: AiConfig, value: string, capability?:
|
||||
}
|
||||
|
||||
function creditAmount(billingMode: "fixed_request" | "per_second", unitPriceMicrocredits: number, count?: string | number, seconds?: string | number) {
|
||||
const quantity = billingMode === "per_second"
|
||||
? Math.max(1, Math.floor(Math.abs(Number(seconds)) || 1))
|
||||
: Math.max(1, Math.floor(Math.abs(Number(count)) || 1));
|
||||
const quantity = billingMode === "per_second" ? Math.max(1, Math.floor(Math.abs(Number(seconds)) || 1)) : Math.max(1, Math.floor(Math.abs(Number(count)) || 1));
|
||||
return (unitPriceMicrocredits / 1_000_000) * quantity;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user