JeCabrera commited on
Commit
61c1e67
verified
1 Parent(s): dc3e524

Upload 15 files

Browse files
Files changed (1) hide show
  1. prompts.py +40 -1
prompts.py CHANGED
@@ -63,7 +63,46 @@ Create a compelling offer following the formula structure exactly, adapting it t
63
  """
64
 
65
  # Add examples if available
66
- if selected_formula.get("examples") and len(selected_formula["examples"]) > 0:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"])])
68
  instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
69
 
 
63
  """
64
 
65
  # Add examples if available
66
+ if selected_formula.get("sophistication_examples") and sophistication_level:
67
+ # Extract the sophistication level key (e.g., "nivel_1", "nivel_2", etc.)
68
+ sophistication_key = sophistication_level.split(":")[0].lower().replace(" ", "_")
69
+
70
+ # Map to the correct key format used in the examples
71
+ if "nivel" not in sophistication_key:
72
+ sophistication_key = f"nivel_{sophistication_key[0]}"
73
+
74
+ # Get all examples for the specific sophistication level
75
+ examples = []
76
+ for key, example in selected_formula["sophistication_examples"].items():
77
+ # Check if the key starts with the sophistication level (to include nivel_1, nivel_1_ejemplo2, etc.)
78
+ if key.startswith(sophistication_key):
79
+ examples.append(example)
80
+
81
+ # Format all examples based on the formula type
82
+ if examples:
83
+ instruction += "\n\n### EXAMPLES FOR YOUR REFERENCE:\n"
84
+
85
+ for i, example in enumerate(examples):
86
+ instruction += f"\n#### Example {i+1}:\n"
87
+
88
+ # Format based on formula type
89
+ if selected_formula_name == "Oferta Dorada":
90
+ instruction += f"Headline: {example.get('headline', '')}\n"
91
+ instruction += f"Promise: {example.get('promise', '')}\n"
92
+ instruction += f"Subtitle: {example.get('subtitle', '')}\n"
93
+
94
+ elif selected_formula_name == "Contraste Revelador":
95
+ instruction += f"Situaci贸n: {example.get('situacion', '')}\n"
96
+ instruction += f"Soluci贸n: {example.get('solucion', '')}\n"
97
+ instruction += f"Resultado: {example.get('resultado', '')}\n"
98
+
99
+ elif selected_formula_name == "Propuesta 脷nica de Valor":
100
+ instruction += f"Transformaci贸n: {example.get('transformacion', '')}\n"
101
+ instruction += f"Objeciones: {example.get('objeciones', '')}\n"
102
+
103
+ # Add more formula types as needed
104
+ # Original code for general examples (keep as fallback)
105
+ elif selected_formula.get("examples") and len(selected_formula["examples"]) > 0:
106
  examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"])])
107
  instruction += f"\n\nGet inspired by these examples:\n{examples_text}"
108