JeCabrera commited on
Commit
f694b28
verified
1 Parent(s): 5d59b46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -14
app.py CHANGED
@@ -196,6 +196,9 @@ with col2:
196
 
197
  # Get product_service from session state or use the current value
198
  product_service_value = st.session_state.product_service if hasattr(st.session_state, 'product_service') and st.session_state.product_service else product_service
 
 
 
199
 
200
  # Preparar el contenido del archivo si existe
201
  file_content = ""
@@ -205,9 +208,10 @@ with col2:
205
  # Get the instruction using the formula
206
  instruction = create_offer_instruction(
207
  target_audience=avatar_description,
208
- product_name=product_service_value, # Using product_service_value but with parameter name product_name
209
  selected_formula_name=st.session_state.formula_type,
210
- file_content=file_content
 
211
  )
212
 
213
  # Add instruction for generating benefit bullets based on the promise
@@ -217,25 +221,27 @@ with col2:
217
 
218
  instruction += create_bullet_instruction(
219
  avatar_description=avatar_description,
220
- product_name=product_service_value, # Using product_service_value
221
- uploaded_content=bullet_content
 
222
  )
223
 
224
  # Add instruction for generating bonuses that complement the offer
225
  instruction += create_bonus_instruction(
226
  avatar_description=avatar_description,
227
- product_name=product_service_value, # Using product_service_value
228
- selected_formula_name=st.session_state.formula_type
 
 
229
  )
230
 
231
- # Ya no necesitamos a帽adir el contexto adicional aqu铆, ya que lo estamos pasando directamente
232
- # a la funci贸n create_offer_instruction
233
- if st.session_state.input_type == "manual":
234
- additional_context = f"""
235
- Additional information:
236
- Skills: {st.session_state.skills}
237
- """
238
- instruction += additional_context
239
 
240
  try:
241
  generation_config = genai.GenerationConfig(temperature=st.session_state.temperature)
 
196
 
197
  # Get product_service from session state or use the current value
198
  product_service_value = st.session_state.product_service if hasattr(st.session_state, 'product_service') and st.session_state.product_service else product_service
199
+
200
+ # Get skills from session state or use empty string
201
+ skills_value = st.session_state.skills if hasattr(st.session_state, 'skills') and st.session_state.skills else ""
202
 
203
  # Preparar el contenido del archivo si existe
204
  file_content = ""
 
208
  # Get the instruction using the formula
209
  instruction = create_offer_instruction(
210
  target_audience=avatar_description,
211
+ product_name=product_service_value,
212
  selected_formula_name=st.session_state.formula_type,
213
+ file_content=file_content,
214
+ skills=skills_value # Add skills to the offer instruction
215
  )
216
 
217
  # Add instruction for generating benefit bullets based on the promise
 
221
 
222
  instruction += create_bullet_instruction(
223
  avatar_description=avatar_description,
224
+ product_name=product_service_value,
225
+ uploaded_content=bullet_content,
226
+ skills=skills_value # Add skills to the bullet instruction
227
  )
228
 
229
  # Add instruction for generating bonuses that complement the offer
230
  instruction += create_bonus_instruction(
231
  avatar_description=avatar_description,
232
+ product_name=product_service_value,
233
+ selected_formula_name=st.session_state.formula_type,
234
+ uploaded_content=bullet_content, # Pass the file content to bonus generator too
235
+ skills=skills_value # Add skills to the bonus instruction
236
  )
237
 
238
+ # We don't need this additional context anymore since we're passing skills directly to the generators
239
+ # if st.session_state.input_type == "manual":
240
+ # additional_context = f"""
241
+ # Additional information:
242
+ # Skills: {st.session_state.skills}
243
+ # """
244
+ # instruction += additional_context
 
245
 
246
  try:
247
  generation_config = genai.GenerationConfig(temperature=st.session_state.temperature)