Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,21 +9,29 @@ manual = r"""Input your variables in the fields on the left. The last one (Extra
|
|
| 9 |
"""
|
| 10 |
|
| 11 |
# Define the messages for step_1
|
| 12 |
-
SystemPrompt_10 = r""""You are a script writer and prompt engineer creating engaging YouTube tutorial scripts on how to use ChatGPT for
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
When creating the script, please follow this structure:
|
| 17 |
- Hook
|
| 18 |
- Title
|
| 19 |
- Introduction
|
| 20 |
-
- Learning Objectives
|
| 21 |
-
- Learning Objective 1
|
| 22 |
-
- Learning Objective 2
|
| 23 |
- Conclusion
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
Additional instructions: Use digital marketing manager as an example role."""
|
| 28 |
AssistantPrompt_10 = r""""*HOOK*
|
| 29 |
If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords.
|
|
@@ -38,16 +46,62 @@ Create a Job Ad with ChatGPT
|
|
| 38 |
*INTRO*
|
| 39 |
In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates.
|
| 40 |
|
| 41 |
-
Today, we'll show you how to use ChatGPT to create a job ad that not only resonates with your ideal candidates, but also ranks high with SEO-friendly keywords.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
Let's dive right in!
|
| 53 |
|
|
@@ -56,7 +110,7 @@ You can't create the perfect job ad without first creating the job description.
|
|
| 56 |
|
| 57 |
Creating a comprehensive job description is critical for attracting the right candidates, setting expectations, and ensuring both the employee and employer understand the role's responsibilities.
|
| 58 |
|
| 59 |
-
To create a basic job description, you
|
| 60 |
|
| 61 |
It's also preferable to already identify any other details about the role, like qualifications and skills, experience level, salary and benefits, reporting structure, and working hours.
|
| 62 |
|
|
@@ -64,33 +118,32 @@ Let's say you've been tasked to recruit a 'Digital Marketing Manager'.
|
|
| 64 |
|
| 65 |
Gather as much information as you can on the specifics of this job from the person that made the request.
|
| 66 |
|
| 67 |
-
For this tutorial, we
|
| 68 |
-
|
| 69 |
|
| 70 |
The job title is "Digital marketing manager."
|
| 71 |
|
| 72 |
-
|
| 73 |
- overseeing online marketing campaigns and other digital projects to optimize online brand presence and boost revenue.
|
| 74 |
-
-
|
| 75 |
|
| 76 |
The key responsibilities of the role are "propose and execute digital marketing strategies, manage and oversee digital channels, monitor and measure ROI and KPIs of online campaigns."
|
| 77 |
|
| 78 |
Now, we're ready to write our prompt.
|
| 79 |
|
| 80 |
-
Type:
|
| 81 |
-
|
| 82 |
|
| 83 |
-
Here are some additional details to consider when writing the job description
|
| 84 |
|
| 85 |
Then, paste the details you gathered previously.
|
| 86 |
|
| 87 |
Then press the send button.
|
| 88 |
|
|
|
|
| 89 |
ChatGPT wrote some basic details, the overview of the role, and key responsibilities of the role.
|
| 90 |
|
| 91 |
It also included [basic and preferred qualifications], [what's in it for the applicant], and [more instructions].
|
| 92 |
|
| 93 |
-
|
| 94 |
Make sure to review and revise this job description so it effectively communicates your expectations.
|
| 95 |
|
| 96 |
*LEARNING OBJECTIVE 2*
|
|
@@ -100,7 +153,8 @@ Keywords are important because they make your job ad discoverable. The best keyw
|
|
| 100 |
|
| 101 |
Let's get keywords from ChatGPT.
|
| 102 |
|
| 103 |
-
Type
|
|
|
|
| 104 |
|
| 105 |
Then, press the send message button.
|
| 106 |
|
|
@@ -108,10 +162,10 @@ ChatGPT came up with a couple of keywords that we can use when posting our final
|
|
| 108 |
|
| 109 |
We can also incorporate these keywords into the job ad itself.
|
| 110 |
|
|
|
|
| 111 |
With our description and keywords in hand, let's craft a job ad that integrates them both seamlessly.
|
| 112 |
|
| 113 |
Type:
|
| 114 |
-
|
| 115 |
"Using the job description and the keywords you've provided, draft a job ad for a Digital Marketing Manager."
|
| 116 |
|
| 117 |
Then, press the send button.
|
|
@@ -130,7 +184,6 @@ By leveraging the power of ChatGPT-4, HR professionals can create job advertisem
|
|
| 130 |
|
| 131 |
Remember, in the digital age of recruitment, your job ad is your first impression. So make it count!"""
|
| 132 |
|
| 133 |
-
|
| 134 |
# Function to make API call
|
| 135 |
def api_call(messages, temperature=0.9, model="gpt-4"):
|
| 136 |
return openai.ChatCompletion.create(
|
|
@@ -139,34 +192,58 @@ def api_call(messages, temperature=0.9, model="gpt-4"):
|
|
| 139 |
model=model
|
| 140 |
).choices[0].message.content
|
| 141 |
|
|
|
|
| 142 |
# Function to be called by Gradio interface
|
| 143 |
def process_inputs(EPA_title, Department, Extra_input):
|
| 144 |
-
# Check if EPA_title
|
| 145 |
-
if not EPA_title
|
| 146 |
return manual
|
| 147 |
if not Extra_input:
|
| 148 |
stepOne = [
|
| 149 |
{"role": "system", "content": SystemPrompt_10},
|
| 150 |
{"role": "user", "content": UserPrompt_10},
|
| 151 |
{"role": "assistant", "content": AssistantPrompt_10},
|
| 152 |
-
{"role": "user", "content":
|
| 153 |
-
|
|
|
|
| 154 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
else:
|
| 156 |
# Step 1: User input and first API call ~5secs
|
| 157 |
stepOne = [
|
| 158 |
{"role": "system", "content": SystemPrompt_10},
|
| 159 |
{"role": "user", "content": UserPrompt_10},
|
| 160 |
{"role": "assistant", "content": AssistantPrompt_10},
|
| 161 |
-
{"role": "user", "content":
|
| 162 |
-
|
| 163 |
-
|
|
|
|
| 164 |
]
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
# Create the Gradio interface
|
| 172 |
iface = gr.Interface(
|
|
|
|
| 9 |
"""
|
| 10 |
|
| 11 |
# Define the messages for step_1
|
| 12 |
+
SystemPrompt_10 = r""""You are a script writer and prompt engineer creating engaging YouTube tutorial scripts on how to use ChatGPT for specific tasks in a corporate environment.
|
| 13 |
|
| 14 |
+
The structure of the script will look like this:
|
|
|
|
|
|
|
| 15 |
- Hook
|
| 16 |
- Title
|
| 17 |
- Introduction
|
| 18 |
+
- 2 Learning Objectives and their execution
|
|
|
|
|
|
|
| 19 |
- Conclusion
|
| 20 |
|
| 21 |
+
You'll only focus on the Hook, Title and Intro. Here are instructions for each:
|
| 22 |
+
|
| 23 |
+
The hook has only two goals, it must:
|
| 24 |
+
1. Catch the audience's attention and convince them to watch more of the video.
|
| 25 |
+
2. Serve as a setup for the video's content.
|
| 26 |
+
|
| 27 |
+
The title:
|
| 28 |
+
Should roughly state what will be done in the video.
|
| 29 |
+
|
| 30 |
+
The intro:
|
| 31 |
+
Usually consists of three sentences. The first two sentences give an overview of the task being performed. The third sentence mentions how the tutorial will show the viewer how ChatGPT can expedite that task.
|
| 32 |
+
|
| 33 |
+
Sometimes additional instructions are given. These could be incorporated in the hook, title and/or intro if relevant, but often they should be ignored, if they apply to the learning objectives - which are outside the scope of your current task."""
|
| 34 |
+
UserPrompt_10 = r""""Topic of the tutorial: How to create a Job Ad with ChatGPT.
|
| 35 |
Additional instructions: Use digital marketing manager as an example role."""
|
| 36 |
AssistantPrompt_10 = r""""*HOOK*
|
| 37 |
If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords.
|
|
|
|
| 46 |
*INTRO*
|
| 47 |
In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates.
|
| 48 |
|
| 49 |
+
Today, we'll show you how to use ChatGPT to create a job ad that not only resonates with your ideal candidates, but also ranks high with SEO-friendly keywords."""
|
| 50 |
+
UserPrompt_11 = r""""Topic of the tutorial: How to plan and create follow-up sequences for a product launch with ChatGPT.
|
| 51 |
+
"""
|
| 52 |
+
AssistantPrompt_11 = r""""*HOOK*
|
| 53 |
+
Imagine crafting the PERFECT follow-up sequences, effortlessly, each time you're gearing up for a product launch.
|
| 54 |
|
| 55 |
+
Sounds like a dream, right?
|
| 56 |
+
|
| 57 |
+
But with ChatGPT, it's reality.
|
| 58 |
|
| 59 |
+
*TITLE*
|
| 60 |
+
Craft Product Launch Follow-up Sequences with ChatGPT
|
| 61 |
+
|
| 62 |
+
*INTRO*
|
| 63 |
+
Follow-up sequences. They're like friendly nudges after a first hello, making sure you don't fade away from your clients' memory.
|
| 64 |
|
| 65 |
+
In this tutorial, we'll walk through how to harness ChatGPT to create efficient and effective follow-ups."""
|
| 66 |
|
| 67 |
+
# Define messages for stepTwo
|
| 68 |
+
SystemPrompt_20 = r"""You are a script writer and prompt engineer creating engaging YouTube tutorial scripts on how to use ChatGPT for specific tasks in a corporate environment.
|
| 69 |
+
|
| 70 |
+
Given some instructions, a hook, a title, and an introduction, you design the execution part of the script. Come up with 2 learning objectives about tasks that can be executed with the help of ChatGPT. This is the structure you'll follow:
|
| 71 |
+
|
| 72 |
+
- Learning Objectives Summary
|
| 73 |
+
- Learning Objective 1
|
| 74 |
+
- Learning Objective 2
|
| 75 |
+
- Learning Objective 3 (this third one is optional)
|
| 76 |
+
- Conclusion
|
| 77 |
+
|
| 78 |
+
The learning objectives state the specific learning objectives that will be covered in the tutorial. They must always start with an Action Verb that specifies what the learner should do. Common verbs include "demonstrate," "explain," "analyze," "solve," "create," "compare," and so on. The choice of verb reflects the type of cognitive or skill-based activity the learner should engage in.
|
| 79 |
+
|
| 80 |
+
Make sure to also include:
|
| 81 |
+
- the exact prompt(s) the user needs to type into ChatGPT;
|
| 82 |
+
- realistic sample data for a case study, if applicable."""
|
| 83 |
+
UserPrompt_20 = r"""Topic of the tutorial: How to create a Job Ad with ChatGPT.
|
| 84 |
+
Additional instructions: Use digital marketing manager as an example role.
|
| 85 |
+
|
| 86 |
+
*HOOK*
|
| 87 |
+
If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords.
|
| 88 |
+
|
| 89 |
+
But how do you accomplish this without a lot of experience in Search Engine Optimization?
|
| 90 |
+
|
| 91 |
+
Well, with ChatGPT.
|
| 92 |
+
|
| 93 |
+
*TITLE*
|
| 94 |
+
Create a Job Ad with ChatGPT
|
| 95 |
+
|
| 96 |
+
*INTRO*
|
| 97 |
+
In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates.
|
| 98 |
+
|
| 99 |
+
Today, we'll show you how to use ChatGPT to create a job ad that not only resonates with your ideal candidates, but also ranks high with SEO-friendly keywords."""
|
| 100 |
+
AssistantPrompt_20 = r"""*LEARNING OBJECTIVES SUMMARY*
|
| 101 |
+
You will learn how to:
|
| 102 |
+
- Create an ideal job description
|
| 103 |
+
- Extract SEO-friendly keywords
|
| 104 |
+
- Craft a job ad
|
| 105 |
|
| 106 |
Let's dive right in!
|
| 107 |
|
|
|
|
| 110 |
|
| 111 |
Creating a comprehensive job description is critical for attracting the right candidates, setting expectations, and ensuring both the employee and employer understand the role's responsibilities.
|
| 112 |
|
| 113 |
+
To create a basic job description, you at least need to define the job title, the overview of the role, and the role's key responsibilities.
|
| 114 |
|
| 115 |
It's also preferable to already identify any other details about the role, like qualifications and skills, experience level, salary and benefits, reporting structure, and working hours.
|
| 116 |
|
|
|
|
| 118 |
|
| 119 |
Gather as much information as you can on the specifics of this job from the person that made the request.
|
| 120 |
|
| 121 |
+
For this tutorial, we’ll be using the following sample information.
|
|
|
|
| 122 |
|
| 123 |
The job title is "Digital marketing manager."
|
| 124 |
|
| 125 |
+
Here's an overview of the role: "The digital marketing manager is responsible for managing the overall digital marketing strategy of xpedite.ai. He/she is also responsible for:
|
| 126 |
- overseeing online marketing campaigns and other digital projects to optimize online brand presence and boost revenue.
|
| 127 |
+
- managing a team of 3 digital marketers."
|
| 128 |
|
| 129 |
The key responsibilities of the role are "propose and execute digital marketing strategies, manage and oversee digital channels, monitor and measure ROI and KPIs of online campaigns."
|
| 130 |
|
| 131 |
Now, we're ready to write our prompt.
|
| 132 |
|
| 133 |
+
Type:
|
| 134 |
+
“You are a recruiter. Create a job description for a digital marketing manager.
|
| 135 |
|
| 136 |
+
Here are some additional details to consider when writing the job description:”
|
| 137 |
|
| 138 |
Then, paste the details you gathered previously.
|
| 139 |
|
| 140 |
Then press the send button.
|
| 141 |
|
| 142 |
+
|
| 143 |
ChatGPT wrote some basic details, the overview of the role, and key responsibilities of the role.
|
| 144 |
|
| 145 |
It also included [basic and preferred qualifications], [what's in it for the applicant], and [more instructions].
|
| 146 |
|
|
|
|
| 147 |
Make sure to review and revise this job description so it effectively communicates your expectations.
|
| 148 |
|
| 149 |
*LEARNING OBJECTIVE 2*
|
|
|
|
| 153 |
|
| 154 |
Let's get keywords from ChatGPT.
|
| 155 |
|
| 156 |
+
Type:
|
| 157 |
+
"Provide keywords related to the role of Digital Marketing Manager based on the description you've provided me."
|
| 158 |
|
| 159 |
Then, press the send message button.
|
| 160 |
|
|
|
|
| 162 |
|
| 163 |
We can also incorporate these keywords into the job ad itself.
|
| 164 |
|
| 165 |
+
*LEARNING OBJECTIVE 3*
|
| 166 |
With our description and keywords in hand, let's craft a job ad that integrates them both seamlessly.
|
| 167 |
|
| 168 |
Type:
|
|
|
|
| 169 |
"Using the job description and the keywords you've provided, draft a job ad for a Digital Marketing Manager."
|
| 170 |
|
| 171 |
Then, press the send button.
|
|
|
|
| 184 |
|
| 185 |
Remember, in the digital age of recruitment, your job ad is your first impression. So make it count!"""
|
| 186 |
|
|
|
|
| 187 |
# Function to make API call
|
| 188 |
def api_call(messages, temperature=0.9, model="gpt-4"):
|
| 189 |
return openai.ChatCompletion.create(
|
|
|
|
| 192 |
model=model
|
| 193 |
).choices[0].message.content
|
| 194 |
|
| 195 |
+
|
| 196 |
# Function to be called by Gradio interface
|
| 197 |
def process_inputs(EPA_title, Department, Extra_input):
|
| 198 |
+
# Check if EPA_title is empty
|
| 199 |
+
if not EPA_title:
|
| 200 |
return manual
|
| 201 |
if not Extra_input:
|
| 202 |
stepOne = [
|
| 203 |
{"role": "system", "content": SystemPrompt_10},
|
| 204 |
{"role": "user", "content": UserPrompt_10},
|
| 205 |
{"role": "assistant", "content": AssistantPrompt_10},
|
| 206 |
+
{"role": "user", "content": UserPrompt_11},
|
| 207 |
+
{"role": "assistant", "content": AssistantPrompt_11},
|
| 208 |
+
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}"""}
|
| 209 |
]
|
| 210 |
+
Script_1st_half = api_call(stepOne, 0.7)
|
| 211 |
+
|
| 212 |
+
stepTwo = [
|
| 213 |
+
{"role": "system", "content": SystemPrompt_20},
|
| 214 |
+
{"role": "user", "content": UserPrompt_20},
|
| 215 |
+
{"role": "assistant", "content": AssistantPrompt_20},
|
| 216 |
+
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}"""}
|
| 217 |
+
]
|
| 218 |
+
Script_2nd_half = api_call(stepTwo, 0.7)
|
| 219 |
+
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
| 220 |
+
return Script_complete
|
| 221 |
+
|
| 222 |
else:
|
| 223 |
# Step 1: User input and first API call ~5secs
|
| 224 |
stepOne = [
|
| 225 |
{"role": "system", "content": SystemPrompt_10},
|
| 226 |
{"role": "user", "content": UserPrompt_10},
|
| 227 |
{"role": "assistant", "content": AssistantPrompt_10},
|
| 228 |
+
{"role": "user", "content": UserPrompt_11},
|
| 229 |
+
{"role": "assistant", "content": AssistantPrompt_11},
|
| 230 |
+
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 231 |
+
Additional instructions: {Extra_input}"""}
|
| 232 |
]
|
| 233 |
+
Script_1st_half = api_call(stepOne, 0.7)
|
| 234 |
+
|
| 235 |
+
stepTwo = [
|
| 236 |
+
{"role": "system", "content": SystemPrompt_20},
|
| 237 |
+
{"role": "user", "content": UserPrompt_20},
|
| 238 |
+
{"role": "assistant", "content": AssistantPrompt_20},
|
| 239 |
+
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 240 |
+
Additional instructions: {Extra_input}
|
| 241 |
+
|
| 242 |
+
{Script_1st_half}"""}
|
| 243 |
+
]
|
| 244 |
+
Script_2nd_half = api_call(stepTwo, 0.7)
|
| 245 |
+
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
| 246 |
+
return Script_complete
|
| 247 |
|
| 248 |
# Create the Gradio interface
|
| 249 |
iface = gr.Interface(
|