调整后台文字模型请求发送图片或者视频的方式base64,而不是现在的链接形式,增加后台配置

This commit is contained in:
2026-07-16 13:36:37 +08:00
parent 38040dfb0d
commit 4d872036b2
10 changed files with 198 additions and 60 deletions
+14
View File
@@ -293,6 +293,20 @@ async def _seed_data():
)
)
# 文字模型媒体使用 base64 开关
existing_media_format = await db.execute(
select(SystemConfig).where(SystemConfig.key == "llm_media_as_base64").limit(1)
)
if not existing_media_format.scalar_one_or_none():
db.add(
SystemConfig(
id=generate_id(),
key="llm_media_as_base64",
value="true",
description="文字模型请求时图片/视频使用 base64 编码(而非 URL 链接)",
)
)
# Seed credit ratios - model_config_id is kept as a compatible field name,
# but now stores the actual engine id:
# - gen_type=video -> video_engines.id