Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -217,12 +217,17 @@ with col2:
|
|
| 217 |
except Exception:
|
| 218 |
product_name = "Sistema Profesional"
|
| 219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
# Get the instruction using the formula
|
| 221 |
-
# Find where create_offer_instruction is being called, around line 222
|
| 222 |
instruction = create_offer_instruction(
|
| 223 |
-
|
| 224 |
product_name=product_name,
|
| 225 |
-
selected_formula_name=st.session_state.formula_type
|
|
|
|
| 226 |
)
|
| 227 |
|
| 228 |
# Add instruction for generating benefit bullets based on the promise
|
|
@@ -235,7 +240,7 @@ with col2:
|
|
| 235 |
product_name=product_name,
|
| 236 |
uploaded_content=bullet_content
|
| 237 |
)
|
| 238 |
-
|
| 239 |
# Add instruction for generating bonuses that complement the offer
|
| 240 |
instruction += create_bonus_instruction(
|
| 241 |
avatar_description=avatar_description,
|
|
@@ -243,27 +248,15 @@ with col2:
|
|
| 243 |
selected_formula_name=st.session_state.formula_type
|
| 244 |
)
|
| 245 |
|
| 246 |
-
#
|
|
|
|
| 247 |
if st.session_state.input_type == "manual":
|
| 248 |
additional_context = f"""
|
| 249 |
Additional information:
|
| 250 |
Skills: {st.session_state.skills}
|
| 251 |
"""
|
| 252 |
instruction += additional_context
|
| 253 |
-
|
| 254 |
-
additional_context = f"""
|
| 255 |
-
Additional information from file:
|
| 256 |
-
{st.session_state.file_content}
|
| 257 |
-
"""
|
| 258 |
-
instruction += additional_context
|
| 259 |
-
elif st.session_state.input_type == "both":
|
| 260 |
-
additional_context = f"""
|
| 261 |
-
Additional information:
|
| 262 |
-
Skills: {st.session_state.skills}
|
| 263 |
-
File content: {st.session_state.file_content}
|
| 264 |
-
"""
|
| 265 |
-
instruction += additional_context
|
| 266 |
-
|
| 267 |
try:
|
| 268 |
generation_config = genai.GenerationConfig(temperature=st.session_state.temperature)
|
| 269 |
|
|
|
|
| 217 |
except Exception:
|
| 218 |
product_name = "Sistema Profesional"
|
| 219 |
|
| 220 |
+
# Preparar el contenido del archivo si existe
|
| 221 |
+
file_content = ""
|
| 222 |
+
if hasattr(st.session_state, 'file_content') and st.session_state.input_type in ["file", "both"]:
|
| 223 |
+
file_content = st.session_state.file_content
|
| 224 |
+
|
| 225 |
# Get the instruction using the formula
|
|
|
|
| 226 |
instruction = create_offer_instruction(
|
| 227 |
+
target_audience=avatar_description, # Cambiado de avatar_description a target_audience
|
| 228 |
product_name=product_name,
|
| 229 |
+
selected_formula_name=st.session_state.formula_type,
|
| 230 |
+
file_content=file_content # A帽adido el contenido del archivo
|
| 231 |
)
|
| 232 |
|
| 233 |
# Add instruction for generating benefit bullets based on the promise
|
|
|
|
| 240 |
product_name=product_name,
|
| 241 |
uploaded_content=bullet_content
|
| 242 |
)
|
| 243 |
+
|
| 244 |
# Add instruction for generating bonuses that complement the offer
|
| 245 |
instruction += create_bonus_instruction(
|
| 246 |
avatar_description=avatar_description,
|
|
|
|
| 248 |
selected_formula_name=st.session_state.formula_type
|
| 249 |
)
|
| 250 |
|
| 251 |
+
# Ya no necesitamos a帽adir el contexto adicional aqu铆, ya que lo estamos pasando directamente
|
| 252 |
+
# a la funci贸n create_offer_instruction
|
| 253 |
if st.session_state.input_type == "manual":
|
| 254 |
additional_context = f"""
|
| 255 |
Additional information:
|
| 256 |
Skills: {st.session_state.skills}
|
| 257 |
"""
|
| 258 |
instruction += additional_context
|
| 259 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
try:
|
| 261 |
generation_config = genai.GenerationConfig(temperature=st.session_state.temperature)
|
| 262 |
|