Kunaal Naik commited on
Commit
ef3d008
·
1 Parent(s): 89a59ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +52 -7
app.py CHANGED
@@ -11,7 +11,7 @@ Each person in the niche of {target_audience} has certain struggles that make it
11
  These are called Pain Points. There's a recipe for getting to the core of the Pain Points of {target_audience}. \
12
  Namely, answer each of these Questions 3 times, each getting deeper in the issues of {target_audience}, \
13
  appealing to their Emotions and uncertainties related to {target_course}. \
14
- The Questions (answer each QUESTION 3 tiems in listicle format according to the instructions):\
15
  1. What keeps them awake at night?\
16
  2. What are they afraid of?\
17
  3. What are they angry about?\
@@ -22,7 +22,18 @@ Each person in the niche of {target_audience} has certain struggles that make it
22
  These are called Pain Points. There's a recipe for getting to the core of the Pain Points of {target_audience}. \
23
  Namely, answer each of these Questions 3 times, each getting deeper in the issues of {target_audience}, \
24
  appealing to their Emotions and uncertainties related to {target_course}. \
25
- The Questions (answer each QUESTION 3 tiems in listicle format according to the instructions):\
 
 
 
 
 
 
 
 
 
 
 
26
  1. What keeps them awake at night?\
27
  2. What are they afraid of?\
28
  3. What are they angry about?\
@@ -36,7 +47,19 @@ prompt1 = PromptTemplate(
36
  template=template1_cust_pain_point,
37
  )
38
 
39
- chain = LLMChain(llm=OpenAI(), prompt=prompt1)
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  #target_audience = "professionals looking for course on Power BI"
42
  #my_course = "Zero to Hero in PowerBI"
@@ -55,8 +78,8 @@ if st.sidebar.button("Get response"):
55
  with st.spinner("Generating response..."):
56
  with st.expander("Show prompt", expanded=False):
57
  st.info(prompt1.template)
58
- answer = chain.run({"target_audience": target_audience, "target_course": target_course})
59
- st.write(answer)
60
  elif target_audience:
61
  st.error("Enter your course/service name")
62
  elif my_course:
@@ -65,10 +88,32 @@ if st.sidebar.button("Get response"):
65
  st.error("No input detected, Please provide the desired information.")
66
 
67
  with tab2:
68
- st.write(answer)
 
 
 
 
 
 
 
 
 
 
 
69
 
70
  with tab3:
71
- st.write(answer)
 
 
 
 
 
 
 
 
 
 
 
72
 
73
 
74
 
 
11
  These are called Pain Points. There's a recipe for getting to the core of the Pain Points of {target_audience}. \
12
  Namely, answer each of these Questions 3 times, each getting deeper in the issues of {target_audience}, \
13
  appealing to their Emotions and uncertainties related to {target_course}. \
14
+ The Questions (answer each QUESTION 1 times in listicle format according to the instructions):\
15
  1. What keeps them awake at night?\
16
  2. What are they afraid of?\
17
  3. What are they angry about?\
 
22
  These are called Pain Points. There's a recipe for getting to the core of the Pain Points of {target_audience}. \
23
  Namely, answer each of these Questions 3 times, each getting deeper in the issues of {target_audience}, \
24
  appealing to their Emotions and uncertainties related to {target_course}. \
25
+ The Questions (answer each QUESTION 2 times in listicle format according to the instructions):\
26
+ 1. What keeps them awake at night?\
27
+ 2. What are they afraid of?\
28
+ 3. What are they angry about?\
29
+ "
30
+
31
+ template3_customer_persona = "You are an expert researcher. You\'ve talked to hundreds of {target_audience}. \
32
+ Each person in the niche of {target_audience} has certain struggles that make it easier to sell {target_course}. \
33
+ These are called Pain Points. There's a recipe for getting to the core of the Pain Points of {target_audience}. \
34
+ Namely, answer each of these Questions 3 times, each getting deeper in the issues of {target_audience}, \
35
+ appealing to their Emotions and uncertainties related to {target_course}. \
36
+ The Questions (answer each QUESTION 3 times in listicle format according to the instructions):\
37
  1. What keeps them awake at night?\
38
  2. What are they afraid of?\
39
  3. What are they angry about?\
 
47
  template=template1_cust_pain_point,
48
  )
49
 
50
+ prompt2 = PromptTemplate(
51
+ input_variables = ["target_audience", "target_course"],
52
+ template=template2_linkedin_profile,
53
+ )
54
+
55
+ prompt3 = PromptTemplate(
56
+ input_variables = ["target_audience", "target_course"],
57
+ template=template3_customer_persona,
58
+ )
59
+
60
+ chain1 = LLMChain(llm=OpenAI(), prompt=prompt1)
61
+ chain2 = LLMChain(llm=OpenAI(), prompt=prompt2)
62
+ chain3 = LLMChain(llm=OpenAI(), prompt=prompt3)
63
 
64
  #target_audience = "professionals looking for course on Power BI"
65
  #my_course = "Zero to Hero in PowerBI"
 
78
  with st.spinner("Generating response..."):
79
  with st.expander("Show prompt", expanded=False):
80
  st.info(prompt1.template)
81
+ answer1 = chain1.run({"target_audience": target_audience, "target_course": target_course})
82
+ st.write(answer1)
83
  elif target_audience:
84
  st.error("Enter your course/service name")
85
  elif my_course:
 
88
  st.error("No input detected, Please provide the desired information.")
89
 
90
  with tab2:
91
+ if target_audience and target_course:
92
+ with st.spinner("Generating response..."):
93
+ with st.expander("Show prompt", expanded=False):
94
+ st.info(prompt2.template)
95
+ answer2 = chain2.run({"target_audience": target_audience, "target_course": target_course})
96
+ st.write(answer2)
97
+ elif target_audience:
98
+ st.error("Enter your course/service name")
99
+ elif my_course:
100
+ st.error("Enter your target audience")
101
+ else:
102
+ st.error("No input detected, Please provide the desired information.")
103
 
104
  with tab3:
105
+ if target_audience and target_course:
106
+ with st.spinner("Generating response..."):
107
+ with st.expander("Show prompt", expanded=False):
108
+ st.info(prompt3.template)
109
+ answer3 = chain3.run({"target_audience": target_audience, "target_course": target_course})
110
+ st.write(answer3)
111
+ elif target_audience:
112
+ st.error("Enter your course/service name")
113
+ elif my_course:
114
+ st.error("Enter your target audience")
115
+ else:
116
+ st.error("No input detected, Please provide the desired information.")
117
 
118
 
119