61295b9c25
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 2s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) 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 / Validate - Code Quality (pull_request) Has been skipped
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (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 / Check push changed paths (push) Successful in 4m13s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 4m43s
CI/CD Pipeline / Build Staging Web Image (push) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 5m19s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 5m33s
CI/CD Pipeline / Build Staging API Image (push) Successful in 1m41s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m19s
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been skipped
AI Code Review / AI Code Review (pull_request) Failing after 6m39s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Successful in 41s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 7m2s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
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 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
PR Automation / Auto Approve on CI Green (pull_request) Successful in 7m16s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m6s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m10s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m33s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 8m27s
CI/CD Pipeline / CI Gate (pull_request) Successful in 1m1s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 9m45s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 2m29s
CI/CD Pipeline / Integration Tests (push) Successful in 2m17s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 4m0s
CI/CD Pipeline / Unit Tests (push) Successful in 13m47s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Successful in 5m58s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
89 lines
2.3 KiB
Python
Executable File
89 lines
2.3 KiB
Python
Executable File
"""音色克隆 API Schema。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from typing import Any, Dict, List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class CreateVoiceCloneRequest(BaseModel):
|
|
"""创建音色克隆请求。"""
|
|
|
|
name: str = Field(..., min_length=1, max_length=100, description="音色名称")
|
|
description: str = Field("", description="音色描述")
|
|
source_audio_url: str = Field("", description="参考音频 URL(与 asset_id 二选一)")
|
|
asset_id: str = Field("", description="参考音频素材 ID(配音素材库中的音频 asset,与 source_audio_url 二选一)")
|
|
voice_model: str = Field("", description="语音模型名称")
|
|
language: str = Field("zh-CN", description="语言")
|
|
gender: str = Field("unknown", description="性别")
|
|
max_retries: int = Field(3, ge=1, le=10, description="最大重试次数")
|
|
metadata_: Optional[Dict[str, Any]] = Field(default=None, alias="metadata", description="额外元数据")
|
|
|
|
class Config:
|
|
populate_by_name = True
|
|
|
|
|
|
class VoiceCloneProfileResponse(BaseModel):
|
|
"""音色克隆档案响应。"""
|
|
|
|
id: str
|
|
user_id: str
|
|
name: str
|
|
description: str = ""
|
|
source_audio_url: str = ""
|
|
voice_id: str = ""
|
|
voice_model: str = ""
|
|
language: str = "zh-CN"
|
|
gender: str = "unknown"
|
|
status: str
|
|
error_message: str = ""
|
|
retry_count: int = 0
|
|
max_retries: int = 3
|
|
metadata_: Optional[Dict[str, Any]] = Field(default=None, alias="metadata", description="额外元数据")
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
populate_by_name = True
|
|
|
|
|
|
class VoiceCloneStatusResponse(BaseModel):
|
|
"""音色克隆状态响应(用于轮询)。"""
|
|
|
|
id: str
|
|
status: str
|
|
error_message: str = ""
|
|
voice_id: str = ""
|
|
retry_count: int = 0
|
|
|
|
|
|
class ListVoiceCloneResponse(BaseModel):
|
|
"""音色克隆列表响应。"""
|
|
|
|
items: List[VoiceCloneProfileResponse]
|
|
total: int
|
|
|
|
|
|
class VoiceClonePreviewResponse(BaseModel):
|
|
"""克隆音色试听响应。"""
|
|
|
|
clone_id: str
|
|
"""音色克隆档案 ID"""
|
|
|
|
voice_id: str
|
|
"""CosyVoice 音色 ID"""
|
|
|
|
audio_url: str
|
|
"""试听音频 URL"""
|
|
|
|
text: str
|
|
"""试听文本"""
|
|
|
|
duration: float = 0.0
|
|
"""音频时长(秒)"""
|
|
|
|
file_size: int = 0
|
|
"""文件大小(字节)"""
|