Spaces:
Sleeping
Sleeping
Upload 17 files
Browse files- bonuses/generator.py +34 -0
- bullets/generator.py +8 -5
- prompts.py +32 -14
bonuses/generator.py
CHANGED
|
@@ -305,6 +305,40 @@ Dos sesiones grupales mensuales donde implementamos juntos, resolvemos dudas esp
|
|
| 305 |
Valor total de bonos: $1,032 - Todo incluido con tu inversi贸n hoy.
|
| 306 |
"""
|
| 307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
# Combine all instructions
|
| 309 |
complete_instruction = base_instruction + input_information + bonus_instructions + remaining_instructions
|
| 310 |
|
|
|
|
| 305 |
Valor total de bonos: $1,032 - Todo incluido con tu inversi贸n hoy.
|
| 306 |
"""
|
| 307 |
|
| 308 |
+
# Add formula-specific bonus guidance
|
| 309 |
+
formula_specific_guidance = ""
|
| 310 |
+
if selected_formula_name:
|
| 311 |
+
if selected_formula_name == "Oferta Dorada":
|
| 312 |
+
formula_specific_guidance = """
|
| 313 |
+
FORMULA-SPECIFIC BONUS GUIDANCE (OFERTA DORADA):
|
| 314 |
+
- Create bonuses that enhance the perceived value of the headline promise
|
| 315 |
+
- Include at least one bonus that provides proof or validation of the main promise
|
| 316 |
+
- Add a bonus that addresses the most common objection for this type of offer
|
| 317 |
+
- Consider a bonus that accelerates the timeline mentioned in the subtitle
|
| 318 |
+
- Ensure bonuses maintain the same tone and sophistication level as the main offer
|
| 319 |
+
"""
|
| 320 |
+
elif selected_formula_name == "Contraste Revelador":
|
| 321 |
+
formula_specific_guidance = """
|
| 322 |
+
FORMULA-SPECIFIC BONUS GUIDANCE (CONTRASTE REVELADOR):
|
| 323 |
+
- Create bonuses that bridge the gap between the current situation and desired outcome
|
| 324 |
+
- Include at least one bonus that makes the solution easier to implement
|
| 325 |
+
- Add a bonus that addresses potential fears about the transformation process
|
| 326 |
+
- Consider a bonus that provides additional proof of the promised results
|
| 327 |
+
- Ensure bonuses reinforce the emotional contrast between problem and solution
|
| 328 |
+
"""
|
| 329 |
+
elif selected_formula_name == "Propuesta 脷nica de Valor":
|
| 330 |
+
formula_specific_guidance = """
|
| 331 |
+
FORMULA-SPECIFIC BONUS GUIDANCE (PROPUESTA 脷NICA DE VALOR):
|
| 332 |
+
- Create bonuses that directly address the objections mentioned in the main offer
|
| 333 |
+
- Include at least one bonus that enhances the unique transformation promised
|
| 334 |
+
- Add a bonus that provides social proof or validation of the transformation
|
| 335 |
+
- Consider a bonus that helps overcome implementation challenges
|
| 336 |
+
- Ensure bonuses reinforce the unique mechanism or approach of the main offer
|
| 337 |
+
"""
|
| 338 |
+
|
| 339 |
+
# Add the formula-specific guidance to the input information
|
| 340 |
+
input_information += f"\n\n5. SELECTED FORMULA: {selected_formula_name}\n{formula_specific_guidance}"
|
| 341 |
+
|
| 342 |
# Combine all instructions
|
| 343 |
complete_instruction = base_instruction + input_information + bonus_instructions + remaining_instructions
|
| 344 |
|
bullets/generator.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import random
|
| 2 |
|
| 3 |
-
def create_bullet_instruction(product_service=None, uploaded_content=None, target_audience=None, skills=None):
|
| 4 |
"""
|
| 5 |
Creates the instruction for generating benefit bullets.
|
| 6 |
The model will randomly choose between different bullet formulas.
|
|
@@ -10,6 +10,7 @@ def create_bullet_instruction(product_service=None, uploaded_content=None, targe
|
|
| 10 |
product_service: Kind of product or service
|
| 11 |
uploaded_content: Content from uploaded files (if any)
|
| 12 |
skills: User's skills and expertise
|
|
|
|
| 13 |
|
| 14 |
Returns:
|
| 15 |
str: The complete instruction for generating bullets
|
|
@@ -490,7 +491,7 @@ def get_random_bullet_formula():
|
|
| 490 |
return selected_formula
|
| 491 |
|
| 492 |
|
| 493 |
-
def create_bullet_instruction_with_formula(target_audience=None, product_service=None, uploaded_content=None, skills=None):
|
| 494 |
"""
|
| 495 |
Creates the instruction for generating benefit bullets with a specific
|
| 496 |
randomly selected formula to ensure consistency.
|
|
@@ -500,6 +501,7 @@ def create_bullet_instruction_with_formula(target_audience=None, product_service
|
|
| 500 |
product_service: Name of the product or service
|
| 501 |
uploaded_content: Content from uploaded files (if any)
|
| 502 |
skills: User's skills and expertise
|
|
|
|
| 503 |
|
| 504 |
Returns:
|
| 505 |
str: The complete instruction for generating bullets with the selected formula
|
|
@@ -523,16 +525,17 @@ def create_bullet_instruction_with_formula(target_audience=None, product_service
|
|
| 523 |
target_audience=target_audience,
|
| 524 |
product_service=product_service,
|
| 525 |
uploaded_content=uploaded_content,
|
| 526 |
-
skills=skills
|
|
|
|
| 527 |
)
|
| 528 |
|
| 529 |
# Get a random formula
|
| 530 |
-
|
| 531 |
|
| 532 |
# Add specific instruction to use the selected formula
|
| 533 |
formula_directive = f"""
|
| 534 |
|
| 535 |
-
IMPORTANT OVERRIDE: For this specific task, you MUST use FORMULA {
|
| 536 |
for ALL 5 bullets. Do not choose randomly - you must use this exact formula consistently.
|
| 537 |
"""
|
| 538 |
|
|
|
|
| 1 |
import random
|
| 2 |
|
| 3 |
+
def create_bullet_instruction(product_service=None, uploaded_content=None, target_audience=None, skills=None, selected_formula_name=None):
|
| 4 |
"""
|
| 5 |
Creates the instruction for generating benefit bullets.
|
| 6 |
The model will randomly choose between different bullet formulas.
|
|
|
|
| 10 |
product_service: Kind of product or service
|
| 11 |
uploaded_content: Content from uploaded files (if any)
|
| 12 |
skills: User's skills and expertise
|
| 13 |
+
selected_formula_name: Name of the formula selected for the main offer
|
| 14 |
|
| 15 |
Returns:
|
| 16 |
str: The complete instruction for generating bullets
|
|
|
|
| 491 |
return selected_formula
|
| 492 |
|
| 493 |
|
| 494 |
+
def create_bullet_instruction_with_formula(target_audience=None, product_service=None, uploaded_content=None, skills=None, selected_formula_name=None):
|
| 495 |
"""
|
| 496 |
Creates the instruction for generating benefit bullets with a specific
|
| 497 |
randomly selected formula to ensure consistency.
|
|
|
|
| 501 |
product_service: Name of the product or service
|
| 502 |
uploaded_content: Content from uploaded files (if any)
|
| 503 |
skills: User's skills and expertise
|
| 504 |
+
selected_formula_name: Name of the formula selected for the main offer
|
| 505 |
|
| 506 |
Returns:
|
| 507 |
str: The complete instruction for generating bullets with the selected formula
|
|
|
|
| 525 |
target_audience=target_audience,
|
| 526 |
product_service=product_service,
|
| 527 |
uploaded_content=uploaded_content,
|
| 528 |
+
skills=skills,
|
| 529 |
+
selected_formula_name=selected_formula_name # Pass the formula name
|
| 530 |
)
|
| 531 |
|
| 532 |
# Get a random formula
|
| 533 |
+
selected_bullet_formula = get_random_bullet_formula()
|
| 534 |
|
| 535 |
# Add specific instruction to use the selected formula
|
| 536 |
formula_directive = f"""
|
| 537 |
|
| 538 |
+
IMPORTANT OVERRIDE: For this specific task, you MUST use FORMULA {selected_bullet_formula}
|
| 539 |
for ALL 5 bullets. Do not choose randomly - you must use this exact formula consistently.
|
| 540 |
"""
|
| 541 |
|
prompts.py
CHANGED
|
@@ -254,22 +254,40 @@ def create_integrated_instruction(target_audience=None, product_service=None, se
|
|
| 254 |
)
|
| 255 |
|
| 256 |
# Crear instrucciones para los beneficios
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
# Crear instrucciones para los bonos
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
# Instrucci贸n de integraci贸n que especifica el formato exacto para todas las f贸rmulas
|
| 275 |
integration_instruction = f"""
|
|
|
|
| 254 |
)
|
| 255 |
|
| 256 |
# Crear instrucciones para los beneficios
|
| 257 |
+
try:
|
| 258 |
+
bullet_instruction = create_bullet_instruction(
|
| 259 |
+
target_audience=target_audience,
|
| 260 |
+
product_service=product_service,
|
| 261 |
+
selected_formula_name=selected_formula_name,
|
| 262 |
+
uploaded_content=bullet_content or file_content, # Priorizar bullet_content si existe
|
| 263 |
+
skills=skills
|
| 264 |
+
)
|
| 265 |
+
except TypeError:
|
| 266 |
+
# Si la funci贸n no acepta selected_formula_name, llamarla sin ese par谩metro
|
| 267 |
+
bullet_instruction = create_bullet_instruction(
|
| 268 |
+
target_audience=target_audience,
|
| 269 |
+
product_service=product_service,
|
| 270 |
+
uploaded_content=bullet_content or file_content, # Priorizar bullet_content si existe
|
| 271 |
+
skills=skills
|
| 272 |
+
)
|
| 273 |
|
| 274 |
# Crear instrucciones para los bonos
|
| 275 |
+
try:
|
| 276 |
+
bonus_instruction = create_bonus_instruction(
|
| 277 |
+
target_audience=target_audience,
|
| 278 |
+
product_service=product_service,
|
| 279 |
+
selected_formula_name=selected_formula_name,
|
| 280 |
+
uploaded_content=bonus_content or file_content, # Priorizar bonus_content si existe
|
| 281 |
+
skills=skills
|
| 282 |
+
)
|
| 283 |
+
except TypeError:
|
| 284 |
+
# Si la funci贸n no acepta selected_formula_name, llamarla sin ese par谩metro
|
| 285 |
+
bonus_instruction = create_bonus_instruction(
|
| 286 |
+
target_audience=target_audience,
|
| 287 |
+
product_service=product_service,
|
| 288 |
+
uploaded_content=bonus_content or file_content, # Priorizar bonus_content si existe
|
| 289 |
+
skills=skills
|
| 290 |
+
)
|
| 291 |
|
| 292 |
# Instrucci贸n de integraci贸n que especifica el formato exacto para todas las f贸rmulas
|
| 293 |
integration_instruction = f"""
|