+
    wiYS                       R t ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtH	t	 ^ RI
HtHt  ! R R]]4      t ! R R	]]4      t ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R  R!]4      t ! R" R#]4      t ! R$ R%]4      t ! R& R']4      t ! R( R)]4      t ! R* R+]4      t  ! R, R-]4      t!R.# )/zr
Pydantic data models for the AI Video Production Pipeline.
All data flows between agents use these typed models.
)annotations)datetimetimezone)Enum)AnyOptional)	BaseModelFieldc                  &    ] tR t^tRtRtRtRtRtR# )TargetPlatformtiktokinstagram_reelsyoutube_shortsyoutube N)	__name__
__module____qualname____firstlineno__TIKTOKINSTAGRAM_REELSYOUTUBE_SHORTSYOUTUBE__static_attributes__r       C/home/gabslocked/Desktop/Projetos/Images/video_automation/models.pyr   r      s    F'O%NGr   r   c                  "    ] tR t^tRtRtRtRtR# )PipelineModeplanplan_imagesgenerater   N)r   r   r   r   PLANPLAN_AND_IMAGESGENERATEr   r   r   r   r   r      s    D#OHr   r   c                     ] tR t^$t$ Rt]! RR7      tR]R&   ]! RR7      tR]R&   ]! ]	RR	7      t
R
]R&   ]! ]	RR	7      tR
]R&   ]! ]	RR	7      tR
]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ]! RRR7      tR]R &   ]! RR!R7      tR]R"&   ]! RR#R7      tR]R$&   ]! RR%R7      tR]R&&   ]! RR'R7      tR]R(&   R)tR*# )+CharacterTemplateuD   Immutable character DNA – repeated verbatim in every image prompt.z+Short identifier for the character templatedescriptionstrnamez^Full physical description of the character. This is injected verbatim into every image prompt.physical_descriptionz-Visual style keywords applied to every promptdefault_factoryr'   	list[str]style_keywordsz0Keywords to explicitly exclude from every promptnegative_keywordszgAbsolute prohibitions - things that MUST NEVER appear in any image. More strict than negative_keywords.hard_prohibitionszMedium or medium-wide shot, eye-level or chest-level camera, no extreme angles, no dramatic lens changes, same framing logic across scenesdefaultcamera_settingsz_Real-world lighting matching the environment, natural shadows, photorealistic cinematic realismlighting_settingszThe character's POSE, BODY POSITION, and GESTURE MUST change per scene to match the script. DO NOT keep a neutral standing pose unless the script explicitly implies it. DO NOT repeat identical poses in consecutive scenes.	pose_rulezInfer the environment directly from the script. Place the character naturally inside that environment. Environment must be realistic and context-appropriate. Vary environments across scenes for visual dynamism.environment_ruleaE  Analyze the script to determine contextually appropriate clothing. ONE clothing style is defined at the start and maintained consistently across ALL scenes unless the script explicitly implies a change. Clothing must be REALISTIC and contextually believable. Always describe clothing in FULL DETAIL (color, fabric type, fit).clothing_ruleuc  When the script mentions a BODY PART, ORGAN, HEALTH CONDITION, PAIN, or PHYSICAL SYMPTOM, that specific body area MUST be visually highlighted. Use distinct COLOR CODING:
- PAIN/INFLAMMATION → Pulsing deep red or orange glow
- FATIGUE/WEAKNESS → Faded blue-grey desaturation
- BLOCKAGE/TENSION → Dense dark purple or black pressure cloud
- DAMAGE/INJURY → Fractured visualization with amber-red highlight
- HEALING/RECOVERY → Soft golden or green luminescent glow
- NERVE SIGNAL/ACTIVITY → Electric blue or cyan pulse lines
The highlight must look MEDICAL and SCIENTIFIC, not stylized or cartoonish.anatomical_highlight_rules zhPhilosophy for showing consequences instead of symptoms. Maps script concepts to representative actions.r2   r'   consequence_philosophyz?Rules for death scenes: camera angle, posture, visual elements.death_scene_rulesz:Rules for depicting children: always abstract silhouettes.child_rulesz?Rules for infected/zombie characters: color + posture, no gore.zombie_rulesz>Rules for shot variety and intercalation throughout the video.shot_intercalation_rulesr   N)r   r   r   r   __doc__r	   r)   __annotations__r*   listr.   r/   r0   r3   r4   r5   r6   r7   r8   r;   r<   r=   r>   r?   r   r   r   r   r%   r%   $   s   N"OPD#P %=!#  !&C!NI  $)F$y  $).$y 
 !XOS  #+s  aIs 
 "Tc 
 MM3  ',V
' 
 #(:#C 
 #Us  PK  UL#  %*T%c r   r%   c                     ] tR t^xt$ ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! R	R
R7      tR]R&   ]! RRRR7      t	R]R&   ]! RRRR7      t
R]R&   ]! RRRR7      tR]R&   ]! RRRR7      tR]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! R R!R7      tR]R"&   ]! RR#R$R%R&7      tR]R'&   ]! R(R)R7      tR]R*&   ]! R+R,R7      tR-]R.&   R/tR+# )0VoiceSettings
chatterboxz*TTS provider: 'chatterbox' or 'elevenlabs'r:   r(   tts_providerJBFqnCBsd6RMkjVDRZzbzElevenLabs voice IDvoice_ideleven_multilingual_v2zElevenLabs model IDmodel_idg      ?g        g      ?)r2   gelefloat	stabilityg      ?similarity_booststyleg       @speedptz5Language code for ChatterBox (e.g., 'pt', 'en', 'es')chatterbox_languager9   z4Path to reference audio for voice cloning (optional)chatterbox_voice_refopenaizTTS model: openai or elevenlabspollinations_modelnovazPollinations voice namepollinations_voiceg      ?g      @zSpeech speedr2   rK   rL   r'   pollinations_speedmp3z,Audio format: mp3, opus, aac, flac, wav, pcmpollinations_formatNz"Optional API key for higher limitsOptional[str]pollinations_api_keyr   )r   r   r   r   r	   rF   rA   rH   rJ   rN   rO   rP   rQ   rS   rT   rV   rX   rZ   r\   r^   r   r   r   r   rD   rD   x   s   l@lmL#m "8F[\Hc\":H]^Hc^SSS9Iu9#DSSAeA5E555E55  %T?vww %b>t u#u $HBcdd#F@YZZ %cdsP^ __$U@noo*/Jn*o-or   rD   c                      ] tR t^t$ ]! RR7      tR]R&   ]! ^R7      tR]R&   ]! RR7      tR]R&   ]! R	R7      t	R]R
&   Rt
R# )ExportSettings	1080x1920r1   r(   
resolutionintfpsmp4video_formatz9:16aspect_ratior   N)r   r   r   r   r	   rb   rA   rd   rf   rg   r   r   r   r   r`   r`      s>    K0J0R C e,L#,f-L#-r   r`   c                     ] tR t^t$ Rt]! RR7      tR]R&   ]! RR7      tR]R&   ]! R	R7      t	R]R
&   ]! RR7      t
R]R&   ]! RR7      tR]R&   ]! RRR7      tR]R&   ]! ^^^
RR7      tR]R&   ]! RRR7      tR]R&   RtR# )SceneAnalysisz7Output of the Script Analyzer agent for a single scene.z%Sequential scene number starting at 1r&   rc   scene_numberz(Physical setting / location of the scener(   environmentz8Character pose, body position and gesture for this scenepose_actionz"Emotional tone / mood of the scenemoodz0Exact narration text to be spoken for this scenenarration_textr9   z/Optional delivery notes (pace, emotion, pauses)r:   narration_noteszImportance score for coverage (1-10). Higher = more likely to get multi-angle coverage. 10=climax/action, 7-9=emotional intensity, 4-6=normal, 1-3=transition/expositionrY   coverage_priorityFzAI-determined: does this scene benefit from multi-angle coverage? True for action, emotion, climax. False for exposition, transition, static scenes.boolneeds_coverager   N)r   r   r   r   r@   r	   rj   rA   rk   rl   rm   rn   ro   rp   rr   r   r   r   r   ri   ri      s    A*QRL#R)STKTNK  "FGD#GFNC  !EOS  #[	s  !]ND r   ri   c                      ] tR t^t$ Rt]! RR7      tR]R&   ]! RR7      tR]R&   ]! R	R7      t	R
]R&   ]! RRR7      t
R]R&   RtR# )SceneBreakdownz-Complete output of the Script Analyzer agent.zShort title for the videor&   r(   titlezTotal number of scenesrc   total_sceneszOrdered list of sceneszlist[SceneAnalysis]scenesr9   zBrief summary of the storyr:   summaryr   N)r   r   r   r   r@   r	   ru   rA   rv   rw   rx   r   r   r   r   rt   rt      sH    7#>?E3?*BCL#C"'4L"MFM1MNGSNr   rt   c                     ] tR t^t$ Rt]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR7      t	R	]R
&   ]! RR7      t
R	]R&   ]! RR7      tR	]R&   ]! RR7      tR	]R&   ]! RR7      tR	]R&   ]! RR7      tR	]R&   ]! RR7      tR	]R&   ]! RR7      tR	]R&   ]! RRR7      tR	]R&   ]! RRR7      tR	]R&   ]! RRR7      tR	]R &   ]! R!R"R7      tR#]R$&   ]! ^ R%R7      tR]R&&   ]! RR'R7      tR	]R(&   R)tR!# )*Framez5A single visual frame expanded from a narrative beat.z,Global sequential frame number starting at 1r&   rc   frame_numberz0Which narrative beat/scene this frame belongs toparent_scenezCamera shot type: wide shot, medium shot, medium close-up, close-up, extreme close-up, low angle, high angle, dutch angle, POV, over-the-shoulder, tracking shot, establishing shotr(   camera_shotzfCamera movement: static, slow pan left/right, dolly forward/back, slight drift, tilt up/down, crane upcamera_movementznComposition: centered, rule of thirds left/right, foreground emphasis, background depth, symmetrical, diagonalcompositionz)Specific environment focus for this frameenvironment_detailz1Specific character pose and action for this framerl   z%Emotional tone of this specific framerm   z6What the viewer's eye should be drawn to in this framevisual_focusz6The narration text spoken during this frame's durationrn   r9   z)Delivery notes for this frame's narrationr:   ro   zExact word or short phrase (1-5 words) from the script that this frame represents. This is the editing anchor - the moment in the audio where this image should cut in.	sync_wordzIf the frame involves a body part, organ, or health condition, describe the anatomical highlight with color coding (e.g., 'lower back - red/orange glow for pain'). Leave empty if no anatomical highlight is needed.anatomical_highlightNzID grouping frames that show the same scene from different angles. Frames with the same coverage_group_id represent the same moment with different camera angles.r]   coverage_group_idzMIndex within coverage group: 0=master/wide, 1=medium, 2=close-up, 3+=variantscoverage_angle_indexzeType of coverage angle: 'master', 'medium', 'close-up', 'reverse', 'insert', or empty if not coveragecoverage_angle_typer   )r   r   r   r   r@   r	   r{   rA   r|   r}   r~   r   r   rl   rm   r   rn   ro   r   r   r   r   r   r   r   r   r   rz   rz      sy   ?*XYL#Y*\]L#]CK 
 !COS  GK  $?  GK  "IJD#JLL#   LNC  !?OS  _Is 
 !&<!#  (-i(} 
 !&c!#   %{  r   rz   c                  D    ] tR tRt$ RtR]R&   R]R&   R]R&   R]R	&   R
tR# )ExpandedFrameBreakdowni  u?   Output of the FrameExpander agent – all frames for the video.r(   ru   rx   rc   total_frameszlist[Frame]framesr   Nr   r   r   r   r@   rA   r   r   r   r   r   r     s    IJLr   r   c                  N   ] tR tRt$ RtR]R&   ]! RR7      tR]R&   ]! R	R7      tR]R
&   ]! RRR7      t	R]R&   ]! RRR7      t
R]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   ]! RRR7      tR]R&   RtR# )ScenePromptsi  z7Output of the Prompt Engineer agent for a single frame.rc   rj   zwFull standalone image generation prompt with complete character description, environment, pose, camera, lighting, styler&   r(   image_promptzyImage-to-video motion prompt describing character action joint-by-joint with kinetic chain, timing, and muscle visibilityvideo_promptr9   zjExact word or short phrase (1-5 words) from the script - the editing anchor where this image should cut inr:   r   z_Body part + real anatomical structure (e.g., 'quadriceps expanding with visible muscle fibers')r   z=Full clothing description for this scene (color, fabric, fit)clothing_descriptionz"Environment/setting for this scenerk   z<Emotional tone of this scene (e.g., confusion, relief, fear)emotional_tonezVNamed camera movement from library (e.g., 'SLOW PUSH IN', 'ORBIT', 'PULL BACK REVEAL')camera_movezDetailed character action joint-by-joint with kinetic chain, muscle visibility, timing in seconds, and transition to next scenecharacter_actionzaPhysical SFX for the scene (e.g., 'deep snow crunch per step, wood whistle'). NO music. NO voice.sound_effectsr   N)r   r   r   r   r@   rA   r	   r   r   r   r   r   rk   r   r   r   r   r   r   r   r   r   r     s   ALL#  KL#  <Is 
 !&u!#  !&S!#  8K   RNC 
 lK  "Mc 
 M3 r   r   c                  8    ] tR tRt$ Rt]! RR7      tR]R&   RtR# )	BatchScenePromptsiF  uP   Output of a batched PromptEngineer call — prompts for multiple frames at once.z+List of prompts, one per frame in the batchr&   list[ScenePrompts]rw   r   N)	r   r   r   r   r@   r	   rw   rA   r   r   r   r   r   r   F  s    Z!&A"F r   r   c                  &    ] tR tRt$ RtR]R&   RtR# )AllScenePromptsiN  z.Complete collection of prompts for all frames.r   rw   r   Nr   r   r   r   r   r   N  s    8r   r   c                  `    ] tR tRt$ RtR]R&   ]! RR7      tR]R&   ]! R	R
R7      tR]R&   Rt	R# )SceneTTSiT  z8Output of the TTS Scriptwriter agent for a single scene.rc   rj   z5Exact text to send to ElevenLabs for voice generationr&   r(   tts_textr9   z,Voice acting direction (tone, pace, emotion)r:   voice_directionr   N)
r   r   r   r   r@   rA   r	   r   r   r   r   r   r   r   r   T  s8    BKHc  !BOS r   r   c                  &    ] tR tRt$ RtR]R&   RtR# )AllSceneTTSia  z.Complete output of the TTS Scriptwriter agent.zlist[SceneTTS]rw   r   Nr   r   r   r   r   r   a  s    8r   r   c                      ] tR tRt$ RtR]R&   ]! RR7      tR]R&   ]! R	R7      tR]R
&   ]! RR7      t	R]R&   ]! RR7      t
R]R&   ]! RRR7      tR]R&   RtR# )SceneTimelineik  z"Timeline entry for a single scene.rc   rj   zStart time in MM:SS formatr&   r(   
time_startzEnd time in MM:SS formattime_endzDuration in secondsrM   duration_secondszExact cut point in MM:SS format	cut_pointzcrossfade 0.3szTransition type to next scener:   
transitionr   N)r   r   r   r   r@   rA   r	   r   r   r   r   r   r   r   r   r   r   r   k  sc    ,(DEJE&@AHcA#0EFeF'HIIsI 3J r   r   c                  L    ] tR tRt$ RtR]R&   ]! RR7      tR]R&   R	]R
&   RtR# )Timelineiy  z Complete timeline for the video.rM   total_duration_secondszTotal duration in MM:SSr&   r(   total_duration_formattedzlist[SceneTimeline]rw   r   N)	r   r   r   r   r@   rA   r	   r   r   r   r   r   r   r   y  s"    *!!$)6O$PcPr   r   c                     ] tR tRt$ RtR]R&   R]R&   R]R&   R]R	&   R]R
&   R]R&   R]R&   R]R&   R]R&   ]! RR7      tR]R&   ]! RR7      tR]R&   ]! RR7      t	R]R&   ]! RR7      t
R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   ]! RRR7      tR]R&   ]! RR R7      tR]R!&   ]! RR"R7      tR]R#&   ]! RR$R7      tR]R%&   ]! R&R'R7      tR(]R)&   ]! ^ R*R7      tR]R+&   ]! RR,R7      tR]R-&   R.tR&# )/ProductionScenei  z8A single frame with ALL production information combined.rc   rj   r(   r   r   rM   r   r   r   rk   rl   rm   zmedium shotr1   r}   staticr~   centeredr   r9   r   r   r   r   r   ro   z)Editing anchor word/phrase from narrationr:   r   zBody part + color if applicabler   zFull clothing descriptionr   zEmotional tone of this scener   NzAID grouping frames that show the same scene from different anglesr]   r   z;Index within coverage group: 0=master, 1=medium, 2=close-upr   z<Type of coverage angle: 'master', 'medium', 'close-up', etc.r   r   )r   r   r   r   r@   rA   r	   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s'   BOMNO
I]3K3 2OS2Z0K0b)L#)M23^_Is_ %b>_ `#` %b>Y Z#Z8VWNCW (-W(}  !&Q!#   %R  r   r   c                      ] tR tRt$ RtR]R&   R]R&   R]R&   R]R&   R	]R
&   R]R&   R]R&   R]R&   R]R&   R]R&   ]! ]RR7      tR]R&   Rt	R# )ProductionPlani  uB   The complete production plan – the final output of the pipeline.r(   ru   rx   r   rM   r   rc   rv   target_platformcharacter_template_namerD   voice_settingsr`   export_settingszlist[ProductionScene]rw   z5Step-by-step instructions to assemble the final videor+   r-   assembly_instructionsr   N)
r   r   r   r   r@   rA   r	   rB   r   r   r   r   r   r   r     sW    LJL!!!!  !!##!!',K(9 r   r   c                  H   ] tR tRt$ Rt]! RR7      tR]R&   ]! RRR	7      tR
]R&   ]! RRR	7      t	R]R&   ]! RRR	7      t
R
]R&   ]! RRR	7      tR
]R&   ]! RRR	7      tR]R&   ]! RRR	7      tR]R&   ]! RRR	7      tR]R&   ]! RRR	7      tR
]R&   ]! R RR7      tR]R &   R!tR# )"PipelineEventi  zAEvent emitted during pipeline execution for real-time UI updates.zeType of event: agent_start, agent_complete, agent_progress, image_generated, pipeline_complete, errorr&   r(   
event_typeNzAgent number 1-5r:   zOptional[int]agent_numberzHuman-readable agent namer]   
agent_namezCurrent progress countprogress_currentzTotal items to processprogress_totalr9   zHuman-readable status messagemessagezArbitrary event datazOptional[dict[str, Any]]datazBase64-encoded generated imageimage_base64zScene number for imageimage_scene_numberc                 	f    \         P                  ! \        P                  4      P	                  4       # )N)r   nowr   utc	isoformatr   r   r   <lambda>PipelineEvent.<lambda>  s    X\\ : D D Fr   zISO 8601 timestampr+   	timestampr   )r   r   r   r   r@   r	   r   rA   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s    K4J  #(BT"UL-U %d@[ \J\&+DF^&_m_$)$D\$]NM]1PQGSQ%*4E[%\D
"\"'Bb"cL-c(-dH`(aaF(Is r   r   c                     ] tR tRt$ Rt]P                  tR]R&   ]	! RR7      t
R]R&   ]P                  tR	]R
&   RtR]R&   ]	! ]R7      tR]R&   ]	! ]R7      tR]R&   ]	! RR7      tR]R&   ]	! RRR7      tR]R&   ]	! RRR7      tR]R&   ]	! RRR7      tR]R&   ]	! ^R R7      tR!]R"&   ]	! R#R$R7      tR%]R&&   ]	! ^^^R'R(7      tR!]R)&   ]	! R*R+R7      tR]R,&   R-tR# ).PipelineConfigi  z'Runtime configuration for the pipeline.r   modezopenai/gpt-4or1   r(   	llm_modelr   r   NzOptional[CharacterTemplate]character_template)r,   rD   r   r`   r   output
output_dirg      @z:Words per second for duration estimation (default 150 wpm)r:   rM   speaking_rate_wpsg      @z!Minimum scene duration in secondsmin_scene_durationg333333?z-Transition duration between scenes in secondstransition_durationz1Target number of image frames per minute of videorc   frames_per_minuteFz?Generate multiple camera angles for each scene (coverage shots)rq   enable_coverage_shotsz3Number of camera angles to generate per scene (2-5)rY   coverage_angles_per_sceneallzECoverage mode: 'all' (every scene) or 'smart' (AI decides key scenes)coverage_moder   )r   r   r   r   r@   r   r!   r   rA   r	   r   r   r   r   r   rD   r   r`   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s&   1%**D,*?3Is3&4&;&;O^;6:3:$)-$HNMH&+N&KO^KH-J-$P u  !&7!  "'C"  #Gs  #(U#4  &+I	&s  [M3 r   r   N)"r@   
__future__r   r   r   enumr   typingr   r   pydanticr   r	   r(   r   r   r%   rD   r`   ri   rt   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s  
 # '    %S$ 3 M	 MhpI p0.Y .I @OY O<I <~Y /9 /d	 i 
y 
) I  y  &i &RY 6I 2)Y )r   