auto-save 2026-05-17 23:35 (~4)

This commit is contained in:
2026-05-17 23:35:20 +08:00
parent 44136f58b7
commit 970bc56cc2
4 changed files with 268 additions and 27 deletions

View File

@@ -134,6 +134,45 @@ export interface GeneratedVideo {
created_at: number
}
export interface RuntimeModels {
asr?: string
local_asr?: string
asr_fallback?: string
translate?: string
rewrite?: string
audio_rewrite?: string
vision?: string
image?: string
image_fallbacks?: string[]
minimax_tts?: string
minimax_voice?: string
minimax_voice_pool?: string[]
minimax_configured?: boolean
video?: string
video_aliases?: Record<string, string>
video_provider?: string
video_base_url?: string
video_configured?: boolean
video_create_paths?: string[]
}
export interface RuntimeHealth {
ok: boolean
llm_configured?: boolean
auth_configured?: boolean
base_url?: string
models?: RuntimeModels
}
export async function getRuntimeHealth(): Promise<RuntimeHealth> {
const res = await fetch(`${API_BASE}/health`, { cache: "no-store" })
if (!res.ok) {
const txt = await res.text().catch(() => "")
throw new Error(`health ${res.status} ${txt.slice(0, 300)}`)
}
return res.json()
}
// 把 ImageRef 解析成可显示的 src URL
export function resolveImageRefUrl(jobId: string, ref: ImageRef): string {
if (ref.kind === "keyframe") {