Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,65 @@ def generate_story(formula_type, target_audience, product, action, mood, length,
|
|
119 |
if formula_type not in story_formulas:
|
120 |
raise ValueError("F贸rmula no v谩lida")
|
121 |
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
story_instruction = f"{system_prompt}\n\n"
|
125 |
|
|
|
119 |
if formula_type not in story_formulas:
|
120 |
raise ValueError("F贸rmula no v谩lida")
|
121 |
|
122 |
+
# Definir el system prompt dentro de la funci贸n
|
123 |
+
system_prompt = """You are a world-class copywriter, specialized in crafting persuasive stories that emotionally connect with readers and drive them to action.
|
124 |
+
|
125 |
+
FORMAT RULES:
|
126 |
+
- Story must be structured in clear paragraphs
|
127 |
+
- Each section must flow naturally into the next
|
128 |
+
- No explicit section labels
|
129 |
+
- Maintain consistent tone throughout
|
130 |
+
- Include smooth transitions between parts
|
131 |
+
- Story must feel complete and cohesive
|
132 |
+
|
133 |
+
IMPORTANT STRUCTURE INSTRUCTIONS:
|
134 |
+
- The selected formula MUST be applied to the entire story
|
135 |
+
- Review and follow the structure detailed in story_formulas[formula_type]["description"]
|
136 |
+
- Use the examples in story_formulas[formula_type]["examples"] as inspiration
|
137 |
+
- Formula provides the framework, tone provides the emotional layer
|
138 |
+
- Both must work together seamlessly
|
139 |
+
|
140 |
+
FORMAT EXAMPLE:
|
141 |
+
[First paragraph introducing the situation]
|
142 |
+
|
143 |
+
[Second paragraph developing tension/conflict]
|
144 |
+
|
145 |
+
[Third paragraph presenting transformation]
|
146 |
+
|
147 |
+
[Final paragraph with natural call to action]
|
148 |
+
|
149 |
+
IMPORTANT:
|
150 |
+
- Each story must be unique and memorable
|
151 |
+
- Avoid clich茅s and generic scenarios
|
152 |
+
- Maintain a credible and authentic voice
|
153 |
+
- Adapt language to target audience
|
154 |
+
- Focus on emotional transformation
|
155 |
+
- Follow formula structure while maintaining selected tone
|
156 |
+
- Never explicitly label sections
|
157 |
+
- Integrate product and call-to-action organically
|
158 |
+
|
159 |
+
STORY STRUCTURE GUIDELINES:
|
160 |
+
1. Study the formula description carefully
|
161 |
+
2. Review provided examples for style and flow
|
162 |
+
3. Maintain similar paragraph length and structure
|
163 |
+
4. Use consistent emotional intensity
|
164 |
+
5. Mirror the narrative progression
|
165 |
+
6. Adapt content for target audience while keeping formula essence
|
166 |
+
|
167 |
+
TONE AND STYLE:
|
168 |
+
- Selected tone must remain consistent
|
169 |
+
- Tone modifies HOW the story is told
|
170 |
+
- Formula provides structure, tone provides emotion
|
171 |
+
- Both elements must complement each other
|
172 |
+
- Maintain voice appropriate for target audience
|
173 |
+
|
174 |
+
KEY ELEMENTS TO INCLUDE:
|
175 |
+
- Emotional hooks that grab attention
|
176 |
+
- Relatable situations and characters
|
177 |
+
- Sensory details and vivid descriptions
|
178 |
+
- Natural problem-solution progression
|
179 |
+
- Organic product integration
|
180 |
+
- Compelling but subtle call-to-action"""
|
181 |
|
182 |
story_instruction = f"{system_prompt}\n\n"
|
183 |
|