feat(media): 对象存储 - 新增腾讯云 COS 与历史凭据兼容

Co-authored-by: MasterChiefCN <49179444+MasterChiefCN@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Original-PR: https://github.com/ddcat-ai/open-ai-canvas/pull/218
This commit is contained in:
MasterChiefCN
2026-08-14 10:10:15 +08:00
committed by GitHub
parent 7f0229463e
commit 95cb4a39ee
16 changed files with 497 additions and 83 deletions

View File

@@ -157,7 +157,7 @@ async function pollVideoGenerationsTask(config: ResolvedAiConfig, task: VideoGen
async function resolveVideoGenerationsUrl(value: string | undefined, storageKey?: string) {
if (storageKey?.startsWith("resource:")) return getResourceOSSUrl(storageKey);
if (isPublicMediaUrl(value || "")) return String(value);
throw new Error("NewAPI Video Generations 的参考素材需要公网 URL;请先把素材保存到 OSS");
throw new Error("NewAPI Video Generations 的参考素材需要公网 URL;请先把素材保存到对象存储");
}
type GeminiVeoOperation = {
@@ -488,7 +488,7 @@ async function buildVolcengineArkContent(prompt: string, references: ReferenceIm
async function resolveVolcengineArkReferenceUrl(value: string | undefined, storageKey?: string) {
if (storageKey?.startsWith("resource:")) return getResourceOSSUrl(storageKey);
if (isPublicMediaUrl(value || "") || String(value || "").startsWith("asset://")) return String(value);
throw new Error("火山方舟视频参考素材需要公网 URL 或 asset:// 素材 ID;请先将本地素材保存到 OSS");
throw new Error("火山方舟视频参考素材需要公网 URL 或 asset:// 素材 ID;请先将本地素材保存到对象存储");
}
async function buildSeedanceVideosPayload(config: AiConfig, model: string, prompt: string, references: ReferenceImage[], videoReferences: ReferenceVideo[], audioReferences: ReferenceAudio[]) {