willn9 commited on
Commit
f0ec0e9
·
verified ·
1 Parent(s): e3d46bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -12,11 +12,11 @@ def respond(
12
  message,
13
  history: list[tuple[str, str]],
14
  system_message,
15
- customer_profile,
16
- customer_goals,
17
- company_solution,
18
- main_topic,
19
- ask_for_topic_suggestions,
20
  max_tokens,
21
  temperature,
22
  top_p,
@@ -24,15 +24,15 @@ def respond(
24
  # Construct the system message with additional inputs
25
  enhanced_system_message = (
26
  f"{system_message}\n\n"
27
- f"Customer Profile: {customer_profile}\n"
28
- f"Customer Goals, Pain Points, Obstacles, Wishes and Preferences: {customer_goals}\n"
29
- f"Company solutions, products or services, value proposition and differentiators to solve customer problem: {company_solution}\n"
30
- f"Main Topic: {main_topic}\n"
31
  )
32
 
33
- # If the user wants topic suggestions, modify the prompt
34
- if ask_for_topic_suggestions:
35
- enhanced_system_message += "The user is also asking for topic suggestions to address their customer's needs."
36
 
37
  messages = [{"role": "system", "content": enhanced_system_message}]
38
 
@@ -65,20 +65,20 @@ demo = gr.ChatInterface(
65
  respond,
66
  additional_inputs=[
67
  gr.Textbox(
68
- value="You are a friendly Chatbot, a digital marketing expert and a talented copywriter. You are trying to help a user write a creative post to improve their SEO based on their input.",
69
  label="Instructions to Bot",
70
  ),
71
- gr.Textbox(label="Your Customer Profile", placeholder="Describe your customer profile (e.g., age, interests, profession)"),
72
  gr.Textbox(
73
- label="Customer Goals, Pain Points, Obstacles, Wishes and Preferences",
74
- placeholder="Describe your customer's goals, pain points, concerns, obstacles, wishes, and preferences",
75
  ),
76
  gr.Textbox(
77
- label="Company solutions, products or services",
78
- placeholder="Describe your company's Company solutions, product or services, value proposition and differentiators to solve customer problems",
79
  ),
80
- gr.Textbox(label="Main Topic", placeholder="Enter the main topic of the post"),
81
- gr.Checkbox(label="Ask for Topic Suggestions", value=False),
82
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
83
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
84
  gr.Slider(
@@ -89,8 +89,8 @@ demo = gr.ChatInterface(
89
  label="Top-p (nucleus sampling)",
90
  ),
91
  ],
92
- title="SEO Assistant",
93
- description="This app provides customized content that resonates with your customers to improve your SEO. Based on your input. Powered by Hugging Face Inference, Design Thinking, and domain expertise. Expand Additional Inputs by clicking on the arrow, input more details about your customers, then a message describing what you need the assistant to do for you. Developed by wn. Disclaimer: AI can make mistakes. Use with caution and at your own risk!",
94
  )
95
 
96
 
 
12
  message,
13
  history: list[tuple[str, str]],
14
  system_message,
15
+ segment_profile,
16
+ value_proposition,
17
+ promotion,
18
+ subject,
19
+ ask_for_subject_suggestions,
20
  max_tokens,
21
  temperature,
22
  top_p,
 
24
  # Construct the system message with additional inputs
25
  enhanced_system_message = (
26
  f"{system_message}\n\n"
27
+ f"Segment Profile: {segment_profile}\n"
28
+ f"Value Proposition: {value_proposition}\n"
29
+ f"Goal and Promotion: {promotion}\n"
30
+ f"Subject Line: {subject}\n"
31
  )
32
 
33
+ # If the user wants Subject Line suggestions, modify the prompt
34
+ if ask_for_subject_suggestions:
35
+ enhanced_system_message += "The user is also asking for subject line suggestion to catch their customer's attention and improve Email Open Rate."
36
 
37
  messages = [{"role": "system", "content": enhanced_system_message}]
38
 
 
65
  respond,
66
  additional_inputs=[
67
  gr.Textbox(
68
+ value="You are a friendly Chatbot, a digital marketing expert and a talented copywriter. You are trying to help a user write a creative email that can achieve campaign goals, a high Open Rate, CTR and conversion rate - based on user input.",
69
  label="Instructions to Bot",
70
  ),
71
+ gr.Textbox(label="Your Target Customer Segment Profile", placeholder="Describe the profile of your target customer segment (e.g., age, gender, interests, profession)"),
72
  gr.Textbox(
73
+ label="Your Value Proposition",
74
+ placeholder="Describe how your solution to customer problems offers them unique value",
75
  ),
76
  gr.Textbox(
77
+ label="Campaign Goal, Special Event, Promotion and Call to Action",
78
+ placeholder="Describe your campaign goal, a special event, promotion and Call to Action that you hope your target segment will act upon",
79
  ),
80
+ gr.Textbox(label="Subject Line", placeholder="Enter the Subject Line of the Email or ask for suggestions"),
81
+ gr.Checkbox(label="Ask for Subject Line Suggestions", value=False),
82
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
83
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
84
  gr.Slider(
 
89
  label="Top-p (nucleus sampling)",
90
  ),
91
  ],
92
+ title="Email Copywriter",
93
+ description="This app creates a customized email that resonates with your customers to improve CTR and conversion. Based on your input. Powered by Hugging Face Inference, Design Thinking, and domain expertise. Expand Additional Inputs by clicking on the arrow, input more details about your customers, then a message describing what you need the assistant to do for you. Developed by wn. Disclaimer: AI makes mistakes. Use with caution and at your own risk!",
94
  )
95
 
96