增加枚举数据
This commit is contained in:
@@ -7,3 +7,5 @@ from app.enums.user import *
|
||||
from app.enums.credit_record import *
|
||||
from app.enums.token_usage import *
|
||||
from app.enums.generation_task import *
|
||||
from app.enums.generation_status import *
|
||||
from app.enums.sms import *
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class GenerationMode(str, Enum):
|
||||
"""生成模式。"""
|
||||
STANDARD = "standard"
|
||||
FAST = "fast"
|
||||
|
||||
|
||||
class GenerationType(str, Enum):
|
||||
"""生成类型。"""
|
||||
video = "video"
|
||||
image = "image"
|
||||
|
||||
|
||||
class ChatGenerationTaskStatus(str, Enum):
|
||||
"""聊天生成任务状态。"""
|
||||
pending = "pending"
|
||||
processing = "processing"
|
||||
completed = "completed"
|
||||
failed = "failed"
|
||||
|
||||
|
||||
class ChatGenerationPipelineStage(str, Enum):
|
||||
"""聊天生成任务阶段。"""
|
||||
waiting = "waiting"
|
||||
prompt_optimization = "prompt_optimization"
|
||||
video_generation = "video_generation"
|
||||
post_processing = "post_processing"
|
||||
completed = "completed"
|
||||
failed = "failed"
|
||||
|
||||
|
||||
class ChatGenerationTaskEventType(str, Enum):
|
||||
"""聊天生成任务事件类型。"""
|
||||
TASK_CREATED = "TASK_CREATED"
|
||||
TASK_DELETED = "TASK_DELETED"
|
||||
TASK_CANCELLED = "TASK_CANCELLED"
|
||||
PROMPT_OPT_STARTED = "PROMPT_OPT_STARTED"
|
||||
PROMPT_OPT_COMPLETED = "PROMPT_OPT_COMPLETED"
|
||||
PROMPT_OPT_FAILED = "PROMPT_OPT_FAILED"
|
||||
VIDEO_GEN_STARTED = "VIDEO_GEN_STARTED"
|
||||
VIDEO_GEN_COMPLETED = "VIDEO_GEN_COMPLETED"
|
||||
VIDEO_GEN_FAILED = "VIDEO_GEN_FAILED"
|
||||
POST_PROCESSING_STARTED = "POST_PROCESSING_STARTED"
|
||||
POST_PROCESSING_COMPLETED = "POST_PROCESSING_COMPLETED"
|
||||
POST_PROCESSING_FAILED = "POST_PROCESSING_FAILED"
|
||||
TASK_COMPLETED = "TASK_COMPLETED"
|
||||
TASK_FAILED = "TASK_FAILED"
|
||||
@@ -0,0 +1,22 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class GenerationStatus(str, Enum):
|
||||
"""生成状态。"""
|
||||
prompt_optimized = "prompt_optimized"
|
||||
generating = "generating"
|
||||
completed = "completed"
|
||||
failed = "failed"
|
||||
|
||||
|
||||
class GenerationType(str, Enum):
|
||||
"""生成类型。"""
|
||||
video = "video"
|
||||
image = "image"
|
||||
|
||||
|
||||
# 生成配置常量
|
||||
DURATIONS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
ASPECT_RATIOS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"]
|
||||
RESOLUTIONS = ["480p", "720p", "1080p"]
|
||||
IMAGE_SIZES = ["2K", "4K"]
|
||||
@@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class SmsScene(str, Enum):
|
||||
"""短信场景。"""
|
||||
register = "register"
|
||||
login = "login"
|
||||
common = "common"
|
||||
set_password = "set_password"
|
||||
@@ -1,29 +1,17 @@
|
||||
from enum import Enum
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from app.enums.generation_status import (
|
||||
GenerationStatus,
|
||||
GenerationType,
|
||||
DURATIONS,
|
||||
ASPECT_RATIOS,
|
||||
RESOLUTIONS,
|
||||
IMAGE_SIZES,
|
||||
)
|
||||
from app.schemas.common import NaiveDatetime, NaiveDatetimeOptional
|
||||
from app.services.operation_log import log_operation
|
||||
|
||||
|
||||
class GenerationStatus(str, Enum):
|
||||
prompt_optimized = "prompt_optimized"
|
||||
generating = "generating"
|
||||
completed = "completed"
|
||||
failed = "failed"
|
||||
|
||||
|
||||
class GenerationType(str, Enum):
|
||||
video = "video"
|
||||
image = "image"
|
||||
|
||||
|
||||
DURATIONS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
ASPECT_RATIOS = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"]
|
||||
RESOLUTIONS = ["480p", "720p", "1080p"]
|
||||
IMAGE_SIZES = ["2K", "4K"]
|
||||
|
||||
|
||||
class OptimizeParams(BaseModel):
|
||||
project_id: str
|
||||
prompt: str = Field(..., max_length=500)
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
from enum import Enum
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class SmsScene(str, Enum):
|
||||
register = "register"
|
||||
login = "login"
|
||||
common = "common"
|
||||
set_password = "set_password"
|
||||
from app.enums.sms import SmsScene
|
||||
|
||||
|
||||
class SmsSendRequest(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user