Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -193,29 +193,6 @@ with col2:
|
|
| 193 |
with st.spinner('Creando tu oferta perfecta...'):
|
| 194 |
# Use the create_offer_instruction function to generate the prompt
|
| 195 |
avatar_description = st.session_state.target_audience if hasattr(st.session_state, 'target_audience') and st.session_state.target_audience else 'General audience'
|
| 196 |
-
|
| 197 |
-
# Determine product name based on input type
|
| 198 |
-
if hasattr(st.session_state, 'product_service') and st.session_state.product_service:
|
| 199 |
-
product_name = st.session_state.product_service
|
| 200 |
-
else:
|
| 201 |
-
# Generar un nombre creativo en lugar de usar "Producto/Servicio"
|
| 202 |
-
try:
|
| 203 |
-
creative_name_prompt = f"""Crea un nombre creativo y atractivo para un producto o servicio
|
| 204 |
-
basado en estas habilidades: {st.session_state.skills if hasattr(st.session_state, 'skills') else 'profesional'}.
|
| 205 |
-
El público objetivo es: {avatar_description}.
|
| 206 |
-
Responde SOLO con el nombre, sin explicaciones ni comillas."""
|
| 207 |
-
|
| 208 |
-
creative_name_response = model.generate_content(
|
| 209 |
-
creative_name_prompt,
|
| 210 |
-
generation_config=genai.GenerationConfig(temperature=0.8, max_output_tokens=30)
|
| 211 |
-
)
|
| 212 |
-
product_name = creative_name_response.text.strip().replace('"', '').replace("'", "")
|
| 213 |
-
|
| 214 |
-
# Si el nombre generado está vacío o es demasiado largo, usar un valor predeterminado
|
| 215 |
-
if not product_name or len(product_name) > 50:
|
| 216 |
-
product_name = "Sistema Profesional"
|
| 217 |
-
except Exception:
|
| 218 |
-
product_name = "Sistema Profesional"
|
| 219 |
|
| 220 |
# Preparar el contenido del archivo si existe
|
| 221 |
file_content = ""
|
|
|
|
| 193 |
with st.spinner('Creando tu oferta perfecta...'):
|
| 194 |
# Use the create_offer_instruction function to generate the prompt
|
| 195 |
avatar_description = st.session_state.target_audience if hasattr(st.session_state, 'target_audience') and st.session_state.target_audience else 'General audience'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
|
| 197 |
# Preparar el contenido del archivo si existe
|
| 198 |
file_content = ""
|