16 lines
668 B
Python
16 lines
668 B
Python
from typing import Dict, Any, List, Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
class TextGenerationParams(BaseModel):
|
|
"""文本生成特定参数"""
|
|
system_prompt_path: Optional[str] = None
|
|
user_prompt_path: Optional[str] = None
|
|
content_data: Dict[str, Any] = Field(default_factory=dict)
|
|
|
|
class PosterJob(BaseModel):
|
|
"""定义单个海报生成任务的配置"""
|
|
template: str = "vibrant"
|
|
size: List[int] = Field(default_factory=lambda: [1080, 1080])
|
|
params: Dict[str, Any] = Field(default_factory=dict)
|
|
generate_text: bool = False
|
|
text_generation_params: TextGenerationParams = Field(default_factory=TextGenerationParams) |