Spaces:
Sleeping
Sleeping
Update prompts.py
Browse files- prompts.py +93 -109
prompts.py
CHANGED
@@ -1,110 +1,94 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
-
|
6 |
-
-
|
7 |
-
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
-
|
13 |
-
-
|
14 |
-
"""
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
{
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
""
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
-
|
65 |
-
-
|
66 |
-
-
|
67 |
-
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
-
|
73 |
-
-
|
74 |
-
-
|
75 |
-
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
""
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
if selected_angle["description"] != "Generate the bullet without any specific angle":
|
95 |
-
angle_instruction = f"\nApply this angle: {selected_angle['description']}\nStyle: {selected_angle['style']}\nUse these keywords as inspiration: {', '.join(selected_angle['keywords'])}"
|
96 |
-
|
97 |
-
return (
|
98 |
-
f"{system_prompt}\n\n"
|
99 |
-
f"Your task is to create {number_of_benefits} irresistible promises designed for {target_audience}. "
|
100 |
-
f"The goal is to show how {product} will transform the reader's life, connecting naturally and emotionally. "
|
101 |
-
f"Avoid using literal or repetitive mentions, and highlight concrete results, showing how the product delivers specific outcomes or satisfies real desires. "
|
102 |
-
f"{angle_instruction}\n"
|
103 |
-
f"IMPORTANT: Keep promises clear, specific and credible. "
|
104 |
-
f"Use the selected formula as a guide:\n\n{selected_formula['description']}\n\n"
|
105 |
-
f"Get inspired by these examples:\n"
|
106 |
-
f"- {selected_formula['examples'][0]}\n"
|
107 |
-
f"- {selected_formula['examples'][1]}\n"
|
108 |
-
f"- {selected_formula['examples'][2]}\n\n"
|
109 |
-
f"Your goal is to inspire confidence and action, avoiding explanations or categories in the response."
|
110 |
)
|
|
|
1 |
+
# Define a unified system prompt for copywriting tasks
|
2 |
+
system_prompt = """You are a world-class expert copywriter, experienced in creating compelling content that connects emotionally with the target audience.
|
3 |
+
|
4 |
+
OBJECTIVE:
|
5 |
+
- Generate convincing content in Spanish
|
6 |
+
- Connect emotionally with the audience
|
7 |
+
- Address real desires, problems, and motivations
|
8 |
+
- Maintain natural and conversational language
|
9 |
+
- Orient content towards transformation and results
|
10 |
+
|
11 |
+
CRITICAL OUTPUT RULES:
|
12 |
+
- Output ONLY the requested content with NO introductory text, explanations, or additional commentary
|
13 |
+
- Start directly with the content
|
14 |
+
- Do not include phrases like "Aquí tienes..." or "Esta es tu..."
|
15 |
+
- Follow the specified format and structure exactly
|
16 |
+
"""
|
17 |
+
|
18 |
+
def create_offer_instruction(avatar_description, product_name, selected_formula_name, offer_formulas=None):
|
19 |
+
"""
|
20 |
+
Creates instructions for generating an offer based on the selected formula.
|
21 |
+
"""
|
22 |
+
# Get the selected formula
|
23 |
+
selected_formula = offer_formulas[selected_formula_name]
|
24 |
+
|
25 |
+
# Get custom instructions from the formula dictionary
|
26 |
+
additional_instructions = selected_formula.get("custom_instructions", "")
|
27 |
+
|
28 |
+
# Create the instruction using the system prompt at the beginning
|
29 |
+
instruction = f"""{system_prompt}
|
30 |
+
|
31 |
+
CONTENT TYPE: OFFER
|
32 |
+
|
33 |
+
FORMULA TO USE:
|
34 |
+
{selected_formula["description"]}
|
35 |
+
|
36 |
+
{additional_instructions}
|
37 |
+
|
38 |
+
PRODUCT/SERVICE:
|
39 |
+
{product_name}
|
40 |
+
|
41 |
+
TARGET AUDIENCE:
|
42 |
+
{avatar_description}
|
43 |
+
|
44 |
+
Create a compelling offer following the formula structure exactly.
|
45 |
+
"""
|
46 |
+
|
47 |
+
# Add examples if available
|
48 |
+
if selected_formula.get("examples") and len(selected_formula["examples"]) > 0:
|
49 |
+
examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"][:3])])
|
50 |
+
instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
|
51 |
+
|
52 |
+
return instruction
|
53 |
+
|
54 |
+
def create_promise_instruction(number_of_promises, target_audience, product, selected_formula, selected_angle):
|
55 |
+
"""
|
56 |
+
Creates instructions for generating promises based on the selected formula and angle.
|
57 |
+
"""
|
58 |
+
angle_instruction = ""
|
59 |
+
if selected_angle["description"] != "Generate the bullet without any specific angle":
|
60 |
+
angle_instruction = f"\nApply this angle: {selected_angle['description']}\nStyle: {selected_angle['style']}\nUse these keywords as inspiration: {', '.join(selected_angle['keywords'])}"
|
61 |
+
|
62 |
+
format_rules = """
|
63 |
+
FORMAT RULES:
|
64 |
+
- One promise per line
|
65 |
+
- No numbers at the beginning
|
66 |
+
- No explanations or categories
|
67 |
+
- Add a line break between each promise
|
68 |
+
- Never include : symbols in promises
|
69 |
+
- Each promise must be a complete and concise phrase
|
70 |
+
|
71 |
+
PROMISE STRUCTURE:
|
72 |
+
- Must be relevant to target audience
|
73 |
+
- Must show a specific, measurable result
|
74 |
+
- Must include an emotional element
|
75 |
+
- Must eliminate an objection or pain point
|
76 |
+
- Must inspire immediate action or belief
|
77 |
+
"""
|
78 |
+
|
79 |
+
return (
|
80 |
+
f"{system_prompt}\n\n"
|
81 |
+
f"CONTENT TYPE: PROMISES\n\n"
|
82 |
+
f"{format_rules}\n\n"
|
83 |
+
f"Your task is to create {number_of_promises} irresistible promises designed for {target_audience}. "
|
84 |
+
f"The goal is to show how {product} will transform the reader's life, connecting naturally and emotionally. "
|
85 |
+
f"Avoid using literal or repetitive mentions, and highlight concrete results, showing how the product delivers specific outcomes or satisfies real desires. "
|
86 |
+
f"{angle_instruction}\n"
|
87 |
+
f"IMPORTANT: Keep promises clear, specific and credible. "
|
88 |
+
f"Use the selected formula as a guide:\n\n{selected_formula['description']}\n\n"
|
89 |
+
f"Get inspired by these examples:\n"
|
90 |
+
f"- {selected_formula['examples'][0]}\n"
|
91 |
+
f"- {selected_formula['examples'][1]}\n"
|
92 |
+
f"- {selected_formula['examples'][2]}\n\n"
|
93 |
+
f"Your goal is to inspire confidence and action, avoiding explanations or categories in the response."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
)
|