Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -85,13 +85,14 @@ def generate_bullets(number_of_bullets, target_audience, product, call_to_action
|
|
85 |
|
86 |
# Generar el resultado utilizando el modelo
|
87 |
try:
|
88 |
-
response = model.generate_content([system_instruction])
|
89 |
|
90 |
-
#
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
95 |
except Exception as e:
|
96 |
raise ValueError(f"Error al generar los bullets: {str(e)}")
|
97 |
|
|
|
85 |
|
86 |
# Generar el resultado utilizando el modelo
|
87 |
try:
|
88 |
+
response = model.generate_content([model.system_instruction])
|
89 |
|
90 |
+
# Verificar que la respuesta tenga el formato esperado
|
91 |
+
if response.candidates and response.candidates[0].content.parts:
|
92 |
+
generated_bullets = response.candidates[0].content.parts[0].text.strip()
|
93 |
+
return generated_bullets
|
94 |
+
else:
|
95 |
+
raise ValueError("No se generaron bullets válidos.")
|
96 |
except Exception as e:
|
97 |
raise ValueError(f"Error al generar los bullets: {str(e)}")
|
98 |
|