Files
xiaoxia-saas/apps/web/src/api/template-editor/aiFeatures.ts
T
CI Bot 7b534c950b
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m9s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m37s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m5s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m24s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 5m35s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 6m19s
CI/CD Pipeline / Unit Tests (push) Successful in 9m49s
CI/CD Pipeline / Integration Tests (push) Successful in 3m42s
CI/CD Pipeline / Build Staging API Image (push) Successful in 13m48s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 55s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 36s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 1m39s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m42s
CI/CD Pipeline / Canary Release to Production (push) Failing after 862h59m13s
CI/CD Pipeline / Production Browser E2E (push) Failing after 863h7m48s
CI/CD Pipeline / Deploy Production (push) Failing after 863h7m49s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 863h7m50s
CI/CD Pipeline / Build Production API Image (push) Failing after 863h7m50s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 863h17m39s
CI/CD Pipeline / Frontend Lint (push) Failing after 863h17m40s
CI/CD Pipeline / PR Build Web Image (push) Failing after 863h17m39s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 863h17m42s
CI/CD Pipeline / CI Gate (push) Failing after 863h41m7s
CI/CD Pipeline / Build Production Web Image (push) Failing after 863h41m19s
CI/CD Pipeline / PR Build API Image (push) Failing after 863h51m9s
fix(cover): increase MediaKit timeout + use public URL + extend frontend timeout
Three fixes for cover generation:
1. cover.py: get_download_url -> get_url for video URL (OSS public read)
2. ai_service.py: extract_frames poll_interval=3.0, max_poll_attempts=60 (180s)
3. aiFeatures.ts: generateCover axios timeout 10s -> 180s
2026-08-11 16:09:07 +08:00

31 lines
826 B
TypeScript

/**
* AI 推荐 + 封面生成 API
*/
import apiClient from "../client"
import type {
AIRecommendRequest,
AIRecommendResponse,
GenerateCoverRequest,
GenerateCoverResponse,
} from "./types"
/** AI 推荐片段方案 */
export async function aiRecommendClips(
templateId: string,
data: AIRecommendRequest,
): Promise<AIRecommendResponse> {
const response = await apiClient.post(`/templates/${templateId}/editor/ai-recommend`, data)
return response.data
}
/** AI 生成封面 */
export async function generateCover(
templateId: string,
data: GenerateCoverRequest,
): Promise<GenerateCoverResponse> {
const response = await apiClient.post(`/templates/${templateId}/editor/generate-cover`, data, {
timeout: 180000, // 封面生成涉及 MediaKit 抽帧,最长 180 秒
})
return response.data
}