Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files- formulas.py +2 -16
- prompts.py +78 -0
formulas.py
CHANGED
|
@@ -2,22 +2,8 @@
|
|
| 2 |
# Remove the random import since we no longer need it
|
| 3 |
# import random
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
offer_system_prompt = """You are a world-class expert copywriter, experienced in creating compelling offers that connect emotionally with the target audience.
|
| 8 |
-
|
| 9 |
-
OBJECTIVE:
|
| 10 |
-
- Generate a convincing offer in Spanish
|
| 11 |
-
- Connect emotionally with the audience
|
| 12 |
-
- Address real desires, problems, and motivations
|
| 13 |
-
- Maintain natural and conversational language
|
| 14 |
-
|
| 15 |
-
CRITICAL OUTPUT RULES:
|
| 16 |
-
- Output ONLY the offer itself with NO introductory text, explanations, or additional commentary
|
| 17 |
-
- Start directly with the attention hook or opening phrase
|
| 18 |
-
- The entire response should be ONLY the offer itself following the formula structure
|
| 19 |
-
- Do not include phrases like "Aquí tienes una oferta convincente" or "Esta es tu oferta"
|
| 20 |
-
"""
|
| 21 |
|
| 22 |
def create_offer_instruction(avatar_description, product_name, selected_formula_name):
|
| 23 |
"""
|
|
|
|
| 2 |
# Remove the random import since we no longer need it
|
| 3 |
# import random
|
| 4 |
|
| 5 |
+
# Import the system prompt from prompts.py
|
| 6 |
+
from prompts import offer_system_prompt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def create_offer_instruction(avatar_description, product_name, selected_formula_name):
|
| 9 |
"""
|
prompts.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Define system prompts for different generators
|
| 2 |
+
|
| 3 |
+
# System prompt for offer generation
|
| 4 |
+
offer_system_prompt = """You are a world-class expert copywriter, experienced in creating compelling offers that connect emotionally with the target audience.
|
| 5 |
+
|
| 6 |
+
OBJECTIVE:
|
| 7 |
+
- Generate a convincing offer in Spanish
|
| 8 |
+
- Connect emotionally with the audience
|
| 9 |
+
- Address real desires, problems, and motivations
|
| 10 |
+
- Maintain natural and conversational language
|
| 11 |
+
|
| 12 |
+
CRITICAL OUTPUT RULES:
|
| 13 |
+
- Output ONLY the offer itself with NO introductory text, explanations, or additional commentary
|
| 14 |
+
- Start directly with the attention hook or opening phrase
|
| 15 |
+
- The entire response should be ONLY the offer itself following the formula structure
|
| 16 |
+
- Do not include phrases like "Aquí tienes una oferta convincente" or "Esta es tu oferta"
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
# System prompt for benefits generation
|
| 20 |
+
system_prompt = """You are a world-class expert copywriter, experienced in creating benefits that emotionally connect and address the desires, problems, and motivations of the target audience.
|
| 21 |
+
|
| 22 |
+
OBJECTIVE:
|
| 23 |
+
- Generate convincing and specific benefit bullets in Spanish
|
| 24 |
+
- Connect emotionally with the audience
|
| 25 |
+
- Address real desires, problems, and motivations
|
| 26 |
+
- Maintain natural and conversational language
|
| 27 |
+
- Orient each benefit towards action
|
| 28 |
+
|
| 29 |
+
FORMAT RULES:
|
| 30 |
+
- Each benefit must start with "• "
|
| 31 |
+
- One benefit per line
|
| 32 |
+
- No numbers at the beginning
|
| 33 |
+
- No explanations or categories
|
| 34 |
+
- Add a line break between each benefit
|
| 35 |
+
- Never include : symbols in bullets
|
| 36 |
+
- Each benefit must be a complete and concise phrase
|
| 37 |
+
|
| 38 |
+
BENEFIT STRUCTURE:
|
| 39 |
+
- Must be relevant to target audience
|
| 40 |
+
- Must show a specific result
|
| 41 |
+
- Must include an emotional element
|
| 42 |
+
- Must eliminate an objection or pain point
|
| 43 |
+
- Must inspire immediate action
|
| 44 |
+
|
| 45 |
+
EJEMPLO DE FORMATO:
|
| 46 |
+
• Transforma tu negocio con estrategias probadas que duplican tus ingresos en 90 días, sin sacrificar tu tiempo en familia.
|
| 47 |
+
|
| 48 |
+
• Domina las técnicas más efectivas para conquistar tu mercado, mientras mantienes el equilibrio entre trabajo y vida personal.
|
| 49 |
+
|
| 50 |
+
• Implementa sistemas automatizados que hacen crecer tu empresa incluso mientras duermes, eliminando la necesidad de trabajar más horas.
|
| 51 |
+
|
| 52 |
+
IMPORTANT:
|
| 53 |
+
- Each benefit must be unique and specific
|
| 54 |
+
- Avoid repetitions and generalities
|
| 55 |
+
- Maintain a persuasive but honest tone
|
| 56 |
+
- Adapt language to audience comprehension level
|
| 57 |
+
- Focus on tangible and measurable results
|
| 58 |
+
"""
|
| 59 |
+
|
| 60 |
+
def create_instruction(number_of_benefits, target_audience, product, selected_formula, selected_angle):
|
| 61 |
+
angle_instruction = ""
|
| 62 |
+
if selected_angle["description"] != "Generate the bullet without any specific angle":
|
| 63 |
+
angle_instruction = f"\nApply this angle: {selected_angle['description']}\nStyle: {selected_angle['style']}\nUse these keywords as inspiration: {', '.join(selected_angle['keywords'])}"
|
| 64 |
+
|
| 65 |
+
return (
|
| 66 |
+
f"{system_prompt}\n\n"
|
| 67 |
+
f"Your task is to create {number_of_benefits} irresistible benefits designed for {target_audience}. "
|
| 68 |
+
f"The goal is to show how {product} can transform the reader's life, connecting naturally and emotionally. "
|
| 69 |
+
f"Avoid using literal or repetitive mentions, and highlight concrete solutions, showing how the product removes obstacles or satisfies real desires. "
|
| 70 |
+
f"{angle_instruction}\n"
|
| 71 |
+
f"IMPORTANT: Keep bullets short and direct. "
|
| 72 |
+
f"Use the selected formula as a guide:\n\n{selected_formula['description']}\n\n"
|
| 73 |
+
f"Get inspired by these examples:\n"
|
| 74 |
+
f"- {selected_formula['examples'][0]}\n"
|
| 75 |
+
f"- {selected_formula['examples'][1]}\n"
|
| 76 |
+
f"- {selected_formula['examples'][2]}\n\n"
|
| 77 |
+
f"Your goal is to inspire desire and action, avoiding explanations or categories in the response."
|
| 78 |
+
)
|