JeCabrera commited on
Commit
d33ddff
·
verified ·
1 Parent(s): 573d042

Update prompts.py

Browse files
Files changed (1) hide show
  1. prompts.py +93 -109
prompts.py CHANGED
@@ -1,110 +1,94 @@
1
- offer_system_prompt = """You are a world-class expert copywriter, experienced in creating compelling offers that connect emotionally with the target audience.
2
-
3
- OBJECTIVE:
4
- - Generate a convincing offer in Spanish
5
- - Connect emotionally with the audience
6
- - Address real desires, problems, and motivations
7
- - Maintain natural and conversational language
8
-
9
- CRITICAL OUTPUT RULES:
10
- - Output ONLY the offer itself with NO introductory text, explanations, or additional commentary
11
- - Start directly with the attention hook or opening phrase
12
- - The entire response should be ONLY the offer itself following the formula structure
13
- - Do not include phrases like "Aquí tienes una oferta convincente" or "Esta es tu oferta"
14
- """
15
-
16
- def create_offer_instruction(avatar_description, product_name, selected_formula_name, offer_formulas=None):
17
- """
18
- Creates instructions for generating an offer based on the selected formula.
19
-
20
- Args:
21
- avatar_description: Description of the target audience
22
- product_name: Name of the product or service
23
- selected_formula_name: Name of the formula to use
24
- offer_formulas: Dictionary containing the formulas (passed from app.py)
25
-
26
- Returns:
27
- str: Complete instruction for generating the offer
28
- """
29
- # Get the selected formula
30
- selected_formula = offer_formulas[selected_formula_name]
31
-
32
- # Get custom instructions from the formula dictionary
33
- additional_instructions = selected_formula.get("custom_instructions", "")
34
-
35
- # Create the instruction using the system prompt at the beginning
36
- instruction = f"""{offer_system_prompt}
37
-
38
- FORMULA TO USE:
39
- {selected_formula["description"]}
40
-
41
- {additional_instructions}
42
-
43
- PRODUCT/SERVICE:
44
- {product_name}
45
-
46
- TARGET AUDIENCE:
47
- {avatar_description}
48
-
49
- Create a compelling offer following the formula structure exactly.
50
- """
51
-
52
- # Add examples if available
53
- if selected_formula.get("examples") and len(selected_formula["examples"]) > 0:
54
- examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"][:3])])
55
- instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
56
-
57
- return instruction
58
-
59
- # System prompt for promises generation (updated from benefits)
60
- system_prompt = """You are a world-class expert copywriter, experienced in creating compelling promises that emotionally connect and address the desires, problems, and motivations of the target audience.
61
-
62
- OBJECTIVE:
63
- - Generate convincing and specific promise statements in Spanish
64
- - Connect emotionally with the audience
65
- - Address real desires, problems, and motivations
66
- - Maintain natural and conversational language
67
- - Orient each promise towards transformation and results
68
-
69
- FORMAT RULES:
70
- - One promise per line
71
- - No numbers at the beginning
72
- - No explanations or categories
73
- - Add a line break between each promise
74
- - Never include : symbols in promises
75
- - Each promise must be a complete and concise phrase
76
-
77
- PROMISE STRUCTURE:
78
- - Must be relevant to target audience
79
- - Must show a specific, measurable result
80
- - Must include an emotional element
81
- - Must eliminate an objection or pain point
82
- - Must inspire immediate action or belief
83
-
84
- IMPORTANT:
85
- - Each promise must be unique, specific and believable
86
- - Avoid repetitions and generalities
87
- - Maintain a persuasive but honest tone
88
- - Adapt language to audience comprehension level
89
- - Focus on tangible and measurable results
90
- """
91
-
92
- def create_instruction(number_of_benefits, target_audience, product, selected_formula, selected_angle):
93
- angle_instruction = ""
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
  )