视频复刻积分规则优化
This commit is contained in:
@@ -137,9 +137,22 @@ def quote_flat(model_config, *, units: int = 1, team=None) -> Quote:
|
||||
|
||||
|
||||
def quote_video_digest(*, team=None, model_config=None) -> Quote:
|
||||
"""提炼提示词:固定 30 积分/次。失败退还。team 传入则乘团队价格系数。"""
|
||||
"""视频提炼提示词:优先 metadata.points_pricing.points_per_call 挂牌;
|
||||
不吃 unit_price(与旧「固定 30、忽略 unit_price」一致);未挂牌回落固定 30。
|
||||
失败退还。team 传入则乘团队价格系数。"""
|
||||
from apps.billing.points_rules import points_pricing_of, _int_points
|
||||
|
||||
multiplier = team_price_multiplier(team)
|
||||
points = apply_team_price(VIDEO_DIGEST_POINTS, multiplier)
|
||||
listed = None
|
||||
if model_config is not None:
|
||||
listed = _int_points(points_pricing_of(model_config).get("points_per_call"))
|
||||
if listed is not None and listed > 0:
|
||||
unit = Decimal(listed)
|
||||
rule = "per_call"
|
||||
else:
|
||||
unit = VIDEO_DIGEST_POINTS
|
||||
rule = "video_digest_flat"
|
||||
points = apply_team_price(unit, multiplier)
|
||||
base_cost = Decimal("0")
|
||||
if model_config is not None:
|
||||
base_cost = Decimal(str(_pricing_meta(model_config).get("base_cost_yuan") or 0))
|
||||
@@ -147,9 +160,9 @@ def quote_video_digest(*, team=None, model_config=None) -> Quote:
|
||||
points=points,
|
||||
base_cost_yuan=base_cost,
|
||||
meta={
|
||||
"rule": "video_digest_flat",
|
||||
"rule": rule,
|
||||
"units": 1,
|
||||
"unit_points": str(VIDEO_DIGEST_POINTS),
|
||||
"unit_points": str(unit),
|
||||
"price_multiplier": str(multiplier),
|
||||
"rate": str(get_billing_config().points_per_yuan),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user