JeCabrera commited on
Commit
ea8d9b4
·
verified ·
1 Parent(s): b44807b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py CHANGED
@@ -122,6 +122,25 @@ 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
  # Análisis del público objetivo
126
  audience_analysis = f"""
127
  ANÁLISIS DEL PÚBLICO OBJETIVO: {target_audience}
@@ -315,6 +334,10 @@ IMPORTANT FINAL REMINDER:
315
  - Ensure natural flow and cultural relevance
316
  - Maintain authentic Spanish expressions and tone
317
  """
 
 
 
 
318
  response = model.generate_content([story_instruction])
319
  if response and response.parts:
320
  return response.parts[0].text.strip()
 
122
  if formula_type not in story_formulas:
123
  raise ValueError("Fórmula no válida")
124
 
125
+ # Añadir instrucciones de naturalidad al inicio del prompt
126
+ natural_instruction = f"""
127
+ IMPORTANTE - NATURALIDAD EN LA HISTORIA:
128
+ - NO menciones "{product}" de forma literal o forzada
129
+ - Introduce el producto/servicio de manera sutil y orgánica en la narrativa
130
+ - Evita que suene como una fórmula publicitaria
131
+ - La solución debe surgir naturalmente de la historia
132
+ - Usa variaciones y descripciones naturales en lugar del nombre exacto
133
+ - La historia debe fluir como una conversación real, no como un anuncio
134
+
135
+ Por ejemplo, si el producto es "Webinar sobre Yoga":
136
+ ❌ "Entonces descubrí el Webinar sobre Yoga"
137
+ ✅ "Encontré estas clases en línea donde aprendí a conectar con mi cuerpo"
138
+
139
+ Si es un curso:
140
+ ❌ "Me inscribí en el Curso de Marketing Digital"
141
+ ✅ "Comencé a aprender sobre el mundo del marketing en línea"
142
+ """
143
+
144
  # Análisis del público objetivo
145
  audience_analysis = f"""
146
  ANÁLISIS DEL PÚBLICO OBJETIVO: {target_audience}
 
334
  - Ensure natural flow and cultural relevance
335
  - Maintain authentic Spanish expressions and tone
336
  """
337
+
338
+ # Asegúrate de que las instrucciones de naturalidad estén al inicio del prompt
339
+ story_instruction = f"{natural_instruction}\n\n{story_instruction}"
340
+
341
  response = model.generate_content([story_instruction])
342
  if response and response.parts:
343
  return response.parts[0].text.strip()