feat: add initial model provider adapters

This commit is contained in:
wlx committed 2026-08-28 01:29:38 +08:00
1 parent 7f35960ba6
commit 547f7c0977
16 files changed
+577 -21

No files matched your search

+4 -4
View File
@@ -117,7 +117,7 @@ export interface AsyncTaskResult {
createdAt?: string
completedAt?: string
result?: { format: string; url: string }
output?: { modelUrl?: string; previewUrl?: string }
output?: { modelUrl?: string; previewUrl?: string; videoUrl?: string }
creditsConsumed?: number
error?: { code?: number; message?: string }
}
@@ -174,11 +174,11 @@ class HttpCatalogClient {
})
}
async create3dTask(apiKey: string, input: { model: string; prompt: string }) {
const payload = await this.request<{ task: AsyncTaskResult }>('/v1/3d/tasks', {
async createMediaTask(apiKey: string, input: { model: string; prompt: string; mediaType: '3d' | 'video' }) {
const payload = await this.request<{ task: AsyncTaskResult }>(input.mediaType === 'video' ? '/v1/video/tasks' : '/v1/3d/tasks', {
method: 'POST',
headers: { Authorization: `Bearer ${apiKey}` },
body: JSON.stringify(input),
body: JSON.stringify({ model: input.model, prompt: input.prompt }),
})
return payload.task
}