
    5i	                    J    d Z ddlmZ ddlmZmZ ddlmZ dZ G d de      Z	y)	uL   
TTS Scriptwriter Agent – refines narration text for ElevenLabs delivery.
    )annotations)AllSceneTTSSceneBreakdown)	BaseAgentu  You are an expert voiceover scriptwriter for short-form viral video content.

You will receive a list of scenes, each with draft narration text. Your job is to
produce the EXACT text that will be sent to ElevenLabs text-to-speech API.

For EACH scene, output:
1. tts_text – the final narration text, polished for spoken delivery
2. voice_direction – acting notes (tone, pace, emotion, pauses)

Rules for tts_text:
• The tts_text MUST be in Brazilian Portuguese (pt-BR) — non-negotiable
• Use natural Brazilian Portuguese speech patterns, contractions, and expressions
• Even if the input narration is in another language, adapt to fluent pt-BR
• Write as a Brazilian would naturally speak — not formal/literary Portuguese
• Write for the EAR, not the eye – use contractions, natural rhythm
• Short sentences (max 15 words)
• Use "..." for natural pauses (ElevenLabs interprets these as brief pauses)
• Use ALL CAPS sparingly for emphasis on key words
• No stage directions or brackets in the tts_text – those go in voice_direction
• The text must sound conversational and engaging when spoken aloud
• Maintain the emotional arc of the story across scenes
• The first scene must HOOK the listener immediately

Rules for voice_direction:
• Describe the tone (e.g., "whispered, intimate", "urgent, fast-paced")
• Note any pacing changes ("slow down here", "build intensity")
• Indicate emotional state ("melancholic", "hopeful", "shocked")
• These directions are for the human operator, NOT sent to ElevenLabsc                      e Zd ZdZddZy)TTSScriptwriterAgentz4Refines narration into production-ready TTS scripts.c                    dj                  d |j                  D              }d| }| j                  t        |t        dd      S )N
c              3     K   | ]G  }d |j                    d|j                   d|j                   d|j                   d|j                   
 I yw)zScene z:
  Environment: z	
  Mood: z
  Draft narration: z

  Notes: N)scene_numberenvironmentmoodnarration_textnarration_notes).0ss     @/root/.openclaw/workspace/visionaryfx/agents/tts_scriptwriter.py	<genexpr>z0TTSScriptwriterAgent.generate.<locals>.<genexpr>/   sf       
  Q^^$ %mm_ -vvh ""#"2"2!3 4))*	, 
s   AAz	SCENES:

gffffff?i @  )system_promptuser_promptresponse_modeltemperature
max_tokens)joinscenescallSYSTEM_PROMPTr   )self	breakdownscenes_textusers       r   generatezTTSScriptwriterAgent.generate.   sX    ii  
 %% 
 
 [M*yy'&  
 	
    N)r   r   returnr   )__name__
__module____qualname____doc__r"    r#   r   r   r   +   s
    >
r#   r   N)
r(   
__future__r   modelsr   r   agents.base_agentr   r   r   r)   r#   r   <module>r-      s)    # . '@
9 
r#   