| | """ |
| | Prompt content and section builders for the ad generator. |
| | Keeps long copy-prompt strings out of the main generator class. |
| | """ |
| |
|
| | from typing import Dict, Any, Optional |
| |
|
| | |
| | |
| | |
| |
|
| | HEADLINE_FORMULAS_WEIGHT_LOSS = """=== HEADLINE FORMULAS (WEIGHT LOSS) - use as inspiration === |
| | |
| | WITH NUMBERS: THE TRANSFORMATION ("Lost 47 lbs In 90 Days") | THE BEFORE/AFTER ("From 247 to 168 lbs") |
| | WITHOUT NUMBERS: THE ACCUSATION ("Still Overweight?") | CURIOSITY GAP ("Thousands Are Losing Weight After THIS") | IDENTITY CALLOUT ("Women Over 40: This Changes Everything") | MEDICAL AUTHORITY ("FDA-Approved Weight Loss")""" |
| |
|
| | HEADLINE_FORMULAS_AUTO_INSURANCE = """=== HEADLINE FORMULAS (AUTO INSURANCE) - use as inspiration === |
| | |
| | WITH NUMBERS: PRICE ANCHOR ("Car Insurance for as low as $29/month") | BEFORE/AFTER ("WAS: $1,842 → NOW: $647") |
| | WITHOUT NUMBERS: ACCUSATION ("Still Overpaying?") | CURIOSITY GAP ("Drivers Are Ditching Their Auto Insurance & Doing This Instead") | IDENTITY ("Drivers Over 50: Check Your Eligibility") | AUTHORITY ("Official: Safe Drivers Qualify") | EMOTIONAL ("Protect What Matters Most")""" |
| |
|
| | HEADLINE_FORMULAS_HOME_INSURANCE = """=== HEADLINE FORMULAS (HOME INSURANCE) - use as inspiration === |
| | |
| | WITH NUMBERS: PRICE ANCHOR ("Home Insurance for as low as $97.33/month") | BEFORE/AFTER ("WAS: $1,701 → NOW: $583") |
| | WITHOUT NUMBERS: ACCUSATION ("Still Underinsured?") | CURIOSITY GAP ("Seniors Are Ditching Home Insurance & Doing This Instead") | IDENTITY ("Homeowners Over 50: Check Your Eligibility") | AUTHORITY ("State Program Cuts Costs") | EMOTIONAL ("Protect What Matters Most")""" |
| |
|
| |
|
| | def get_headline_formulas(niche: str, num_type: str) -> str: |
| | """Return the headline formulas block for the given niche and number type. |
| | Use as inspiration only; the generator may invent new scroll-stopping or clickbait headlines without restriction.""" |
| | if num_type == "weight_loss": |
| | return HEADLINE_FORMULAS_WEIGHT_LOSS |
| | if niche == "auto_insurance": |
| | return HEADLINE_FORMULAS_AUTO_INSURANCE |
| | return HEADLINE_FORMULAS_HOME_INSURANCE |
| |
|
| |
|
| | def get_numbers_section( |
| | niche: str, |
| | num_type: str, |
| | niche_numbers: Dict[str, str], |
| | age_bracket: Dict[str, str], |
| | price_guidance: str, |
| | ) -> str: |
| | """Build the numbers guidance section for the copy prompt.""" |
| | if num_type == "weight_loss": |
| | return f"""=== NUMBERS GUIDANCE (WEIGHT LOSS) === |
| | You may include specific numbers if they enhance the ad's believability and fit the format: |
| | - Starting Weight: {niche_numbers['before']} |
| | - Current Weight: {niche_numbers['after']} |
| | - Total Lost: {niche_numbers['difference']} |
| | - Timeframe: {niche_numbers['days']} |
| | - Sizes Dropped: {niche_numbers['sizes']} |
| | - Target Age Bracket: {age_bracket['label']} |
| | |
| | DECISION: You decide whether to include these numbers based on: |
| | - The psychological angle (some angles work better with numbers, others without) |
| | - The psychological strategy (some strategies benefit from specificity, others from emotional appeal) |
| | - The overall message flow |
| | |
| | If including numbers: Use them naturally and make them oddly specific (e.g., "47 lbs" not "50 lbs") for believability. |
| | If NOT including numbers: Focus on emotional transformation, lifestyle benefits, and outcomes without specific metrics.""" |
| |
|
| | niche_label = niche.replace("_", " ").upper() |
| | return f"""=== NUMBERS GUIDANCE ({niche_label}) === |
| | You may include specific prices/numbers if they enhance the ad's believability and fit the format: |
| | - Price Guidance: {price_guidance} |
| | - Before Price: {niche_numbers['before']} |
| | - After Price: {niche_numbers['after']} |
| | - Total Saved: {niche_numbers['difference']}/year |
| | - Target Age Bracket: {age_bracket['label']} |
| | |
| | DECISION: You decide whether to include prices/numbers based on: |
| | - The psychological angle (some angles benefit from prices, others may not) |
| | - The psychological strategy (some strategies need specificity, others work better emotionally) |
| | - The overall message flow and what feels most authentic |
| | |
| | If including prices: Use oddly specific amounts (e.g., "$97.33/month" not "$100/month") for maximum believability. |
| | If NOT including prices: Focus on emotional benefits, problem-solution framing, curiosity gaps, and trust without specific dollar amounts.""" |
| |
|
| |
|
| | def get_trending_section(trending_context: Optional[str]) -> str: |
| | """Build the trending topics section when context is provided.""" |
| | if not trending_context: |
| | return "" |
| | return f""" |
| | === TRENDING TOPICS CONTEXT (INCORPORATE THIS!) === |
| | Current Trend: {trending_context} |
| | |
| | INSTRUCTIONS FOR USING TRENDING TOPICS: |
| | - Subtly reference or tie the ad message to this trending topic |
| | - Make the connection feel natural, not forced |
| | - Use the trend to create urgency or relevance ("Everyone's talking about...") |
| | - The trend should enhance the hook, not overshadow the core message |
| | - Examples: |
| | * "With [trend], now is the perfect time to..." |
| | * "While everyone's focused on [trend], don't forget about..." |
| | * "Just like [trend], your [product benefit]..." |
| | * Reference the trend indirectly in the hook or primary text |
| | |
| | NOTE: The trend adds timeliness and relevance. Use it strategically! |
| | """ |
| |
|
| |
|
| | def get_trending_image_guidance(trending_context: Optional[str]) -> str: |
| | """Build image-prompt guidance so visuals reflect the current occasion. Returns empty string if no context.""" |
| | if not trending_context or not trending_context.strip(): |
| | return "" |
| | return f""" |
| | === CURRENT OCCASION (reflect in mood and atmosphere) === |
| | Occasion: {trending_context.strip()} |
| | |
| | - Align the image mood and atmosphere with this occasion (e.g. warm and thoughtful for Valentine's/gifts, cozy for holidays, fresh for New Year). |
| | - Use subtle visual cues: lighting, color warmth, and setting that feel timely and relevant, without literal props unless they fit the ad (e.g. no forced teddy bears or hearts unless the scene naturally calls for it). |
| | - The image should feel "of the moment" and relevant to the trend, not generic. |
| | """ |
| |
|