feat(audiobook): implement audiobook project management features
This commit is contained in:
68
qwen3-tts-backend/schemas/audiobook.py
Normal file
68
qwen3-tts-backend/schemas/audiobook.py
Normal file
@@ -0,0 +1,68 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional, List
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class AudiobookProjectCreate(BaseModel):
|
||||
title: str
|
||||
source_type: str
|
||||
source_text: Optional[str] = None
|
||||
|
||||
|
||||
class AudiobookProjectResponse(BaseModel):
|
||||
id: int
|
||||
user_id: int
|
||||
title: str
|
||||
source_type: str
|
||||
status: str
|
||||
llm_model: Optional[str] = None
|
||||
error_message: Optional[str] = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class AudiobookCharacterResponse(BaseModel):
|
||||
id: int
|
||||
project_id: int
|
||||
name: str
|
||||
description: Optional[str] = None
|
||||
instruct: Optional[str] = None
|
||||
voice_design_id: Optional[int] = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class AudiobookProjectDetail(AudiobookProjectResponse):
|
||||
characters: List[AudiobookCharacterResponse] = []
|
||||
|
||||
|
||||
class AudiobookCharacterUpdate(BaseModel):
|
||||
voice_design_id: int
|
||||
|
||||
|
||||
class AudiobookSegmentResponse(BaseModel):
|
||||
id: int
|
||||
project_id: int
|
||||
chapter_index: int
|
||||
segment_index: int
|
||||
character_id: int
|
||||
character_name: Optional[str] = None
|
||||
text: str
|
||||
audio_path: Optional[str] = None
|
||||
status: str
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class LLMConfigUpdate(BaseModel):
|
||||
base_url: str
|
||||
api_key: str
|
||||
model: str
|
||||
|
||||
|
||||
class LLMConfigResponse(BaseModel):
|
||||
base_url: Optional[str] = None
|
||||
model: Optional[str] = None
|
||||
has_key: bool
|
||||
Reference in New Issue
Block a user