JeCabrera commited on
Commit
2457cc0
verified
1 Parent(s): 90a2666

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -17,12 +17,12 @@ def get_random_product_mention():
17
  # Funci贸n para obtener una t茅cnica de copywriting de manera aleatoria
18
  def get_random_copywriting_technique():
19
  techniques = [
20
- "If/Then: This is one of the most commonly used opening paragraphs. It鈥檚 very simple, clear, and powerful.",
21
- "If / Then + Authority: Adding a figure of authority or credibility to the opening.",
22
- "Honesty: Being transparent is one of the best ways to get more customers.",
23
- "Sensationalist: It grabs attention with unusual or provocative statements.",
24
- "Ask a Question: It makes people stop if they鈥檙e interested.",
25
- "Micro Openings: Keep it brief to encourage further reading."
26
  ]
27
  return random.sample(techniques, k=random.randint(1, 3)) # Escoge entre 1 y 3 t茅cnicas al azar
28
 
@@ -58,10 +58,10 @@ def get_gemini_response(target_audience, product, text_type, length, mood, emoti
58
 
59
  # Crear el prompt completo basado en los campos del frontend
60
  full_prompt = f"""
61
- You are a creative writer skilled in the art of persuasion. The tone of the {text_type} should be {mood} and carefully crafted to emotionally resonate with a {target_audience}. {product_mention} {format_instruction}
62
- Incorporate the following copywriting techniques: {techniques_text}
63
- Use persuasive techniques to guide the reader towards an intuitive understanding of the product's benefits, focusing on creating a strong emotional connection with the audience.
64
- Create an opening paragraph for a {text_type} of {length} words in Spanish, that makes {target_audience} aware they have a problem by explaining it with real-life situations, using a natural or conversational tone. The goal of this paragraph is to make them want to keep reading and find out what {product} is about. Use persuasion effectively in every word, mastering advanced techniques.
65
  """
66
 
67
  response = model.generate_content([full_prompt])
 
17
  # Funci贸n para obtener una t茅cnica de copywriting de manera aleatoria
18
  def get_random_copywriting_technique():
19
  techniques = [
20
+ "1. If/Then: This is one of the most commonly used opening paragraphs. Gary Halbert, one of the most important copywriters of the 20th century, used them in almost every one of his sales letters. It鈥檚 very simple, clear, and powerful. It lets people know what to expect. There鈥檚 also a very interesting belief structure that is built with this combo. If this, then that. It鈥檚 as if they need to meet some kind of prerequisite to get the benefit. An example of this would be: 'If you want to make more than $100,000 a year working just 4 hours a day, then this letter will show you how.' Very simple. If you want that, then here鈥檚 how you do it.",
21
+ "2. If / Then + Authority: Even more powerful than the 'If / Then' key is the same concept but adding a figure of authority or credibility. For example: 'If you want to know a secret way to become almost invincible in a fight... then here I鈥檒l show you what the gladiators and samurais used to do. And why you can do it too starting today.' One way to notice the power of these opening paragraphs is by removing the authority figure. In this case: the gladiators and samurais. That would change the paragraph to: 'If you want to know a secret way to become almost invincible in a fight... then here I鈥檒l show you why you can do it too starting today.' As you can see, it doesn鈥檛 have as much impact as the version with the gladiators and samurais.",
22
+ "3. Honesty: Being transparent is one of the best ways to get more customers. It also works with opening paragraphs. For example, one of Gary Halbert鈥檚 ads started like this: 'My name is Betty Adams, and the first thing you should know about me is... I鈥檓 not a doctor. I鈥檓 also not a nutrition expert. I didn鈥檛 go to college and I don鈥檛 even have a degree. In fact, the only thing I consider myself an expert in is...' And then it went to a subheading where she mentioned how she could help you lose 10 kilos in a very simple way. In this case, you can notice all the negatives she uses: 'I鈥檓 not a doctor,' 'I鈥檓 not a nutrition expert,' 'I didn鈥檛 go to school,' 'I don鈥檛 have a degree.' These four negative statements strengthen her claim about what she is. Now, this won鈥檛 always work for every sales letter. It will depend on your market and ideal customer. If your market isn鈥檛 skeptical, you don鈥檛 need to use this kind of paragraph.",
23
+ "4. Sensationalist: This one is related to the sensational headline. Here鈥檚 where you鈥檇 say something like: 'Let me tell you this strange story about a man who was arrested because he had herpes.' It鈥檚 sensationalist. And sensationalism sells. It always has and always will. Without a doubt, the paragraph is strange and makes your reader think: 'How was someone arrested for having herpes? What did he do? What happened?' It keeps them hooked, addicted to finding out more. They need to know.",
24
+ "5. Ask a Question: It makes people stop if they鈥檙e interested. One of the best opening paragraphs is this: 'Did you know that the long-term value of baseball cards is much higher than that of stocks and rare coins?' So when you talk to someone in the finance, investor, or related niches about this topic, they will be interested because it鈥檚 different and gets them ready to start the journey.",
25
+ "6. Micro Openings: This paragraph should be short. Just a few words... so they鈥檒l read the next one. This is because being brief makes it easy to read. And if you say something that puts your reader in the right mindset, this can be quite powerful. For example, if your product is targeted to a skeptical market, you can use a paragraph like the following: 'I was a total skeptic.' With this, you鈥檙e going straight to their mind, to their doubts. One that you can use effectively is: 'Imagine the following:'"
26
  ]
27
  return random.sample(techniques, k=random.randint(1, 3)) # Escoge entre 1 y 3 t茅cnicas al azar
28
 
 
58
 
59
  # Crear el prompt completo basado en los campos del frontend
60
  full_prompt = f"""
61
+ You are a creative writer skilled in the art of persuasion. The tone of the {text_type} should be {mood} and emotionally resonate with a {target_audience}. Evoke feelings of {emotionality} through relatable, real-life situations that reflect their experiences. {product_mention} {format_instruction}
62
+ Use the following copywriting techniques to write this opening paragraph: {techniques_text}.
63
+ Use persuasive techniques to guide the reader towards an intuitive understanding of the product's benefits, focusing on creating a strong emotional connection with the audience.
64
+ Create an opening paragraph for a {text_type} of {length} words in Spanish that makes {target_audience} aware they have a problem. Highlight this problem by explaining it with relatable situations tailored to their context, using a natural or conversational tone. The goal of this paragraph is to entice them to keep reading and discover what {product} is about. Use persuasion effectively in every word, mastering advanced techniques.
65
  """
66
 
67
  response = model.generate_content([full_prompt])