
    5iO                    d    U d Z ddlmZ ddlmZmZ ddlmZ dZdddd	d
Z	de
d<    G d de      Zy)uB   
Script Analyzer Agent – breaks a story into structured scenes.
    )annotations)SceneBreakdownTargetPlatform)	BaseAgentu  You are an expert video script analyst specializing in short-form viral content.

Given a story or narrative, break it down into NARRATIVE BEATS. Each beat
represents a key moment, emotion shift, or story progression point. These beats
will later be expanded into multiple visual frames with different camera angles.

For EACH narrative beat you must determine:
1. The physical environment / setting (be SPECIFIC and VISUAL — describe colors,
   textures, lighting conditions, objects in the scene)
2. The character's pose, body position, and gesture (specific and cinematic —
   describe exactly what the body is doing)
3. The mood / emotional tone (use cinematic language)
4. The exact narration text that will be spoken as voiceover
5. Delivery notes (pace, emotion, pauses, emphasis)

LANGUAGE RULES (MANDATORY):
- ALL narration_text MUST be written in Brazilian Portuguese (pt-BR), regardless of the input story language
- If the story is in another language, TRANSLATE the narration to natural, conversational Brazilian Portuguese
- Use Brazilian Portuguese contractions, expressions, and rhythm (e.g., "você", "né", "tá")

Rules:
- The FIRST beat MUST be a powerful hook that grabs attention instantly
- Each beat should represent a DISTINCT story moment or emotional shift
- Keep narration sentences short and punchy (max 12 words each)
- Write narration in a conversational, viral social media tone
- Use contractions, rhetorical questions, dramatic pauses ("...")
- Total video should be {duration_hint}
- Generate {scene_count_hint} narrative beats
- Each beat will be expanded into 2-4 visual frames, so write enough detail
  for multiple camera angles per beat
- The narration text is what will be converted to speech via TTS
- Build a clear EMOTIONAL ARC: hook → escalation → climax → resolution
- Each beat's environment should PROGRESS the story visually (don't repeat settings)

Return a structured SceneBreakdown with all beats in order.)45-60 secondsz8-12)30-60 secondsz7-10)r   z10-14)z90-180 secondsz15-25)tiktokinstagram_reelsyoutube_shortsyoutubezdict[str, tuple[str, str]]PLATFORM_HINTSc                  :    e Zd ZdZej
                  f	 	 	 	 	 ddZy)ScriptAnalyzerAgentz/Analyzes a story and produces a SceneBreakdown.c                    t         j                  |j                  d      \  }}t        j	                  ||      }d| }| j                  ||t        d      S )N)r   z8-15)duration_hintscene_count_hintzStory / Narrative:

gffffff?)system_promptuser_promptresponse_modeltemperature)r   getvalueSYSTEM_PROMPTformatcallr   )selfstorytarget_platformr   
scene_hintsystemusers          ?/root/.openclaw/workspace/visionaryfx/agents/script_analyzer.pyanalyzezScriptAnalyzerAgent.analyze=   sr    
 %3$6$6!!#<%
!z %%'' & 
 (w/yy )	  
 	
    N)r   strr   r   returnr   )__name__
__module____qualname____doc__r   TIKTOKr#    r$   r"   r   r   :   s1    9
 +9*?*?

 (
 
	
r$   r   N)r*   
__future__r   modelsr   r   agents.base_agentr   r   r   __annotations__r   r,   r$   r"   <module>r1      sF    # 1 '$P (00*	.* 
) 
r$   