integrate official Tripo async models

This commit is contained in:
wlx committed 2026-09-27 16:45:36 +08:00
1 parent a022162382
commit 962eef26e5
11 files changed
+160 -20

No files matched your search

+1 -1
View File
@@ -219,7 +219,7 @@ export interface AsyncTaskResult {
updated_at?: string
createdAt?: string
completedAt?: string
result?: { format: string; url: string }
result?: { format?: string; url?: string; modelUrl?: string; previewUrl?: string; videoUrl?: string; creditsConsumed?: number; [key: string]: unknown }
output?: { modelUrl?: string; previewUrl?: string; videoUrl?: string }
creditsConsumed?: number
error?: { code?: number; message?: string }
+6 -4
View File
@@ -352,8 +352,10 @@ async function runModel() {
}
function mapAsyncTask(task: AsyncTaskResult, model: ModelItem, taskPrompt?: string): TaskItem {
const modelUrl = task.output?.modelUrl || (task.provider ? task.result?.url : undefined)
const videoUrl = task.output?.videoUrl
const modelUrl = task.output?.modelUrl || task.result?.modelUrl || (task.provider ? task.result?.url : undefined)
const videoUrl = task.output?.videoUrl || task.result?.videoUrl
const previewUrl = task.output?.previewUrl || task.result?.previewUrl
const creditsConsumed = task.creditsConsumed ?? task.result?.creditsConsumed
const statusMap: Record<AsyncTaskResult['status'], TaskStatus> = {
queued: '排队中',
running: '执行中',
@@ -375,8 +377,8 @@ function mapAsyncTask(task: AsyncTaskResult, model: ModelItem, taskPrompt?: stri
prompt: taskPrompt,
modelUrl,
videoUrl,
previewUrl: task.output?.previewUrl,
creditsConsumed: task.creditsConsumed,
previewUrl,
creditsConsumed,
remote: true,
}
}