fix: #1809 对口型接口参数调整,后端内部调TTS合成音频 #1814

Merged
auto-approve-bot merged 2 commits from fix/lipsync-api-params-1809 into develop 2026-09-09 10:11:27 +08:00
Owner

问题

前端传 {voice_id, script_text, video_asset_id},后端 /api/v1/lipsync/jobs 要求 {video_url, audio_url},导致 422 报错。

改动

  • Schema: CreateLipsyncJobRequest 改为接收 {voice_id, script_text, video_url},移除 audio_url
  • Service: create_job 内部调 CosyVoice TTS 合成音频,生成 audio_url 后提交 MediaKit
  • Route: 注入 CosyVoiceService + voice_clone_profile_repository,支持克隆音色 profile UUID 解析
  • TTS 失败时创建 failed 记录并返回 502

前端对接说明

新请求参数:

{
  "video_url": "https://...",  // 前端用 video_asset_id 换取
  "voice_id": "longxiaochun_v3",  // 预设音色ID 或 克隆音色profile UUID
  "script_text": "要合成的脚本文本",
  "enable_video_loop": false,
  "project_id": ""
}

video_url 由前端用 video_asset_id 换好再传,voice_id 支持预设音色和克隆音色。

测试

  • 21 个 lipsync 测试更新通过
  • 57 个关联测试(ai_avatar_render、mediakit)无回归

Closes #1809

## 问题 前端传 `{voice_id, script_text, video_asset_id}`,后端 `/api/v1/lipsync/jobs` 要求 `{video_url, audio_url}`,导致 422 报错。 ## 改动 - **Schema**: `CreateLipsyncJobRequest` 改为接收 `{voice_id, script_text, video_url}`,移除 `audio_url` - **Service**: `create_job` 内部调 CosyVoice TTS 合成音频,生成 `audio_url` 后提交 MediaKit - **Route**: 注入 `CosyVoiceService` + `voice_clone_profile_repository`,支持克隆音色 profile UUID 解析 - TTS 失败时创建 failed 记录并返回 502 ## 前端对接说明 新请求参数: ```json { "video_url": "https://...", // 前端用 video_asset_id 换取 "voice_id": "longxiaochun_v3", // 预设音色ID 或 克隆音色profile UUID "script_text": "要合成的脚本文本", "enable_video_loop": false, "project_id": "" } ``` `video_url` 由前端用 `video_asset_id` 换好再传,`voice_id` 支持预设音色和克隆音色。 ## 测试 - 21 个 lipsync 测试更新通过 - 57 个关联测试(ai_avatar_render、mediakit)无回归 Closes #1809
xiaoxia added 1 commit 2026-09-09 10:01:54 +08:00
fix: #1809 对口型接口参数调整,后端内部调TTS合成音频
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 31s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 34s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m18s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m49s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m4s
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
6167e4c865
- Schema: CreateLipsyncJobRequest 改为接收 {voice_id, script_text, video_url}
- Service: create_job 内部调 CosyVoice 合成音频,生成 audio_url 后提交 MediaKit
- Route: 注入 CosyVoiceService + voice_clone_profile_repository,支持克隆音色解析
- TTS 失败时创建 failed 记录并返回 502
- 21 个测试更新通过,57 个关联测试无回归

🚀 预览环境已部署

项目 详情
PR号 #1814
预览链接 https://pr-1814.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1814 | | 预览链接 | [https://pr-1814.preview.xiaoxiajianji.com](https://pr-1814.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
auto-approve-bot added 1 commit 2026-09-09 10:04:16 +08:00
style: auto-format with black + isort + prettier [skip ci-format-check]
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 8s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 18s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 20s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m19s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m42s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 1m49s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 1m55s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m45s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 5m51s
AI Code Review / AI Code Review (pull_request) Successful in 6m24s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 6m23s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 4m20s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 7s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 24s
46f4de9f3b
auto-approve-bot merged commit c954e334e6 into develop 2026-09-09 10:11:27 +08:00
auto-approve-bot deleted branch fix/lipsync-api-params-1809 2026-09-09 10:11:27 +08:00

🗑️ 预览环境已清理

PR #1814 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1814 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.