Update app.py
Browse files
app.py
CHANGED
@@ -552,16 +552,16 @@ IMPORTANT FINAL REMINDER:
|
|
552 |
# Aseg煤rate de que las instrucciones de naturalidad est茅n al inicio del prompt
|
553 |
story_instruction = f"{natural_instruction}\n\n{story_instruction}"
|
554 |
|
555 |
-
# Generar la historia
|
556 |
response = model.generate_content([story_instruction])
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
|
566 |
# Inicializar la aplicaci贸n Streamlit
|
567 |
st.set_page_config(page_title="Generador de Historias", page_icon=":pencil:", layout="wide")
|
|
|
552 |
# Aseg煤rate de que las instrucciones de naturalidad est茅n al inicio del prompt
|
553 |
story_instruction = f"{natural_instruction}\n\n{story_instruction}"
|
554 |
|
555 |
+
# Generar la historia
|
556 |
response = model.generate_content([story_instruction])
|
557 |
+
if response and response.parts:
|
558 |
+
story = response.parts[0].text.strip()
|
559 |
+
formula_types = ["GPS", "AIDA", "4U", "N煤merica Suprema"]
|
560 |
+
selected_formula = random.choice(formula_types)
|
561 |
+
headline = generate_headline_for_story(model, story, selected_formula, product, target_audience, mood)
|
562 |
+
if headline:
|
563 |
+
return f"{headline}\n\n{story}"
|
564 |
+
raise ValueError("No se pudo generar la historia")
|
565 |
|
566 |
# Inicializar la aplicaci贸n Streamlit
|
567 |
st.set_page_config(page_title="Generador de Historias", page_icon=":pencil:", layout="wide")
|