JeCabrera commited on
Commit
bf165e3
·
verified ·
1 Parent(s): a905d89

Update prompts.py

Browse files
Files changed (1) hide show
  1. prompts.py +91 -94
prompts.py CHANGED
@@ -1,94 +1,91 @@
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
- )
 
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
+ + '\n'.join([f"- {example}" for example in selected_formula['examples']]) + "\n\n"
91
+ f"Your goal is to inspire confidence and action, avoiding explanations or categories in the response."