JeCabrera commited on
Commit
99036c0
verified
1 Parent(s): 7cdbe3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -11
app.py CHANGED
@@ -199,18 +199,25 @@ with col2:
199
  # Get the instruction using the formula
200
  # Usar la funci贸n actualizada
201
  # In the generate_offer function or wherever the error is occurring
 
202
  def generate_offer():
203
- # Make sure to get the selected formula name from the session state or UI
204
- selected_formula_name = st.session_state.formula_type # This should match the variable name from your UI
205
-
206
- # Now use it in your function call
207
- instruction = create_offer_instruction(
208
- avatar_description=target_audience,
209
- product_name=product_service,
210
- selected_formula_name=selected_formula_name,
211
- offer_formulas=offer_formulas
212
- )
213
-
 
 
 
 
 
 
214
  # Add additional context based on input type
215
  if st.session_state.input_type == "manual":
216
  additional_context = f"""
 
199
  # Get the instruction using the formula
200
  # Usar la funci贸n actualizada
201
  # In the generate_offer function or wherever the error is occurring
202
+ # The function definition needs proper indentation for its body
203
  def generate_offer():
204
+ # Properly indented function body
205
+ selected_formula_name = st.session_state.formula_type
206
+
207
+ instruction = create_offer_instruction(
208
+ avatar_description=target_audience,
209
+ product_name=product_service,
210
+ selected_formula_name=selected_formula_name,
211
+ offer_formulas=offer_formulas
212
+ )
213
+
214
+ # Add the rest of your function implementation here
215
+ response = model.generate_content(instruction)
216
+ offer_result = response.text
217
+
218
+ st.session_state.offer_result = offer_result
219
+ st.session_state.generated = True
220
+
221
  # Add additional context based on input type
222
  if st.session_state.input_type == "manual":
223
  additional_context = f"""