Spaces:
Running
Running
Update prompts.py
Browse files- prompts.py +44 -4
prompts.py
CHANGED
@@ -17,15 +17,20 @@ CRITICAL OUTPUT RULES:
|
|
17 |
- Do not add any characters that could trigger text box formatting
|
18 |
"""
|
19 |
|
20 |
-
def create_offer_instruction(target_audience, product_name, selected_formula_name, file_content=
|
21 |
"""
|
22 |
-
Creates
|
23 |
|
24 |
Args:
|
25 |
target_audience: Description of the target audience
|
26 |
product_name: Name of the product or service
|
27 |
-
selected_formula_name: Name of the formula
|
28 |
-
file_content:
|
|
|
|
|
|
|
|
|
|
|
29 |
"""
|
30 |
# Get the selected formula
|
31 |
selected_formula = offer_formulas[selected_formula_name]
|
@@ -58,4 +63,39 @@ Create a compelling offer following the formula structure exactly.
|
|
58 |
examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"])])
|
59 |
instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
return instruction
|
|
|
17 |
- Do not add any characters that could trigger text box formatting
|
18 |
"""
|
19 |
|
20 |
+
def create_offer_instruction(target_audience=None, product_name=None, selected_formula_name=None, file_content=None, skills=None, sophistication_level=None):
|
21 |
"""
|
22 |
+
Creates the instruction for generating an offer based on the selected formula.
|
23 |
|
24 |
Args:
|
25 |
target_audience: Description of the target audience
|
26 |
product_name: Name of the product or service
|
27 |
+
selected_formula_name: Name of the selected formula
|
28 |
+
file_content: Content from uploaded files (if any)
|
29 |
+
skills: User's skills and expertise
|
30 |
+
sophistication_level: Dictionary containing market sophistication level info
|
31 |
+
|
32 |
+
Returns:
|
33 |
+
str: The complete instruction for generating the offer
|
34 |
"""
|
35 |
# Get the selected formula
|
36 |
selected_formula = offer_formulas[selected_formula_name]
|
|
|
63 |
examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"])])
|
64 |
instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
|
65 |
|
66 |
+
# Add sophistication level guidance
|
67 |
+
sophistication_guidance = ""
|
68 |
+
if sophistication_level:
|
69 |
+
sophistication_guidance = f"""
|
70 |
+
NIVEL DE SOFISTICACI脫N DEL MERCADO: {sophistication_level.get('description', '')}
|
71 |
+
|
72 |
+
ESTRATEGIA A APLICAR: {sophistication_level.get('strategy', '')}
|
73 |
+
|
74 |
+
EJEMPLO DE REFERENCIA: {sophistication_level.get('example', '')}
|
75 |
+
|
76 |
+
Adapta la promesa y el tono seg煤n este nivel de sofisticaci贸n del mercado.
|
77 |
+
"""
|
78 |
+
|
79 |
+
# Add the sophistication guidance to your instruction
|
80 |
+
instruction = f"""{offer_system_prompt}
|
81 |
+
|
82 |
+
FORMULA TO USE:
|
83 |
+
{selected_formula["description"]}
|
84 |
+
|
85 |
+
{additional_instructions}
|
86 |
+
|
87 |
+
PRODUCT/SERVICE:
|
88 |
+
{product_name}
|
89 |
+
|
90 |
+
TARGET AUDIENCE:
|
91 |
+
{target_audience}
|
92 |
+
|
93 |
+
ADDITIONAL INFORMATION:
|
94 |
+
{file_content}
|
95 |
+
|
96 |
+
Create a compelling offer following the formula structure exactly.
|
97 |
+
"""
|
98 |
+
|
99 |
+
{sophistication_guidance}
|
100 |
+
|
101 |
return instruction
|