Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 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"""
|