Update app.py
Browse files
app.py
CHANGED
@@ -122,6 +122,43 @@ def generate_story(formula_type, target_audience, product, action, mood, length,
|
|
122 |
if formula_type not in story_formulas:
|
123 |
raise ValueError("Fórmula no válida")
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
# Definir el system prompt dentro de la función
|
126 |
system_prompt = """You are a world-class copywriter, specialized in crafting persuasive stories that emotionally connect with readers and drive them to action.
|
127 |
|
@@ -180,7 +217,7 @@ KEY ELEMENTS TO INCLUDE:
|
|
180 |
- Organic product integration
|
181 |
- Compelling but subtle call-to-action"""
|
182 |
|
183 |
-
story_instruction = f"{system_prompt}\n\n"
|
184 |
|
185 |
# Instrucciones específicas para GHA cuando hay story_topic
|
186 |
if formula_type == "GHA" and story_topic:
|
|
|
122 |
if formula_type not in story_formulas:
|
123 |
raise ValueError("Fórmula no válida")
|
124 |
|
125 |
+
# Análisis del público objetivo
|
126 |
+
audience_analysis = f"""
|
127 |
+
ANÁLISIS DEL PÚBLICO OBJETIVO: {target_audience}
|
128 |
+
|
129 |
+
INSTRUCCIONES DE ANÁLISIS:
|
130 |
+
1. Dolores y Problemas:
|
131 |
+
- Identifica los problemas cotidianos específicos de {target_audience}
|
132 |
+
- Reconoce sus frustraciones y miedos más profundos
|
133 |
+
- Analiza las consecuencias emocionales de estos problemas
|
134 |
+
- Considera el impacto en su vida diaria
|
135 |
+
|
136 |
+
2. Creencias y Valores:
|
137 |
+
- Comprende sus creencias limitantes
|
138 |
+
- Identifica sus aspiraciones y sueños
|
139 |
+
- Reconoce sus valores fundamentales
|
140 |
+
- Entiende sus motivaciones principales
|
141 |
+
|
142 |
+
3. Situaciones de Vida:
|
143 |
+
- Visualiza sus rutinas diarias
|
144 |
+
- Identifica momentos de tensión o conflicto
|
145 |
+
- Reconoce sus contextos sociales y profesionales
|
146 |
+
- Comprende sus responsabilidades y presiones
|
147 |
+
|
148 |
+
4. Puntos de Dolor Específicos:
|
149 |
+
- Problemas prácticos: [analiza sus dificultades concretas]
|
150 |
+
- Dolores emocionales: [identifica sus preocupaciones más profundas]
|
151 |
+
- Miedos: [reconoce sus temores principales]
|
152 |
+
- Frustraciones: [entiende sus obstáculos recurrentes]
|
153 |
+
|
154 |
+
CONTEXTO NARRATIVO:
|
155 |
+
- Si hay story_topic ("{story_topic if story_topic else 'No especificado'}"),
|
156 |
+
úsalo como escenario o contexto para desarrollar la historia
|
157 |
+
- El protagonista debe reflejar fielmente las características de {target_audience}
|
158 |
+
- Los problemas y situaciones deben ser 100% reconocibles por la audiencia
|
159 |
+
- La transformación debe abordar directamente sus dolores específicos
|
160 |
+
"""
|
161 |
+
|
162 |
# Definir el system prompt dentro de la función
|
163 |
system_prompt = """You are a world-class copywriter, specialized in crafting persuasive stories that emotionally connect with readers and drive them to action.
|
164 |
|
|
|
217 |
- Organic product integration
|
218 |
- Compelling but subtle call-to-action"""
|
219 |
|
220 |
+
story_instruction = f"{system_prompt}\n\n{audience_analysis}\n\n"
|
221 |
|
222 |
# Instrucciones específicas para GHA cuando hay story_topic
|
223 |
if formula_type == "GHA" and story_topic:
|