Spaces:
Sleeping
Sleeping
Update bullets/generator.py
Browse files- bullets/generator.py +11 -4
bullets/generator.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import random
|
2 |
|
3 |
-
def create_bullet_instruction(avatar_description=None, product_name=None, uploaded_content=None, target_audience=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(avatar_description=None, product_name=None, upload
|
|
10 |
product_name: Name of the product or service
|
11 |
uploaded_content: Content from uploaded files (if any)
|
12 |
target_audience: Specific target audience for the bullets
|
|
|
13 |
|
14 |
Returns:
|
15 |
str: The complete instruction for generating bullets
|
@@ -189,6 +190,9 @@ def create_bullet_instruction(avatar_description=None, product_name=None, upload
|
|
189 |
3. UPLOADED CONTENT:
|
190 |
{uploaded_content if uploaded_content else "No additional content uploaded."}
|
191 |
|
|
|
|
|
|
|
192 |
{guidance}
|
193 |
|
194 |
IMPORTANT: Analyze ALL available information above to create bullets that specifically address the needs, desires, and objections of this audience for this specific product/service.
|
@@ -436,7 +440,7 @@ def get_random_bullet_formula():
|
|
436 |
return selected_formula
|
437 |
|
438 |
|
439 |
-
def create_bullet_instruction_with_formula(avatar_description=None, product_name=None, uploaded_content=None):
|
440 |
"""
|
441 |
Creates the instruction for generating benefit bullets with a specific
|
442 |
randomly selected formula to ensure consistency.
|
@@ -445,12 +449,13 @@ def create_bullet_instruction_with_formula(avatar_description=None, product_name
|
|
445 |
avatar_description: Description of the target audience
|
446 |
product_name: Name of the product or service
|
447 |
uploaded_content: Content from uploaded files (if any)
|
|
|
448 |
|
449 |
Returns:
|
450 |
str: The complete instruction for generating bullets with the selected formula
|
451 |
"""
|
452 |
# Check if any information is provided
|
453 |
-
if not avatar_description and not product_name and not uploaded_content:
|
454 |
return """
|
455 |
ADVERTENCIA: No se ha proporcionado ninguna informaci贸n para generar los bullets.
|
456 |
|
@@ -458,6 +463,7 @@ def create_bullet_instruction_with_formula(avatar_description=None, product_name
|
|
458 |
- Descripci贸n del p煤blico objetivo (avatar)
|
459 |
- Nombre del producto o servicio
|
460 |
- Contenido adicional relevante
|
|
|
461 |
|
462 |
Sin esta informaci贸n, los bullets generados ser谩n gen茅ricos y posiblemente menos efectivos para tu oferta espec铆fica.
|
463 |
"""
|
@@ -466,7 +472,8 @@ def create_bullet_instruction_with_formula(avatar_description=None, product_name
|
|
466 |
base_instruction = create_bullet_instruction(
|
467 |
avatar_description=avatar_description,
|
468 |
product_name=product_name,
|
469 |
-
uploaded_content=uploaded_content
|
|
|
470 |
)
|
471 |
|
472 |
# Get a random formula
|
|
|
1 |
import random
|
2 |
|
3 |
+
def create_bullet_instruction(avatar_description=None, product_name=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 |
product_name: Name of the product or service
|
11 |
uploaded_content: Content from uploaded files (if any)
|
12 |
target_audience: Specific target audience for the bullets
|
13 |
+
skills: User's skills and expertise
|
14 |
|
15 |
Returns:
|
16 |
str: The complete instruction for generating bullets
|
|
|
190 |
3. UPLOADED CONTENT:
|
191 |
{uploaded_content if uploaded_content else "No additional content uploaded."}
|
192 |
|
193 |
+
4. SKILLS AND EXPERTISE:
|
194 |
+
{skills if skills else "No specific skills provided."}
|
195 |
+
|
196 |
{guidance}
|
197 |
|
198 |
IMPORTANT: Analyze ALL available information above to create bullets that specifically address the needs, desires, and objections of this audience for this specific product/service.
|
|
|
440 |
return selected_formula
|
441 |
|
442 |
|
443 |
+
def create_bullet_instruction_with_formula(avatar_description=None, product_name=None, uploaded_content=None, skills=None):
|
444 |
"""
|
445 |
Creates the instruction for generating benefit bullets with a specific
|
446 |
randomly selected formula to ensure consistency.
|
|
|
449 |
avatar_description: Description of the target audience
|
450 |
product_name: Name of the product or service
|
451 |
uploaded_content: Content from uploaded files (if any)
|
452 |
+
skills: User's skills and expertise
|
453 |
|
454 |
Returns:
|
455 |
str: The complete instruction for generating bullets with the selected formula
|
456 |
"""
|
457 |
# Check if any information is provided
|
458 |
+
if not avatar_description and not product_name and not uploaded_content and not skills:
|
459 |
return """
|
460 |
ADVERTENCIA: No se ha proporcionado ninguna informaci贸n para generar los bullets.
|
461 |
|
|
|
463 |
- Descripci贸n del p煤blico objetivo (avatar)
|
464 |
- Nombre del producto o servicio
|
465 |
- Contenido adicional relevante
|
466 |
+
- Habilidades y experiencia
|
467 |
|
468 |
Sin esta informaci贸n, los bullets generados ser谩n gen茅ricos y posiblemente menos efectivos para tu oferta espec铆fica.
|
469 |
"""
|
|
|
472 |
base_instruction = create_bullet_instruction(
|
473 |
avatar_description=avatar_description,
|
474 |
product_name=product_name,
|
475 |
+
uploaded_content=uploaded_content,
|
476 |
+
skills=skills
|
477 |
)
|
478 |
|
479 |
# Get a random formula
|