feat: Implement voice design management with CRUD operations and integrate into frontend
This commit is contained in:
@@ -30,7 +30,8 @@ class CustomVoiceRequest(BaseModel):
|
||||
class VoiceDesignRequest(BaseModel):
|
||||
text: str = Field(..., min_length=1, max_length=1000)
|
||||
language: str = Field(default="Auto")
|
||||
instruct: str = Field(..., min_length=1)
|
||||
instruct: Optional[str] = Field(default=None, min_length=1)
|
||||
saved_design_id: Optional[int] = None
|
||||
max_new_tokens: Optional[int] = Field(default=2048, ge=128, le=4096)
|
||||
temperature: Optional[float] = Field(default=0.9, ge=0.1, le=2.0)
|
||||
top_k: Optional[int] = Field(default=50, ge=1, le=100)
|
||||
|
||||
34
qwen3-tts-backend/schemas/voice_design.py
Normal file
34
qwen3-tts-backend/schemas/voice_design.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from typing import Optional, Dict, Any, List
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
class VoiceDesignCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=100)
|
||||
instruct: str = Field(..., min_length=1)
|
||||
backend_type: str = Field(..., pattern="^(local|aliyun)$")
|
||||
aliyun_voice_id: Optional[str] = None
|
||||
meta_data: Optional[Dict[str, Any]] = None
|
||||
preview_text: Optional[str] = None
|
||||
|
||||
class VoiceDesignUpdate(BaseModel):
|
||||
name: Optional[str] = Field(None, min_length=1, max_length=100)
|
||||
|
||||
class VoiceDesignResponse(BaseModel):
|
||||
id: int
|
||||
user_id: int
|
||||
name: str
|
||||
backend_type: str
|
||||
instruct: str
|
||||
aliyun_voice_id: Optional[str]
|
||||
meta_data: Optional[Dict[str, Any]]
|
||||
preview_text: Optional[str]
|
||||
created_at: datetime
|
||||
last_used: datetime
|
||||
use_count: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class VoiceDesignListResponse(BaseModel):
|
||||
designs: List[VoiceDesignResponse]
|
||||
total: int
|
||||
Reference in New Issue
Block a user