File size: 14,674 Bytes
1c2c598
 
 
 
 
 
 
c4eb96b
93dacff
1c2c598
93dacff
194b408
1c2c598
194b408
93dacff
 
 
194b408
93dacff
1c2c598
194b408
e4ddcc0
194b408
 
 
 
 
 
 
 
 
 
 
 
93dacff
 
 
1c2c598
93dacff
1c2c598
93dacff
1c2c598
93dacff
 
1c2c598
93dacff
 
1c2c598
194b408
 
 
 
 
1c2c598
194b408
 
 
1c2c598
194b408
 
 
 
 
1c2c598
194b408
1c2c598
194b408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c2c598
93dacff
 
 
 
 
 
 
194b408
93dacff
 
 
 
 
 
 
194b408
93dacff
 
 
194b408
93dacff
194b408
93dacff
 
 
 
 
194b408
 
93dacff
194b408
93dacff
 
 
 
 
194b408
93dacff
 
 
 
 
 
 
 
 
 
 
 
 
194b408
 
93dacff
 
 
 
 
 
 
194b408
93dacff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c2c598
e4ddcc0
1c2c598
fd2a5c0
e4ddcc0
1c2c598
 
 
 
 
194b408
1c2c598
e4ddcc0
194b408
 
1c2c598
5431ba3
cc57ab2
 
 
 
194b408
 
5431ba3
cc57ab2
194b408
 
 
 
 
 
e4ddcc0
d86f48b
5431ba3
194b408
 
 
 
5431ba3
 
 
 
 
 
 
 
 
 
 
194b408
5431ba3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cc57ab2
1c2c598
93dacff
 
 
194b408
 
5431ba3
 
 
1c2c598
194b408
 
 
 
 
 
 
 
c4eb96b
e4ddcc0
194b408
 
 
 
 
1c2c598
5431ba3
e4ddcc0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1c2c598
e4ddcc0
93dacff
d86f48b
 
 
e4ddcc0
93dacff
1c2c598
 
93dacff
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
import openai
import random
import gradio as gr
import os

openai.api_key = os.environ["OpenAPI_Key"]

manual = r"""Input your variables in the fields on the left. The last two (Extra input and Team) are optional, but recommended. You can use it to steer the prompt into a certain direction by adding more requirements.
"""

# Define the messages for step_1
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. 

The structure of the script will look like this:
- Hook
- Title
- Introduction
- 2 Learning Objectives and their execution
- Conclusion

You'll only focus on the Hook, Title and Intro. Here are instructions for each:

The hook has only two goals, it must:
1. Catch the audience's attention and convince them to watch more of the video.
2. Serve as a setup for the video's content. 

The title:
Should roughly state what will be done in the video.

The intro:
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.

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."""
UserPrompt_10 = r""""Topic of the tutorial: How to create a Job Ad with ChatGPT.
Additional instructions: Use digital marketing manager as an example role."""
AssistantPrompt_10 = r""""*HOOK*
If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords.

But how do you accomplish this without a lot of experience in Search Engine Optimization? 

Well, with ChatGPT. 

*TITLE*
Create a Job Ad with ChatGPT

*INTRO*
In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates.

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."""
UserPrompt_11 = r""""Topic of the tutorial: How to plan and create follow-up sequences for a product launch with ChatGPT.
"""
AssistantPrompt_11 = r""""*HOOK*
Imagine crafting the PERFECT follow-up sequences, effortlessly, each time you're gearing up for a product launch.  

Sounds like a dream, right?

But with ChatGPT, it's reality.   

*TITLE*
Craft Product Launch Follow-up Sequences with ChatGPT

*INTRO*
Follow-up sequences. They're like friendly nudges after a first hello, making sure you don't fade away from your clients' memory.

In this tutorial, we'll walk through how to harness ChatGPT to create efficient and effective follow-ups."""

# Define messages for stepTwo
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. 

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:

- Learning Objectives Summary
- Learning Objective 1
- Learning Objective 2
- Learning Objective 3 (this third one is optional)
- Conclusion

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.

Make sure to also include:
- the exact prompt(s) the user needs to type into ChatGPT;
- realistic sample data for a case study, if applicable."""
UserPrompt_20 = r"""Topic of the tutorial: How to create a Job Ad with ChatGPT.
Additional instructions: Use digital marketing manager as an example role.

*HOOK*
If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords.

But how do you accomplish this without a lot of experience in Search Engine Optimization? 

Well, with ChatGPT. 

*TITLE*
Create a Job Ad with ChatGPT

*INTRO*
In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates.

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."""
AssistantPrompt_20 = r"""*LEARNING OBJECTIVES SUMMARY*
You will learn how to:
-	Create an ideal job description
-	Extract SEO-friendly keywords 
-	Craft a job ad 

Let's dive right in!

*LEARNING OBJECTIVE 1*
You can't create the perfect job ad without first creating the job description. 

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.   

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.

 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.    

Let's say you've been tasked to recruit a 'Digital Marketing Manager'.

Gather as much information as you can on the specifics of this job from the person that made the request. 

For this tutorial, we’ll be using the following sample information. 

The job title is "Digital marketing manager."

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:
-	overseeing online marketing campaigns and other digital projects to optimize online brand presence and boost revenue.
-	managing a team of 3 digital marketers." 

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."

Now, we're ready to write our prompt. 

Type: 
“You are a recruiter. Create a job description for a digital marketing manager.

Here are some additional details to consider when writing the job description:”

Then, paste the details you gathered previously.

Then press the send button.


ChatGPT wrote some basic details, the overview of the role, and key responsibilities of the role. 

It also included [basic and preferred qualifications], [what's in it for the applicant], and [more instructions].

Make sure to review and revise this job description so it effectively communicates your expectations. 

*LEARNING OBJECTIVE 2*
With this description, we can proceed to extract keywords which potential candidates might use when searching for this job.

Keywords are important because they make your job ad discoverable. The best keywords should resonate with the job seekers' search behavior.

Let's get keywords from ChatGPT. 

Type:
"Provide keywords related to the role of Digital Marketing Manager based on the description you've provided me."

Then, press the send message button. 

ChatGPT came up with a couple of keywords that we can use when posting our final job ad. 

We can also incorporate these keywords into the job ad itself.

*LEARNING OBJECTIVE 3*
With our description and keywords in hand, let's craft a job ad that integrates them both seamlessly.  

Type:
"Using the job description and the keywords you've provided, draft a job ad for a Digital Marketing Manager."

 Then, press the send button.   

Here's the response. 


ChatGPT drafted a job ad that contains specific details about the job description and incorporates keywords so that it's easier to find on the internet. 

Make sure to review and revise the ad and verify that all information is accurate before posting it online. 

*CONCLUSION*
That's it!

By leveraging the power of ChatGPT-4, HR professionals can create job advertisements that stand out and attract top talent.

Remember, in the digital age of recruitment, your job ad is your first impression. So make it count!"""


# Function to make API call
def api_call(messages, temperature=0.9, model="gpt-4"):
    return openai.ChatCompletion.create(
        messages=messages,
        temperature=temperature,
        model=model
    ).choices[0].message.content


# Function to be called by Gradio interface
def process_inputs(EPA_title, Extra_input, Department):
    # Check if EPA_title is empty
    if not EPA_title:
        return manual
    if not Extra_input and not Department:
        stepOne = [
            {"role": "system", "content": SystemPrompt_10},
            {"role": "user", "content": UserPrompt_10},
            {"role": "assistant", "content": AssistantPrompt_10},
            {"role": "user", "content": UserPrompt_11},
            {"role": "assistant", "content": AssistantPrompt_11},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}"""}
        ]
        Script_1st_half = api_call(stepOne, 0.7)

        stepTwo = [
            {"role": "system", "content": SystemPrompt_20},
            {"role": "user", "content": UserPrompt_20},
            {"role": "assistant", "content": AssistantPrompt_20},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
            
                    {Script_1st_half}"""}
        ]
        Script_2nd_half = api_call(stepTwo, 0.7)
        Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
        return Script_complete
    if Extra_input and not Department:
        stepOne = [
            {"role": "system", "content": SystemPrompt_10},
            {"role": "user", "content": UserPrompt_10},
            {"role": "assistant", "content": AssistantPrompt_10},
            {"role": "user", "content": UserPrompt_11},
            {"role": "assistant", "content": AssistantPrompt_11},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title} 
                    Additional instructions: {Extra_input}"""}
        ]
        Script_1st_half = api_call(stepOne, 0.7)

        stepTwo = [
            {"role": "system", "content": SystemPrompt_20},
            {"role": "user", "content": UserPrompt_20},
            {"role": "assistant", "content": AssistantPrompt_20},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
                    Additional instructions: {Extra_input}
                    
                    {Script_1st_half}"""}
        ]
        Script_2nd_half = api_call(stepTwo, 0.7)
        Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
        return Script_complete

    if Department and not Extra_input:
        stepOne = [
            {"role": "system", "content": SystemPrompt_10},
            {"role": "user", "content": UserPrompt_10},
            {"role": "assistant", "content": AssistantPrompt_10},
            {"role": "user", "content": UserPrompt_11},
            {"role": "assistant", "content": AssistantPrompt_11},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
                    The tutorial is aimed at employees in a {Department} department."""}
        ]
        Script_1st_half = api_call(stepOne, 0.7)

        stepTwo = [
            {"role": "system", "content": SystemPrompt_20},
            {"role": "user", "content": UserPrompt_20},
            {"role": "assistant", "content": AssistantPrompt_20},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
                    The tutorial is aimed at employees in a {Department} department.

                    {Script_1st_half}"""}
        ]
        Script_2nd_half = api_call(stepTwo, 0.7)
        Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
        return Script_complete

    else: # All fields filled out
        # Step 1: User input and first API call ~5secs
        stepOne = [
            {"role": "system", "content": SystemPrompt_10},
            {"role": "user", "content": UserPrompt_10},
            {"role": "assistant", "content": AssistantPrompt_10},
            {"role": "user", "content": UserPrompt_11},
            {"role": "assistant", "content": AssistantPrompt_11},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}. 
                    Additional instructions: {Extra_input}.
                    The tutorial is aimed at employees in a {Department} department."""}
        ]
        Script_1st_half = api_call(stepOne, 0.7)

        stepTwo = [
            {"role": "system", "content": SystemPrompt_20},
            {"role": "user", "content": UserPrompt_20},
            {"role": "assistant", "content": AssistantPrompt_20},
            {"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
            Additional instructions: {Extra_input}
            The tutorial is aimed at employees in a {Department} department.

            {Script_1st_half}"""}
        ]
        Script_2nd_half = api_call(stepTwo, 0.7)
        Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
        return Script_complete


departments = {
    "3D": "3D Modeling",  # Label and value differ
    "Client Support": "Client Support",
    "Data Entry & Back Office": "Data Entry & Back Office",
    "Education Administration (ENI)": "Education Administration",  # Label and value differ
    "Finance": "Finance",
    "Marketing": "Marketing",
    "HR": "HR",
    "IT": "IT",
    "Legal": "Legal",
    "Product Management": "Product Management",
    "Project Management/Coordination": "Project Management/Coordination",
    "Process Management": "Process Management",
    "QA": "QA",
    "R&D": "R&D",
    "Sales": "Sales",
    "Software": "Software",
    "Video Production": "Video Production",
    "Visual Management": "Visual Management"
}

# Create the Gradio interface
iface = gr.Interface(
    fn=process_inputs,
    inputs=[
        gr.Textbox(lines=2, label='EPA description here... (use the phrasing: "How to do X using ChatGPT")'),
        gr.Textbox(lines=2, label='Extra input here... (optional, put any extra requirements or relevant context)'),
        gr.Dropdown(choices=departments, label="Select team", searchable=True)
    ],
    outputs=gr.Textbox(label="Script", show_copy_button=True)
)

iface.launch(share=True)
iface.launch()