JeCabrera commited on
Commit
45c3f0c
·
verified ·
1 Parent(s): e74b643

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -5,6 +5,7 @@ import time
5
  from dotenv import load_dotenv
6
  from styles import get_custom_css, get_response_html_wrapper
7
  from formulas import offer_formulas
 
8
  import PyPDF2
9
  import docx
10
  from PIL import Image
@@ -99,6 +100,7 @@ with col1:
99
  st.session_state.target_audience = target_audience
100
  st.session_state.temperature = temperature
101
  st.session_state.formula_type = formula_type
 
102
 
103
  # Keep only the manual input tab
104
  with st.container():
@@ -184,6 +186,17 @@ with col1:
184
  help='Selecciona el tipo de fórmula para tu oferta'
185
  )
186
 
 
 
 
 
 
 
 
 
 
 
 
187
  temperature = st.slider('🌡️ Nivel de Creatividad', min_value=0.0, max_value=2.0, value=1.0,
188
  help='Valores más altos hacen que el resultado sea más creativo pero menos enfocado')
189
 
@@ -200,6 +213,10 @@ with col2:
200
 
201
  # Get skills from session state or use empty string
202
  skills_value = st.session_state.skills if hasattr(st.session_state, 'skills') and st.session_state.skills else ""
 
 
 
 
203
 
204
  # Preparar el contenido del archivo si existe
205
  file_content = ""
@@ -212,7 +229,8 @@ with col2:
212
  product_name=product_service_value,
213
  selected_formula_name=st.session_state.formula_type,
214
  file_content=file_content,
215
- skills=skills_value
 
216
  )
217
 
218
  # Add instruction for generating benefit bullets based on the promise
 
5
  from dotenv import load_dotenv
6
  from styles import get_custom_css, get_response_html_wrapper
7
  from formulas import offer_formulas
8
+ from sophistication_levels import sophistication_levels # Import the sophistication levels
9
  import PyPDF2
10
  import docx
11
  from PIL import Image
 
100
  st.session_state.target_audience = target_audience
101
  st.session_state.temperature = temperature
102
  st.session_state.formula_type = formula_type
103
+ st.session_state.sophistication_level = sophistication_level # Store the sophistication level
104
 
105
  # Keep only the manual input tab
106
  with st.container():
 
186
  help='Selecciona el tipo de fórmula para tu oferta'
187
  )
188
 
189
+ # Add the sophistication level selector
190
+ sophistication_level = st.selectbox(
191
+ '🎯 Nivel de Sofisticación del Mercado',
192
+ options=list(sophistication_levels.keys()),
193
+ help='Adapta tu mensaje según la madurez del mercado (Eugene Schwartz)'
194
+ )
195
+
196
+ # Show example and strategy for the selected level
197
+ if sophistication_level:
198
+ st.info(f"**Estrategia:** {sophistication_levels[sophistication_level]['strategy']}\n\n**Ejemplo:** *{sophistication_levels[sophistication_level]['example']}*")
199
+
200
  temperature = st.slider('🌡️ Nivel de Creatividad', min_value=0.0, max_value=2.0, value=1.0,
201
  help='Valores más altos hacen que el resultado sea más creativo pero menos enfocado')
202
 
 
213
 
214
  # Get skills from session state or use empty string
215
  skills_value = st.session_state.skills if hasattr(st.session_state, 'skills') and st.session_state.skills else ""
216
+
217
+ # Get sophistication level from session state or use default
218
+ sophistication_level_value = st.session_state.sophistication_level if hasattr(st.session_state, 'sophistication_level') and st.session_state.sophistication_level else list(sophistication_levels.keys())[0]
219
+ sophistication_data = sophistication_levels[sophistication_level_value]
220
 
221
  # Preparar el contenido del archivo si existe
222
  file_content = ""
 
229
  product_name=product_service_value,
230
  selected_formula_name=st.session_state.formula_type,
231
  file_content=file_content,
232
+ skills=skills_value,
233
+ sophistication_level=sophistication_data # Pass the sophistication level data
234
  )
235
 
236
  # Add instruction for generating benefit bullets based on the promise