修复chat生成参数提交错误BUG|模型引擎积分设置关联开发优化成功|视频/图片生成引擎API开发完成

This commit is contained in:
2026-05-28 13:00:27 +08:00
parent 5021cfd35b
commit edef601f7c
17 changed files with 890 additions and 483 deletions
@@ -262,6 +262,7 @@ async def charge_generation_media_by_params(
image_size: str | None = None,
duration: int | None = None,
resolution: str | None = None,
engine_id: str | None = None,
project_name: str | None = None,
description_prefix: str = "ChatAPI异步",
) -> BillingSummary:
@@ -272,7 +273,7 @@ async def charge_generation_media_by_params(
if gen_type == "image":
size = image_size or "2K"
amount = await calc_image_credits(db, size)
amount = await calc_image_credits(db, size, engine_id=engine_id)
items.append(
await deduct_credits_locked_once(
db,
@@ -284,7 +285,7 @@ async def charge_generation_media_by_params(
)
)
elif gen_type == "video":
amount = await calc_video_credits(db, duration or 5, resolution or "720p")
amount = await calc_video_credits(db, duration or 5, resolution or "720p", engine_id=engine_id)
items.append(
await deduct_credits_locked_once(
db,