from pydantic import BaseModel, Field, ConfigDict
from typing import List, Optional

class DirectorShot(BaseModel):
    """Shot created by Director Agent"""
    model_config = ConfigDict(extra='allow')
    
    shot_id: int
    shot_title: str = Field(description="镜头标题/简述")
    script_ref: str = Field(description="对应剧本中的哪一句动作或对白")
    visual_description: str = Field(description="画面的详细自然语言描述 (包含动作、表演、环境细节)")
    dialogue: Optional[str] = Field(default=None, description="镜头内的对白")
    composition: str = Field(description="构图 (e.g. 黄金分割, 中心构图)")
    shot_type: str = Field(description="景别 (e.g. 特写, 中景, 远景)")
    camera_movement: str = Field(description="运镜方式 (e.g. 摇摄, 推镜头, 固定镜头)")
    camera_angle: str = Field(description="拍摄角度 (e.g. 平视, 仰拍)")
    lens: Optional[str] = Field(default=None, description="建议焦段 (e.g. 35mm, 85mm)")
    character_list: List[str] = Field(default=[], description="此镜头中可见的角色名称列表")
    prop_list: List[str] = Field(default=[], description="此镜头中可见的关键道具名称列表")
    scene_location: str = Field(default="", description="此镜头发生的场景地点")
    duration: str = Field(description="预估时长 (e.g. 2s)")
    transition: str = Field(description="剪辑转场 (e.g. 切, 叠化, 淡入)")


class DirectorStoryboard(BaseModel):
    model_config = ConfigDict(extra='allow')
    
    shots: List[DirectorShot]
