Spaces:
Running
Running
Changed app.py, made it into a form
Browse files
app.py
CHANGED
@@ -1,409 +1,659 @@
|
|
1 |
-
import
|
2 |
import random
|
3 |
import gradio as gr
|
4 |
import os
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
|
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 |
-
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:
|
15 |
-
|
16 |
-
- Learning Objectives Summary
|
17 |
-
- Learning Objective 1
|
18 |
-
- Learning Objective 2
|
19 |
-
- Learning Objective 3 (this third one is optional)
|
20 |
-
- Conclusion
|
21 |
-
|
22 |
-
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.
|
23 |
-
|
24 |
-
Make sure to also include:
|
25 |
-
- the exact prompt(s) the user needs to type into ChatGPT. These prompts need to be automatic prompts and follow best practices for prompt engineering like "define a role (you are an expert marketer, you are an expert recruiter) " and "provide necessary context." The first prompt always needs to be an automatic prompt, and end with "Ask me as many questions as you need until you have enough information to provide me with the desired output.";
|
26 |
-
- realistic sample data for a case study, if applicable;
|
27 |
-
- for every learning objective, explanations of concepts that the audience may not understand. """
|
28 |
-
|
29 |
-
UserPrompt_10 = r""""Task: Crafting product update checklists on product updates and new features for customer onboarding
|
30 |
-
Task Description: Review the latest product updates and new features, ensuring a comprehensive understanding of their functionalities and benefits.
|
31 |
-
Create detailed checklists that outline step-by-step procedures for clients to effectively integrate and utilize these updates and features in their existing systems or processes.
|
32 |
-
Ensure the checklists are clear, user-friendly, and tailored to support customers of varying technical proficiency, facilitating smooth onboarding and optimal use of the new product capabilities.
|
33 |
-
Additional instructions: The tutorial is aimed at employees in a Client Support department."
|
34 |
-
|
35 |
-
HOOK:
|
36 |
-
If you're in client support, you know how tricky it can be to explain new product features to a wide range of customers. Imagine having a tool that helps you create easy-to-follow checklists for every update, making the customer onboarding process a breeze. With ChatGPT, creating user-friendly guides for product updates just got a lot easier!
|
37 |
-
|
38 |
-
TITLE:
|
39 |
-
Create Easy-to-Follow Product Update Checklists with ChatGPT: A Guide for Client Support Teams
|
40 |
-
|
41 |
-
INTRO:
|
42 |
-
Hello there, Client Support team members! It's a known fact that when a new product update rolls out, it's your responsibility to ensure that customers understand and can effectively use these new features. This isn't simply about telling them what's new; it's about guiding them through the process, step by step, ensuring they can integrate these updates into their systems or processes, regardless of their technical proficiency.
|
43 |
-
|
44 |
-
But how do you create clear, user-friendly checklists that cater to customers with varying levels of expertise? That's where ChatGPT comes in. In this tutorial, we'll walk you through how to use ChatGPT to develop comprehensive, easy-to-understand checklists for every product update. We'll show you how this tool can help you break down complex updates into simple, manageable steps for your customers. Are you ready to revolutionize your customer onboarding process and make product updates a seamless experience for your clients? Let's get started!"""
|
45 |
-
|
46 |
-
AssistantPrompt_10 = r""""*LEARNING OBJECTIVES SUMMARY*
|
47 |
-
You will learn how to:
|
48 |
-
- Create an ideal job description
|
49 |
-
- Extract SEO-friendly keywords
|
50 |
-
- Craft a job ad
|
51 |
-
|
52 |
-
Let's dive right in!
|
53 |
-
|
54 |
-
*LEARNING OBJECTIVE 1*
|
55 |
-
First, let's create the ideal job description. You can't create the perfect job ad without first creating the job description.
|
56 |
-
|
57 |
-
A job description is a document that outlines the key responsibilities, qualifications, and skills required for a specific role, along with details about working conditions and reporting relationships.
|
58 |
-
|
59 |
-
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.
|
60 |
-
|
61 |
-
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.
|
62 |
-
|
63 |
-
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.
|
64 |
-
|
65 |
-
Let's say you've been tasked to recruit a 'Digital Marketing Manager'.
|
66 |
-
|
67 |
-
Gather as much information as you can on the specifics of this job from the person that made the request.
|
68 |
-
|
69 |
-
For this tutorial, we’ll be using the following sample information.
|
70 |
-
|
71 |
-
The job title is "Digital marketing manager."
|
72 |
-
|
73 |
-
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:
|
74 |
-
- overseeing online marketing campaigns and other digital projects to optimize online brand presence and boost revenue.
|
75 |
-
- managing a team of 3 digital marketers."
|
76 |
-
|
77 |
-
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."
|
78 |
-
|
79 |
-
Now, we're ready to write our prompt.
|
80 |
-
|
81 |
-
Type:
|
82 |
-
“You are an expert recruiter. Your current task is to 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.)
|
83 |
-
|
84 |
-
Ask me as many questions as you need until you have enough information to provide me with the desired output."
|
85 |
-
|
86 |
-
Then press the send button.
|
87 |
-
|
88 |
-
|
89 |
-
ChatGPT asked relevant questions until it had enough information to come up with the desired output.
|
90 |
-
|
91 |
-
Make sure to review and revise this job description so it effectively communicates your expectations.
|
92 |
-
|
93 |
-
*LEARNING OBJECTIVE 2*
|
94 |
-
Now, we're ready to extract SEO-friendly keywords. With this description, we can proceed to extract keywords which potential candidates might use when searching for this job.
|
95 |
-
|
96 |
-
Keywords are important because they make your job ad discoverable. The best keywords should resonate with the job seekers' search behavior.
|
97 |
-
|
98 |
-
Let's get keywords from ChatGPT.
|
99 |
-
|
100 |
-
Type:
|
101 |
-
"Provide keywords related to the role of Digital Marketing Manager based on the description you've provided me."
|
102 |
-
|
103 |
-
Then, press the send message button.
|
104 |
-
|
105 |
-
ChatGPT came up with a couple of keywords that we can use when posting our final job ad.
|
106 |
-
|
107 |
-
We can also incorporate these keywords into the job ad itself.
|
108 |
-
|
109 |
-
*LEARNING OBJECTIVE 3*
|
110 |
-
Finally, let's craft a job ad. With our description and keywords in hand, let's craft a job ad that integrates them both seamlessly.
|
111 |
-
|
112 |
-
Type:
|
113 |
-
"Using the job description and the keywords you've provided, draft a job ad for a Digital Marketing Manager."
|
114 |
-
|
115 |
-
Then, press the send button.
|
116 |
-
|
117 |
-
Here's the response.
|
118 |
-
|
119 |
-
|
120 |
-
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.
|
121 |
-
|
122 |
-
Make sure to review and revise the ad and verify that all information is accurate before posting it online.
|
123 |
-
|
124 |
-
*CONCLUSION*
|
125 |
-
That's it!
|
126 |
-
|
127 |
-
By leveraging the power of ChatGPT-4, HR professionals can create job advertisements that stand out and attract top talent.
|
128 |
-
|
129 |
-
Remember, in the digital age of recruitment, your job ad is your first impression. So make it count!"""
|
130 |
-
|
131 |
-
UserPrompt_11 = r""""Task: Crafting product update checklists on product updates and new features for customer onboarding
|
132 |
-
Task Description: Review the latest product updates and new features, ensuring a comprehensive understanding of their functionalities and benefits.
|
133 |
-
Create detailed checklists that outline step-by-step procedures for clients to effectively integrate and utilize these updates and features in their existing systems or processes.
|
134 |
-
Ensure the checklists are clear, user-friendly, and tailored to support customers of varying technical proficiency, facilitating smooth onboarding and optimal use of the new product capabilities.
|
135 |
-
Additional instructions: The tutorial is aimed at employees in a Client Support department."
|
136 |
-
|
137 |
-
HOOK:
|
138 |
-
If you're in client support, you know how tricky it can be to explain new product features to a wide range of customers. Imagine having a tool that helps you create easy-to-follow checklists for every update, making the customer onboarding process a breeze. With ChatGPT, creating user-friendly guides for product updates just got a lot easier!
|
139 |
-
|
140 |
-
TITLE:
|
141 |
-
Create Easy-to-Follow Product Update Checklists with ChatGPT: A Guide for Client Support Teams
|
142 |
-
|
143 |
-
INTRO:
|
144 |
-
Hello there, Client Support team members! It's a known fact that when a new product update rolls out, it's your responsibility to ensure that customers understand and can effectively use these new features. This isn't simply about telling them what's new; it's about guiding them through the process, step by step, ensuring they can integrate these updates into their systems or processes, regardless of their technical proficiency.
|
145 |
-
|
146 |
-
But how do you create clear, user-friendly checklists that cater to customers with varying levels of expertise? That's where ChatGPT comes in. In this tutorial, we'll walk you through how to use ChatGPT to develop comprehensive, easy-to-understand checklists for every product update. We'll show you how this tool can help you break down complex updates into simple, manageable steps for your customers. Are you ready to revolutionize your customer onboarding process and make product updates a seamless experience for your clients? Let's get started!
|
147 |
-
"""
|
148 |
-
|
149 |
-
AssistantPrompt_11 = r""""*LEARNING OBJECTIVES SUMMARY*
|
150 |
-
By the end of this tutorial, you will be able to:
|
151 |
-
|
152 |
-
1. Use ChatGPT to interpret product updates and new features
|
153 |
-
2. Generate detailed, user-friendly checklists for product onboarding
|
154 |
-
|
155 |
-
*LEARNING OBJECTIVE 1*
|
156 |
-
Firstly, let's get a comprehensive understanding of product updates and their benefits.
|
157 |
-
|
158 |
-
Product updates can range from minor tweaks to significant overhauls. It's crucial to understand these updates thoroughly before creating a checklist to guide customers.
|
159 |
-
|
160 |
-
Suppose we have a recent update for an email marketing software called 'MailBlitz'. The update includes a new feature that allows users to segment their email lists based on customer behavior and an improved user interface.
|
161 |
-
|
162 |
-
To get a comprehensive understanding, feed this information to ChatGPT.
|
163 |
-
|
164 |
-
Type into the ChatGPT:
|
165 |
-
"You are a software expert. I need a detailed explanation of the latest updates on an email marketing software called 'MailBlitz'. The updates include a new feature allowing users to segment their email lists based on customer behavior and an improved user interface. Ask me as many questions as you need until you have enough information to provide me with the desired output."
|
166 |
-
|
167 |
-
Then, press the send button.
|
168 |
-
|
169 |
-
ChatGPT will ask relevant questions until it has enough information to provide a detailed explanation.
|
170 |
-
|
171 |
-
*LEARNING OBJECTIVE 2*
|
172 |
-
Next, let's move on to create a user-friendly checklist for these updates. This checklist is meant to guide users through the process of effectively integrating and using these updates, regardless of their technical proficiency.
|
173 |
-
|
174 |
-
Type into the ChatGPT:
|
175 |
-
"Now that we understand the update, let's create a step-by-step checklist to help users integrate these updates into their systems. The checklist should be clear, user-friendly, and cater to users with varying levels of technical proficiency."
|
176 |
-
|
177 |
-
Then, press the send button.
|
178 |
-
|
179 |
-
ChatGPT will generate a comprehensive checklist, breaking down complex procedures into simple, digestible steps.
|
180 |
-
|
181 |
-
*CONCLUSION*
|
182 |
-
And there you have it! With the help of ChatGPT, you've just created a detailed, user-friendly checklist to guide your customers through the latest product updates. Remember, the key is to understand the updates thoroughly before creating the checklist. Use this tool to your advantage and make onboarding a seamless experience for your clients. Happy onboarding!"""
|
183 |
-
|
184 |
-
|
185 |
-
# Define messages for stepTwo
|
186 |
-
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.
|
187 |
-
|
188 |
-
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:
|
189 |
-
|
190 |
-
- Learning Objectives Summary
|
191 |
-
- Learning Objective 1
|
192 |
-
- Learning Objective 2
|
193 |
-
- Learning Objective 3 (this third one is optional)
|
194 |
-
- Conclusion
|
195 |
-
|
196 |
-
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.
|
197 |
-
|
198 |
-
Make sure to also include:
|
199 |
-
- the exact prompt(s) the user needs to type into ChatGPT;
|
200 |
-
- realistic sample data for a case study, if applicable."""
|
201 |
-
|
202 |
-
UserPrompt_20 = r"""Topic of the tutorial: How to create a Job Ad with ChatGPT.
|
203 |
-
Additional instructions: Use digital marketing manager as an example role.
|
204 |
-
|
205 |
-
*HOOK*
|
206 |
-
If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords.
|
207 |
-
|
208 |
-
But how do you accomplish this without a lot of experience in Search Engine Optimization?
|
209 |
-
|
210 |
-
Well, with ChatGPT.
|
211 |
-
|
212 |
-
*TITLE*
|
213 |
-
Create a Job Ad with ChatGPT
|
214 |
-
|
215 |
-
*INTRO*
|
216 |
-
In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates.
|
217 |
-
|
218 |
-
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."""
|
219 |
-
|
220 |
-
AssistantPrompt_20 = r"""*LEARNING OBJECTIVES SUMMARY*
|
221 |
-
You will learn how to:
|
222 |
-
- Create an ideal job description
|
223 |
-
- Extract SEO-friendly keywords
|
224 |
-
- Craft a job ad
|
225 |
-
|
226 |
-
Let's dive right in!
|
227 |
-
|
228 |
-
*LEARNING OBJECTIVE 1*
|
229 |
-
You can't create the perfect job ad without first creating the job description.
|
230 |
-
|
231 |
-
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.
|
232 |
-
|
233 |
-
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.
|
234 |
-
|
235 |
-
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.
|
236 |
-
|
237 |
-
Let's say you've been tasked to recruit a 'Digital Marketing Manager'.
|
238 |
-
|
239 |
-
Gather as much information as you can on the specifics of this job from the person that made the request.
|
240 |
-
|
241 |
-
For this tutorial, we’ll be using the following sample information.
|
242 |
-
|
243 |
-
The job title is "Digital marketing manager."
|
244 |
-
|
245 |
-
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:
|
246 |
-
- overseeing online marketing campaigns and other digital projects to optimize online brand presence and boost revenue.
|
247 |
-
- managing a team of 3 digital marketers."
|
248 |
-
|
249 |
-
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."
|
250 |
-
|
251 |
-
Now, we're ready to write our prompt.
|
252 |
-
|
253 |
-
Type:
|
254 |
-
“You are a recruiter. Create a job description for a digital marketing manager.
|
255 |
-
|
256 |
-
Here are some additional details to consider when writing the job description:”
|
257 |
-
|
258 |
-
Then, paste the details you gathered previously.
|
259 |
-
|
260 |
-
Then press the send button.
|
261 |
-
|
262 |
-
|
263 |
-
ChatGPT wrote some basic details, the overview of the role, and key responsibilities of the role.
|
264 |
-
|
265 |
-
It also included [basic and preferred qualifications], [what's in it for the applicant], and [more instructions].
|
266 |
-
|
267 |
-
Make sure to review and revise this job description so it effectively communicates your expectations.
|
268 |
-
|
269 |
-
*LEARNING OBJECTIVE 2*
|
270 |
-
With this description, we can proceed to extract keywords which potential candidates might use when searching for this job.
|
271 |
-
|
272 |
-
Keywords are important because they make your job ad discoverable. The best keywords should resonate with the job seekers' search behavior.
|
273 |
-
|
274 |
-
Let's get keywords from ChatGPT.
|
275 |
-
|
276 |
-
Type:
|
277 |
-
"Provide keywords related to the role of Digital Marketing Manager based on the description you've provided me."
|
278 |
-
|
279 |
-
Then, press the send message button.
|
280 |
-
|
281 |
-
ChatGPT came up with a couple of keywords that we can use when posting our final job ad.
|
282 |
-
|
283 |
-
We can also incorporate these keywords into the job ad itself.
|
284 |
-
|
285 |
-
*LEARNING OBJECTIVE 3*
|
286 |
-
With our description and keywords in hand, let's craft a job ad that integrates them both seamlessly.
|
287 |
-
|
288 |
-
Type:
|
289 |
-
"Using the job description and the keywords you've provided, draft a job ad for a Digital Marketing Manager."
|
290 |
-
|
291 |
-
Then, press the send button.
|
292 |
-
|
293 |
-
Here's the response.
|
294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
|
298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
|
303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
|
305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
|
|
|
|
|
|
|
|
|
307 |
|
308 |
-
# Function to make API call
|
309 |
-
def api_call(messages, temperature=0.9, model="gpt-4-1106-preview"):
|
310 |
-
return openai.ChatCompletion.create(
|
311 |
-
messages=messages,
|
312 |
-
temperature=temperature,
|
313 |
-
model=model
|
314 |
-
).choices[0].message.content
|
315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
|
317 |
-
|
318 |
-
def process_inputs(EPA_title, Task_Description, Extra_input, Department):
|
319 |
-
# Check if EPA_title is empty
|
320 |
-
if not EPA_title:
|
321 |
-
return manual
|
322 |
-
if not Extra_input:
|
323 |
-
stepOne = [
|
324 |
-
{"role": "system", "content": SystemPrompt_10},
|
325 |
-
{"role": "user", "content": UserPrompt_10},
|
326 |
-
{"role": "assistant", "content": AssistantPrompt_10},
|
327 |
-
{"role": "user", "content": UserPrompt_11},
|
328 |
-
{"role": "assistant", "content": AssistantPrompt_11},
|
329 |
-
{"role": "user", "content": f"""Task: {EPA_title}.
|
330 |
-
Task Description: {Task_Description}
|
331 |
-
Additional Instructions: The tutorial should be aimed at employees in a {Department} department."""}
|
332 |
-
]
|
333 |
-
Script_1st_half = api_call(stepOne, 0.7)
|
334 |
-
|
335 |
-
stepTwo = [
|
336 |
-
{"role": "system", "content": SystemPrompt_20},
|
337 |
-
{"role": "user", "content": UserPrompt_20},
|
338 |
-
{"role": "assistant", "content": AssistantPrompt_20},
|
339 |
-
{"role": "user", "content": f"""Task: {EPA_title}.
|
340 |
-
Task Description: {Task_Description}
|
341 |
-
Additional Instructions: The tutorial should be aimed at employees in a {Department} department."""}
|
342 |
-
]
|
343 |
-
Script_2nd_half = api_call(stepTwo, 0.7)
|
344 |
-
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
345 |
-
return Script_complete
|
346 |
|
|
|
|
|
347 |
else:
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
]
|
359 |
-
|
|
|
360 |
|
361 |
-
|
362 |
-
|
363 |
-
{"role": "user", "content": UserPrompt_20},
|
364 |
-
{"role": "assistant", "content": AssistantPrompt_20},
|
365 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
366 |
-
Additional instructions: {Extra_input}
|
367 |
-
The tutorial is aimed at employees in a {Department} department.
|
368 |
|
369 |
-
{Script_1st_half}"""}
|
370 |
-
]
|
371 |
-
Script_2nd_half = api_call(stepTwo, 0.7)
|
372 |
-
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
373 |
-
return Script_complete
|
374 |
-
|
375 |
-
departments = {
|
376 |
-
"3D": "3D Modeling", # Label and value differ
|
377 |
-
"Client Support": "Client Support",
|
378 |
-
"Data Entry & Back Office": "Data Entry & Back Office",
|
379 |
-
"Education Administration (ENI)": "Education Administration", # Label and value differ
|
380 |
-
"Finance": "Finance",
|
381 |
-
"Marketing": "Marketing",
|
382 |
-
"HR": "HR",
|
383 |
-
"IT": "IT",
|
384 |
-
"Legal": "Legal",
|
385 |
-
"Product Management": "Product Management",
|
386 |
-
"Project Management/Coordination": "Project Management/Coordination",
|
387 |
-
"Process Management": "Process Management",
|
388 |
-
"QA": "QA",
|
389 |
-
"R&D": "R&D",
|
390 |
-
"Sales": "Sales",
|
391 |
-
"Software": "Software",
|
392 |
-
"Video Production": "Video Production",
|
393 |
-
"Visual Management": "Visual Management"
|
394 |
-
}
|
395 |
-
|
396 |
-
# Create the Gradio interface
|
397 |
-
iface = gr.Interface(
|
398 |
-
fn=process_inputs,
|
399 |
-
inputs=[
|
400 |
-
gr.Textbox(lines=2, label='EPA title Here... (use the phrasing: "How to do X using ChatGPT")'),
|
401 |
-
gr.Textbox(lines=2, label='Task Description'),
|
402 |
-
gr.Textbox(lines=2, label='Extra input Here... (optional, put any extra requirements or relevant context)'),
|
403 |
-
gr.Dropdown(choices=departments, label="Select Team", searchable=True)
|
404 |
-
],
|
405 |
-
outputs=gr.Textbox(label="Script", show_copy_button=True)
|
406 |
-
)
|
407 |
-
|
408 |
-
iface.launch(share=True)
|
409 |
-
iface.launch()
|
|
|
1 |
+
from openai import OpenAI
|
2 |
import random
|
3 |
import gradio as gr
|
4 |
import os
|
5 |
|
6 |
+
client = OpenAI(api_key=os.environ.get('OPENAI_API_KEY'))
|
7 |
+
|
8 |
+
# Variables
|
9 |
+
introStatement = (
|
10 |
+
"""
|
11 |
+
# ChatGPT Use Case Script Generator
|
12 |
+
Welcome to the ChatGPT Use Case Script Generator! With this tool, you can create any ChatGPT Use Case script that you want.
|
13 |
+
To use the tool, you will find instructions in every step. Make sure to read and follow these instructions to get the best results.
|
14 |
+
Good luck!
|
15 |
+
"""
|
16 |
+
)
|
17 |
+
|
18 |
+
step1Statement = (
|
19 |
+
"""
|
20 |
+
## Step 1. Answer these questions
|
21 |
+
In order for us to create the script for you, first you need to answer some very important questions.
|
22 |
+
Make sure to answer these questions in a clear and detailed manner. After answering the questions, press the "Review Answers" button.
|
23 |
+
Check the feedback given in the review and apply them accordingly.
|
24 |
+
Once you are satisfied, press the "Let's Start" button.
|
25 |
+
"""
|
26 |
+
)
|
27 |
+
|
28 |
+
step2Statement = (
|
29 |
+
"""
|
30 |
+
## Step 2. Review each output
|
31 |
+
In this section, review the result in each substep in order. If you are not happy with the results, press the "Regenerate Current Step" button
|
32 |
+
until you are happy. Then, you can press the "Generate Next Step Button." This button will generate the next section.
|
33 |
+
"""
|
34 |
+
)
|
35 |
+
|
36 |
+
step3Statement = (
|
37 |
+
"""
|
38 |
+
## Step 3. Copy your script
|
39 |
+
And that's it! Copy your script and paste it wherever you need to paste it.
|
40 |
+
Need to make a new script? Simply press the refresh button.
|
41 |
+
"""
|
42 |
+
)
|
43 |
+
|
44 |
+
|
45 |
+
# Classes
|
46 |
+
class FormStep:
|
47 |
+
|
48 |
+
def __init__(self, label):
|
49 |
+
|
50 |
+
self.txtBoxTxt = label
|
51 |
+
self._id = 1
|
52 |
+
|
53 |
+
with gr.Blocks(theme=gr.themes.Soft()) as self.demo:
|
54 |
+
with gr.Column():
|
55 |
+
self.output = gr.Textbox(label=label)
|
56 |
+
with gr.Row():
|
57 |
+
self.approveBtn = gr.Button("Approve", interactive=False)
|
58 |
+
self.rejectBtn = gr.Button("Reject", interactive=False)
|
59 |
+
|
60 |
+
|
61 |
+
def enableBtn(self, bool):
|
62 |
+
print("FormStep, enableBtn")
|
63 |
+
self.approveBtn.interactive = bool
|
64 |
+
self.rejectBtn.interactive = bool
|
65 |
+
|
66 |
+
def set_btn(self, btnManager, inputs, output, approveFunc, rejectFunc):
|
67 |
+
self.btnManager = btnManager
|
68 |
+
self.inputs = inputs
|
69 |
+
self.output = output
|
70 |
+
self.approveFunc = approveFunc
|
71 |
+
self.rejectFunc = rejectFunc
|
72 |
+
self.approveBtn.click(fn=self.approveFunc, inputs=self.inputs, outputs=self.output)
|
73 |
+
self.rejectBtn.click(fn=self.rejectFunc, inputs=self.inputs, outputs=self.output)
|
74 |
+
|
75 |
+
|
76 |
+
def launch(self):
|
77 |
+
self.demo.launch()
|
78 |
+
|
79 |
+
|
80 |
+
class HorizontalBtn:
|
81 |
+
|
82 |
+
def __init__(self, label):
|
83 |
+
self.label = label
|
84 |
+
|
85 |
+
with gr.Blocks() as self.demo:
|
86 |
+
self.btn = gr.Button(label, interactive=False)
|
87 |
+
|
88 |
+
def set_btn(self, btnManager, inputs, outputs, func):
|
89 |
+
self.btnManager = btnManager
|
90 |
+
self.inputs = inputs
|
91 |
+
self.outputs = outputs
|
92 |
+
self.func = func
|
93 |
+
self.btn.click(fn=func, inputs=inputs, outputs=outputs)
|
94 |
+
|
95 |
+
|
96 |
+
def enableBtn(self, bool):
|
97 |
+
self.btn.interactive = bool
|
98 |
+
|
99 |
+
def launch(self):
|
100 |
+
self.demo.launch()
|
101 |
+
|
102 |
+
|
103 |
+
class ButtonManager:
|
104 |
+
def __init__(self, start, step2a, step2b, step2c, step2d, restart):
|
105 |
+
self.buttons = {
|
106 |
+
'start': start,
|
107 |
+
'step2a': step2a,
|
108 |
+
'step2b': step2b,
|
109 |
+
'step2c': step2c,
|
110 |
+
'step2d': step2d,
|
111 |
+
'restart': restart
|
112 |
+
}
|
113 |
+
|
114 |
+
"""
|
115 |
+
|
116 |
+
def enable_button(self, button_name):
|
117 |
+
print("enable_button: btnManager")
|
118 |
+
if button_name in self.buttons:
|
119 |
+
self.buttons[button_name].enableBtn(True)
|
120 |
+
print("enable_button: button_name: btnManager")
|
121 |
+
|
122 |
+
def disable_button(self, button_name):
|
123 |
+
if button_name in self.buttons:
|
124 |
+
self.buttons[button_name].enableBtn(False) """
|
125 |
+
|
126 |
+
|
127 |
+
# Final Global Vars
|
128 |
+
Hook = ""
|
129 |
+
TitleAndIntro = ""
|
130 |
+
LearningObjectives = ""
|
131 |
+
Prompts = ""
|
132 |
+
TutorialSections = ""
|
133 |
+
FinalScript = ""
|
134 |
+
|
135 |
+
#All Functions
|
136 |
+
|
137 |
+
#Generate Hook Function
|
138 |
+
#This function takes all four inputs from the text box and uses them to create a hook
|
139 |
+
def GenerateHook(audienceInput, problemInput, solutionInput, objectiveInput, reviewAnswersBox):
|
140 |
|
141 |
+
global Hook #Declare as global
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
+
inputs = {
|
144 |
+
"Audience Input": audienceInput,
|
145 |
+
"Problem Input": problemInput,
|
146 |
+
"Solution Input": solutionInput,
|
147 |
+
"Objective Input": objectiveInput,
|
148 |
+
"Review": reviewAnswersBox
|
149 |
+
}
|
150 |
+
|
151 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
152 |
+
|
153 |
+
if empty_inputs:
|
154 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
155 |
+
else:
|
156 |
|
157 |
+
global client
|
158 |
+
client = OpenAI()
|
159 |
+
|
160 |
+
user_message_content = (
|
161 |
+
f"Target Audience: {audienceInput}\n"
|
162 |
+
f"Problem: {problemInput}\n"
|
163 |
+
f"Solution: {solutionInput}\n"
|
164 |
+
f"Video Objective: {objectiveInput}"
|
165 |
+
)
|
166 |
+
|
167 |
+
response = client.chat.completions.create(
|
168 |
+
model="gpt-4",
|
169 |
+
messages=[
|
170 |
+
{
|
171 |
+
"role": "system",
|
172 |
+
"content": "You are an expert script writer creating engaging YouTube tutorial scripts for beginners on how to use ChatGPT to solve the problems they encounter in the corporate environment. These scripts must be written in a simple conversational manner and targeted to a beginner of a specific target audience. Technical jargon and complex words must be avoided at all times. \n\nYour current task is to create a hook based on the script brief. The hook is designed to show the viewer what their problem is and how watching the video will help them with their problem. During the hook, we need to welcome the audience, present their SPECIFIC problem, and how SPECIFICALLY their problem can be solved with ChatGPT. Finally, we offer for them to keep watching so we can show them how."
|
173 |
+
},
|
174 |
+
{
|
175 |
+
"role": "user",
|
176 |
+
"content": "Target Audience: members of the social media marketing team.\nProblem: Members of the marketing team come up with a text content to post on social media, but it doesn't always match the company's brand voice. \nSolution: With ChatGPT, they can use a prompt to check if their content matches their brand voice and provide suggestions. \nVideo Objective: The objective of the video is to teach the viewer how to use ChatGPT to review social media text content to check if it matches the brand voice. "
|
177 |
+
},
|
178 |
+
{
|
179 |
+
"role": "assistant",
|
180 |
+
"content": "Hello, social media marketers! Ever whipped up a killer piece of content only to realize it just seems... off-brand? What if you could run a quality check to ensure your message is always in line with your company's brand voice? Let me introduce you to your new best friend, ChatGPT! This savvy tool can check your content before you post and offer suggestions to better align with your brand. Keep watching, and we'll show you how."
|
181 |
+
},
|
182 |
+
{
|
183 |
+
"role": "user",
|
184 |
+
"content": "Target Audience: members of the sales team.\nProblem: Members of the sales team often spend a lot of time creating personalized emails for customers in different sales scenarios. \nSolution: With ChatGPT, they can use a prompt and create email templates for different sales scenarios. \nVideo Objective: The objective of the video is to teach the viewer how to use ChatGPT to create email templates for customers and various sales scenarios, so they no longer need to write emails from scratch every single time. "
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"role": "assistant",
|
188 |
+
"content": "Hey sales pros! Isn't it exhausting to constantly craft unique emails for every different sales scenario? Imagine having a magic tool that helps you create personalized email templates in a snap! Sounds good, right? That tool is called ChatGPT. With it, you can easily create tailor-made email templates for your customers in no time, guaranteeing you never have to start from scratch again. Stick with us in this video, and we'll show you how to turn those long hours into mere minutes."
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"role": "user",
|
192 |
+
"content": user_message_content
|
193 |
+
}
|
194 |
+
],
|
195 |
+
temperature=1,
|
196 |
+
max_tokens=256,
|
197 |
+
top_p=1,
|
198 |
+
frequency_penalty=0,
|
199 |
+
presence_penalty=0
|
200 |
+
)
|
201 |
+
|
202 |
+
Hook = response.choices[0].message.content
|
203 |
+
return Hook
|
204 |
+
|
205 |
+
|
206 |
+
#Generate Title and Intro Function
|
207 |
+
#This function takes all four inputs from the text box and uses them to create a title and intro
|
208 |
+
#Before running, it makes sure that the hook has already been generated
|
209 |
+
def GenerateTitleAndIntro(audienceInput, problemInput, solutionInput, objectiveInput): # To come up with title and intro, you need all values + Hook.
|
210 |
+
|
211 |
+
global Hook, TitleAndIntro #Declare as global
|
212 |
+
|
213 |
+
inputs = {
|
214 |
+
"Audience Input": audienceInput,
|
215 |
+
"Problem Input": problemInput,
|
216 |
+
"Solution Input": solutionInput,
|
217 |
+
"Objective Input": objectiveInput,
|
218 |
+
"Hook": Hook
|
219 |
+
}
|
220 |
+
|
221 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
222 |
+
|
223 |
+
if empty_inputs:
|
224 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
225 |
+
else:
|
226 |
|
227 |
+
global client
|
228 |
+
client = OpenAI()
|
229 |
+
|
230 |
+
user_message_content = (
|
231 |
+
f"Target Audience: {audienceInput}\n"
|
232 |
+
f"Problem: {problemInput}\n"
|
233 |
+
f"Solution: {solutionInput}\n"
|
234 |
+
f"Video Objective: {objectiveInput}"
|
235 |
+
)
|
236 |
+
|
237 |
+
response = client.chat.completions.create(
|
238 |
+
model="gpt-4",
|
239 |
+
messages=[
|
240 |
+
{
|
241 |
+
"role": "system",
|
242 |
+
"content": "You are an expert script writer creating engaging YouTube tutorial scripts for beginners on how to use ChatGPT to solve the problems they encounter in the corporate environment. These scripts must be written in a simple conversational manner. Technical jargon and complex words must be avoided at all times. \n\nYour current task is to create a title and introduction based on the script brief that consist of a target audience, problem, solution, and video objective. \n\nThe title should be visualizing in an engaging way the video's objective. The title must be straight to the point, consist of a maximum of two phrases. It must not use abstract phrasing. \n\nThe intro should start by describing and explaining the key topic of the tutorial. For example, if the tutorial is about Brand Voice on social media, then it must start by explaining what brand voice is and why it's important. Make sure not to greet the specific target audience as this has already been done in a previous section. \n\nAfter this description, it then must proceed with explaining what task is to be performed related to the key topic and why it's important to perform that task in a certain way. \n\nAnd finally, the intro wraps up with how the task can be performed with the help of ChatGPT. "
|
243 |
+
},
|
244 |
+
{
|
245 |
+
"role": "user",
|
246 |
+
"content": "Target Audience: members of the social media marketing team.\nProblem: Members of the marketing team come up with a text content to post on social media, but it doesn't always match the company's brand voice. \nSolution: With ChatGPT, they can use a prompt to check if their content matches their brand voice and provide suggestions. \nVideo Objective: The objective of the video is to teach the viewer how to use ChatGPT to review social media text content to check if it matches the brand voice. "
|
247 |
+
},
|
248 |
+
{
|
249 |
+
"role": "assistant",
|
250 |
+
"content": "Title: Ensuring Consistent Brand Voice on Social Media with ChatGPT\n\nWelcome to our guide on keeping your brand's voice consistent across social media, with a little help from ChatGPT.\n\nLet's start with the basics: your brand voice. Think of it as the personality of your company in words. It's how you talk to your audience, making your brand feel familiar and unique. Whether it's fun, serious, or something in between, your brand voice helps you connect with people in a meaningful way.\n\nBut here's the challenge: making sure this voice stays the same across all your social media posts can be tough. Ever been about to post something and stopped to wonder, \"Does this really sound like us?\" This is a common issue in social media marketing, where being consistent is important but not always easy.\n\nThat's where ChatGPT comes in. It's like your behind-the-scenes helper that can make sure every tweet, post, or update sounds exactly like your brand. With ChatGPT, you can make sure your brand's personality is always the star of the show on social media. Let's dive in."
|
251 |
+
},
|
252 |
+
{
|
253 |
+
"role": "user",
|
254 |
+
"content": "Target Audience: members of the sales team.\nProblem: Members of the sales team often spend a lot of time creating personalized emails for customers in different sales scenarios. \nSolution: With ChatGPT, they can use a prompt and create email templates for different sales scenarios. \nVideo Objective: The objective of the video is to teach the viewer how to use ChatGPT to create email templates for customers and various sales scenarios, so they no longer need to write emails from scratch every single time. "
|
255 |
+
},
|
256 |
+
{
|
257 |
+
"role": "assistant",
|
258 |
+
"content": "Title: Create Sales Email Templates with ChatGPT\n\nWelcome to this tutorial, where we address a common challenge faced by sales professionals: the time-consuming task of writing personalized emails for different sales scenarios. Personalizing emails is crucial because it helps build stronger connections with your customers. It shows that you see them as individuals with unique needs and preferences, which can significantly increase the effectiveness of your communication and boost your chances of making a sale.\n\nHowever, the catch is that crafting these personalized emails for various scenarios demands a considerable amount of time and effort. For example, you might need to create a warm introduction email for new leads, a detailed proposal email for interested prospects, a follow-up email after a meeting, or a thank-you email post-purchase. Each of these scenarios requires a different approach, tone, and content, making the task even more daunting.\n\nBut what if there was a way to streamline this process? That's where ChatGPT comes in. ChatGPT is an AI tool that can assist you in creating customized email templates for any sales situation. By leveraging intelligent prompts, ChatGPT helps generate relevant, personalized content, saving you time and effort. Stay with us as we dive into how ChatGPT can transform the way you handle sales emails, making your daily tasks smoother and more productive."
|
259 |
+
},
|
260 |
+
{
|
261 |
+
"role": "user",
|
262 |
+
"content": user_message_content
|
263 |
+
}
|
264 |
+
],
|
265 |
+
temperature=1,
|
266 |
+
max_tokens=1000,
|
267 |
+
top_p=1,
|
268 |
+
frequency_penalty=0,
|
269 |
+
presence_penalty=0
|
270 |
+
)
|
271 |
+
|
272 |
+
TitleAndIntro = response.choices[0].message.content
|
273 |
+
return TitleAndIntro
|
274 |
+
|
275 |
+
|
276 |
+
#Generate Learning Objectives
|
277 |
+
#This function takes all four inputs from the text box and uses them to create learning objectives
|
278 |
+
#Before running, it makes sure that the hook and title and intro have already been generated
|
279 |
+
def GenerateLearningObjectives(audienceInput, problemInput, solutionInput, objectiveInput):
|
280 |
+
|
281 |
+
global Hook, TitleAndIntro, LearningObjectives #Declare as global
|
282 |
+
|
283 |
+
inputs = {
|
284 |
+
"Audience Input": audienceInput,
|
285 |
+
"Problem Input": problemInput,
|
286 |
+
"Solution Input": solutionInput,
|
287 |
+
"Objective Input": objectiveInput,
|
288 |
+
"Hook": Hook,
|
289 |
+
"TitleAndIntro": TitleAndIntro
|
290 |
+
}
|
291 |
+
|
292 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
293 |
+
|
294 |
+
if empty_inputs:
|
295 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
296 |
+
else:
|
297 |
|
298 |
+
global client
|
299 |
+
client = OpenAI()
|
300 |
+
|
301 |
+
user_message_content = (
|
302 |
+
f"Target Audience: {audienceInput}\n"
|
303 |
+
f"Problem: {problemInput}\n"
|
304 |
+
f"Solution: {solutionInput}\n"
|
305 |
+
f"Video Objective: {objectiveInput}"
|
306 |
+
)
|
307 |
+
|
308 |
+
response = client.chat.completions.create(
|
309 |
+
model="gpt-4",
|
310 |
+
messages=[
|
311 |
+
{
|
312 |
+
"role": "system",
|
313 |
+
"content": "You are an expert script writer creating engaging YouTube tutorial scripts for beginners on how to use ChatGPT to solve the problems they encounter in the corporate environment. These scripts must be written in a simple conversational manner. Technical jargon and complex words must be avoided at all times. \n\nYour current task is to create the learning objectives the student needs to learn in order for the video to fulfill the video objectives located in the brief. Make sure the learning objectives CORRELATE to the specific video objectives. These learning objectives must be application-based and should involve the viewer performing a specific task. Make sure to keep the learning objectives brief. If only one learning objective is necessary, then only make 1 learning objective. You are only allowed to make A MAXIMUM OF 2 learning objectives, but only use 1 if needed. Learning objectives must always start with a Verb that specifies what the learner should do. Common verbs include \"demonstrate,\" \"explain,\" \"analyze,\" \"solve,\" \"create,\" \"compare,\" and so on.\n\nFinally, put all these learning objectives in a learning objective summary. This summary is usually written like \"By the end of this tutorial, you will be able to: 1. X, etc.\""
|
314 |
+
},
|
315 |
+
{
|
316 |
+
"role": "user",
|
317 |
+
"content": "Topic: Using ChatGPT to make sure your post content on social media fits your company's brand voice.\nTarget Audience: members of the social media marketing team.\nProblem: Members of the marketing team come up with a text content to post on social media, but it doesn't always match the company's brand voice. \nSolution: With ChatGPT, they can use a prompt to check if their content matches their brand voice and provide suggestions. \n\nVideo Objective: The objective of the video is to:\n- teach the viewer how to use ChatGPT to review social media text content to check if it matches the brand voice. "
|
318 |
+
},
|
319 |
+
{
|
320 |
+
"role": "assistant",
|
321 |
+
"content": "By the end of this tutorial, you will be able to:\n1. Use ChatGPT review your social media draft post to test if it matches your brand voice"
|
322 |
+
},
|
323 |
+
{
|
324 |
+
"role": "user",
|
325 |
+
"content": "Topic: Using ChatGPT to create email templates for diverse sales scenarios.\nTarget Audience: members of the sales team.\nProblem: Members of the sales team often spend a lot of time creating personalized emails for customers in different sales scenarios. \nSolution: With ChatGPT, they can use a prompt and create email templates for different sales scenarios. \n\nVideo Objective: The objective of the video is to teach the viewer how to:\n- use ChatGPT to create email templates for customers and various sales scenarios, so they no longer need to write emails from scratch every single time. \n- use ChatGPT to customize email templates for different needs"
|
326 |
+
},
|
327 |
+
{
|
328 |
+
"role": "assistant",
|
329 |
+
"content": "By the end of this tutorial, you will be able to:\n\n1. Demonstrate how to utilize ChatGPT to create a variety of email templates to handle various sales scenarios.\n2. Apply ChatGPT to customize email templates for specific customer types or needs."
|
330 |
+
},
|
331 |
+
{
|
332 |
+
"role": "user",
|
333 |
+
"content": user_message_content
|
334 |
+
}
|
335 |
+
],
|
336 |
+
temperature=1,
|
337 |
+
max_tokens=300,
|
338 |
+
top_p=1,
|
339 |
+
frequency_penalty=0,
|
340 |
+
presence_penalty=0
|
341 |
+
)
|
342 |
+
|
343 |
+
LearningObjectives = response.choices[0].message.content
|
344 |
+
return LearningObjectives
|
345 |
+
|
346 |
+
|
347 |
+
#Generate Prompts
|
348 |
+
#This function takes all four inputs and the learning objectives and uses them to create prompts
|
349 |
+
#Before running, it makes sure that the hook and title and intro have already been generated
|
350 |
+
def GeneratePrompts(audienceInput, problemInput, solutionInput, objectiveInput, learningObjectivesInput):
|
351 |
+
|
352 |
+
global Hook, TitleAndIntro, LearningObjectives, Prompts #Declare as global
|
353 |
+
|
354 |
+
inputs = {
|
355 |
+
"Audience Input": audienceInput,
|
356 |
+
"Problem Input": problemInput,
|
357 |
+
"Solution Input": solutionInput,
|
358 |
+
"Objective Input": objectiveInput,
|
359 |
+
"Hook": Hook,
|
360 |
+
"Title and Introduction": TitleAndIntro,
|
361 |
+
"Learning Objectives": LearningObjectives
|
362 |
+
}
|
363 |
+
|
364 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
365 |
+
|
366 |
+
if empty_inputs:
|
367 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
368 |
+
else:
|
369 |
|
370 |
+
global client
|
371 |
+
client = OpenAI()
|
372 |
+
|
373 |
+
user_message_content = (
|
374 |
+
f"Target Audience: {audienceInput}\n"
|
375 |
+
f"Problem: {problemInput}\n"
|
376 |
+
f"Solution: {solutionInput}\n"
|
377 |
+
f"Video Objective: {objectiveInput}\n"
|
378 |
+
f"{learningObjectivesInput}\n"
|
379 |
+
)
|
380 |
+
|
381 |
+
response = client.chat.completions.create(
|
382 |
+
model="gpt-4",
|
383 |
+
messages=[
|
384 |
+
{
|
385 |
+
"role": "system",
|
386 |
+
"content": "You are an expert prompt engineer creating prompts for ChatGPT. These prompts follow the best practices for prompt engineering. These best practices include be specific and clear, provide context, define a role (expert marketer, master HR recruiter), specify a desired format, be concise, and use automatic prompts that end with \"Ask me as many questions as you need until you have enough information to provide me with the desired output.\"\n\nYour current task is to create the best prompts for each learning objective found in the learning objective summary provided. For more context, you can review the video objective found in the brief. "
|
387 |
+
},
|
388 |
+
{
|
389 |
+
"role": "user",
|
390 |
+
"content": "Topic: Using ChatGPT to create email templates for diverse sales scenarios.\nTarget Audience: members of the sales team.\nProblem: Members of the sales team often spend a lot of time creating personalized emails for customers in different sales scenarios. \nSolution: With ChatGPT, they can use a prompt and create email templates for different sales scenarios. \nVideo Objective: The objective of the video is to teach the viewer how to use ChatGPT to create email templates for customers and various sales scenarios, so they no longer need to write emails from scratch every single time.\n\nBy the end of this tutorial, you will be able to:\n1. Use ChatGPT to identify different sales scenarios;\n2. Generate personalized email templates for these scenarios using ChatGPT. "
|
391 |
+
},
|
392 |
+
{
|
393 |
+
"role": "assistant",
|
394 |
+
"content": "Prompt for Learning Objective 1: Identifying Different Sales Scenarios with ChatGPT\n\nYou are a sales expert advisor. Consider the [Your Company]'s popular product/service range. Based on the buyer persona [provide some characteristics of your typical customer], could you suggest some different sales scenarios that our sales team should be prepared for? Ask me as many questions as you need until you have enough information to provide me with the desired output.\n\nPrompt for Learning Objective 2: Generating Personalized Email Templates for Different Sales Scenarios Using ChatGPT\n\nGiven the sales scenario of [provide a specific sales scenario - e.g., following up with a prospect after a meeting, answering a query, etc.], could you help me create a personalized email template to address this? Remember, our brand voice is [describe brand voice - e.g., professional, friendly, informative, casual, etc.]. Ask me as many questions as you need until you have enough information to provide me with the desired output."
|
395 |
+
},
|
396 |
+
{
|
397 |
+
"role": "user",
|
398 |
+
"content": user_message_content
|
399 |
+
}
|
400 |
+
],
|
401 |
+
temperature=1,
|
402 |
+
max_tokens=500,
|
403 |
+
top_p=1,
|
404 |
+
frequency_penalty=0,
|
405 |
+
presence_penalty=0
|
406 |
+
)
|
407 |
+
|
408 |
+
Prompts = response.choices[0].message.content
|
409 |
+
return Prompts
|
410 |
+
|
411 |
+
|
412 |
+
#Generate Tutorial Sections
|
413 |
+
#This function takes all four inputs and the learning objectives and uses them to create prompts
|
414 |
+
#Before running, it makes sure that the hook and title and intro have already been generated
|
415 |
+
def GenerateTutorialSections(objectiveInput, learningObjectiveBox, promptBox):
|
416 |
+
|
417 |
+
global TutorialSections #Declare as global
|
418 |
+
|
419 |
+
inputs = {
|
420 |
+
"Video Objective": objectiveInput,
|
421 |
+
"Learning Objectives": learningObjectiveBox,
|
422 |
+
"Prompts": promptBox
|
423 |
+
}
|
424 |
+
|
425 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
426 |
+
|
427 |
+
if empty_inputs:
|
428 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
429 |
+
else:
|
430 |
|
431 |
+
global client
|
432 |
+
client = OpenAI()
|
433 |
+
|
434 |
+
user_message_content = (
|
435 |
+
f"Video Objective: {objectiveInput}\n"
|
436 |
+
f"{learningObjectiveBox}\n"
|
437 |
+
f"{promptBox}\n"
|
438 |
+
)
|
439 |
+
|
440 |
+
response = client.chat.completions.create(
|
441 |
+
model="gpt-4",
|
442 |
+
messages=[
|
443 |
+
{
|
444 |
+
"role": "system",
|
445 |
+
"content": "You are an expert script writer skilled in creating engaging YouTube tutorial scripts for beginners on how to use ChatGPT to solve the problems they encounter in the corporate environment. These scripts must be written in a simple conversational manner, without complex words and technical jargon.\n\nYour current task is to create tutorial sections for each learning objective found in the learning objective summary provided. These learning objectives have corresponding prompts, and you need to incorporate these prompts into the tutorial sections. For more context, you can review the video objective found in the brief. \n\nUsing these three inputs, you need to create tutorial sections that teach the student in a straightforward manner how to use these prompts. Do not greet the viewer as this has already been done in a previous section. Simply jump right into the topic.\n\nWhen writing these sections, in a conversational manner, first describe the task. Then explain why it's useful to utilize ChatGPT for that task. Finally, teach the viewer how to use the prompt. Make sure not to change the prompt that is provided to you. \n\nIf the prompt is an automatic prompt, you will have to tell the viewer to answer the questions asked by ChatGPT before they can get the final result. If the prompt is the second prompt used, make sure to inform the viewer to add that prompt in the same chat. \n\nLastly, once all learning objectives have been covered, make sure to wrap it up with a conclusion. "
|
446 |
+
},
|
447 |
+
{
|
448 |
+
"role": "user",
|
449 |
+
"content": "Video Objective: The objective of the video is to teach the viewer how to use ChatGPT to create email templates for customers and various sales scenarios, so they no longer need to write emails from scratch every single time.\n\nBy the end of this tutorial, you will be able to:\n1. Use ChatGPT to identify different sales scenarios;\n2. Generate personalized email templates for these scenarios using ChatGPT. \n\nPrompt for Learning Objective 1: Identifying Different Sales Scenarios with ChatGPT\n\nYou are a sales expert advisor. Consider the [Your Company]'s popular product/service range. Based on the buyer persona [provide some characteristics of your typical customer], could you suggest some different sales scenarios that our sales team should be prepared for? Ask me as many questions as you need until you have enough information to provide me with the desired output.\n\nPrompt for Learning Objective 2: Generating Personalized Email Templates for Different Sales Scenarios Using ChatGPT\n\nGiven the sales scenario of [provide a specific sales scenario - e.g., following up with a prospect after a meeting, answering a query, etc.], could you help me create a personalized email template to address this? Remember, our brand voice is [describe brand voice - e.g., professional, friendly, informative, casual, etc.]. Ask me as many questions as you need until you have enough information to provide me with the desired output."
|
450 |
+
},
|
451 |
+
{
|
452 |
+
"role": "assistant",
|
453 |
+
"content": "Section 1: \nIdentifying Different Sales Scenarios with ChatGPT\n\nLet's start with our first task - using ChatGPT to identify various sales scenarios. As we know, dealing with customers isn't a one-size-fits-all situation. That's why having well-defined sales scenarios can guide your salesforce in handling a wide range of potential situations more efficiently.\n\nHere's where ChatGPT becomes valuable. It can digest the specifics of your company and its range of services or products, as well as the characteristics of your typical customer, to generate diverse sales scenarios you'll likely encounter. \n\nNow, let's take a look at how we can use the prompt: \n\n\"You are a sales expert advisor. Consider the [Your Company]'s popular product/service range. Based on the buyer persona [provide some characteristics of your typical customer], could you suggest some different sales scenarios that our sales team should be prepared for? Ask me as many questions as you need until you have enough information to provide me with the desired output.\"\n\nStart by replacing '[Your Company]' with the name of your actual company. Following this, for the buyer persona, plug in some key characteristics of your typical customer. Then, press Enter. \n\nWhen you input this prompt into ChatGPT, it will ask you a few questions to get the information it needs to perform the task correctly. Answer the questions, and then press Enter. \n\nAnd finally, GPT will give you a result. Go ahead, repeat and refine this process as many times as you want until you have enough sales scenarios that fit your customers!\n\nSection 2: \nGenerating Personalized Email Templates for Different Sales Scenarios Using ChatGPT\n\nAwesome! Now that we've identified different sales scenarios, let's move on to how you can utilize ChatGPT to create personalized email templates to fit these scenarios. Why personalize? Because each customer and scenario is unique, and using generic templates can create the impression of not fully understanding or respecting the customer's situation. \n\nChatGPT can come really handy here. It can craft sales emails for specific scenarios that align perfectly with your brand voice and focus on your target customer's needs.\n\nIn the same chat, type into ChatGPT: \"Given the sales scenario of [provide a specific sales scenario - e.g., following up with a prospect after a meeting, answering a query, etc.], could you help me create a personalized email template to address this? Remember, our brand voice is [describe brand voice - e.g., professional, friendly, informative, casual, etc.]. Ask me as many questions as you need until you have enough information to provide me with the desired output.\"\n\nFor this prompt, replace '[provide a specific sales scenario]' with one of the sales scenarios that you've previously identified. Then, describe your brand voice where it says '[describe brand voice]'. Then, press Enter. \n\nOnce again, ChatGPT will come up with a few questions that you'll have to answer. Press Enter, and it will give you what you've asked for. \n\nRemember, you can keep refining your questions to get the output just as you want. \n\nConclusion: \nAnd there you have it! In this tutorial, you learned an efficient and straightforward way of identifying sales scenarios and generating personalized email templates using ChatGPT. As you continue to apply these skills, remember that the landscape of sales and customer interactions is ever-evolving. Stay curious, keep experimenting with ChatGPT prompts, and refine your approaches to stay ahead."
|
454 |
+
},
|
455 |
+
{
|
456 |
+
"role": "user",
|
457 |
+
"content": user_message_content
|
458 |
+
}
|
459 |
+
],
|
460 |
+
temperature=1,
|
461 |
+
max_tokens=1500,
|
462 |
+
top_p=1,
|
463 |
+
frequency_penalty=0,
|
464 |
+
presence_penalty=0
|
465 |
+
)
|
466 |
+
|
467 |
+
TutorialSections = response.choices[0].message.content
|
468 |
+
return TutorialSections
|
469 |
+
|
470 |
+
|
471 |
+
#Generate Generate Full Script
|
472 |
+
#This function takes all contents of the text boxes and combines them into something that can be copy-pasted
|
473 |
+
#Before running, it makes sure that the hook and title and intro have already been generated
|
474 |
+
def GenerateFullScript(hookBox, titleAndIntroBox, learningObjectivesBox, tutorialSectionsBox):
|
475 |
+
|
476 |
+
global FinalScript #Declare as global
|
477 |
+
|
478 |
+
inputs = {
|
479 |
+
"Hook": hookBox,
|
480 |
+
"Title and Introduction": titleAndIntroBox,
|
481 |
+
"Learning Objectives": learningObjectivesBox,
|
482 |
+
"Tutorial Sections": tutorialSectionsBox
|
483 |
+
}
|
484 |
+
|
485 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
486 |
+
|
487 |
+
if empty_inputs:
|
488 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
489 |
+
else:
|
490 |
+
FinalScript = hookBox + "\n\n" + titleAndIntroBox + "\n\n" + learningObjectivesBox + "\n\n" + tutorialSectionsBox
|
491 |
+
return FinalScript
|
492 |
+
|
493 |
|
494 |
+
def ClearAndReset(allElems):
|
495 |
+
for i in allElems:
|
496 |
+
i.clear()
|
497 |
+
return None
|
498 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
|
500 |
+
def ReviewAnswers(audienceInput, problemInput, solutionInput, objectiveInput):
|
501 |
+
inputs = {
|
502 |
+
"Audience Input": audienceInput,
|
503 |
+
"Problem Input": problemInput,
|
504 |
+
"Solution Input": solutionInput,
|
505 |
+
"Objective Input": objectiveInput
|
506 |
+
}
|
507 |
|
508 |
+
empty_inputs = [name for name, value in inputs.items() if not value]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
|
510 |
+
if empty_inputs:
|
511 |
+
return ( """Please make sure to fill in these empty inputs: \n""" + "\n".join(empty_inputs))
|
512 |
else:
|
513 |
+
|
514 |
+
global client
|
515 |
+
client = OpenAI()
|
516 |
+
|
517 |
+
user_message_content = (
|
518 |
+
f"Target Audience: {audienceInput}\n"
|
519 |
+
f"Problem: {problemInput}\n"
|
520 |
+
f"Solution: {solutionInput}\n"
|
521 |
+
f"Video Objective: {objectiveInput}"
|
522 |
+
)
|
523 |
+
|
524 |
+
response = client.chat.completions.create(
|
525 |
+
model="gpt-4",
|
526 |
+
messages=[
|
527 |
+
{
|
528 |
+
"role": "system",
|
529 |
+
"content": "You are an expert script writer creating engaging YouTube tutorial scripts for beginners on how to use ChatGPT to solve the problems they encounter in the corporate environment. \n\nYour current task is to review the inputs that people use when they are writing a prompt into ChatGPT. \n\nThe types of input are: \n- Target Audience\n- Problem\n- Solution\n- Video Objective\n\nThe Target Audience refers to the specific audience the writer wants to target. This can be \"HR Recruiter,\" \"Customer Service Personnel\" or something specific. \n\nThe Problem refers to the type of problem the audience faces. The problem must be written in a straightforward manner and be articulated in a clear way. It needs to be specific, not vague. \n\nThe Solution refers to how specifically ChatGPT can help the audience solve that problem. \n\nFinally, the Video Objective refers to the purpose of the video and the steps that need to be achieved in order for the audience to learn what they need to learn. Make sure each step is listed in bullet format. \n\nWhen reviewing inputs, provide a rating for each input and give the writer a rating of 1 (unclear) to 5 (perfectly clear). Then, if their input is unclear, give them feedback without giving them the specific solution. "
|
530 |
+
},
|
531 |
+
{
|
532 |
+
"role": "user",
|
533 |
+
"content": "Target Audience: members of the social media marketing team.\nProblem: Members of the marketing team come up with a text content to post on social media, but it doesn't always match the company's brand voice. \nSolution: With ChatGPT, they can use a prompt to check if their content matches their brand voice and provide suggestions. \nVideo Objective: The objective of the video is to teach the viewer how to:\n- use ChatGPT to review social media text content to check if it matches the brand voice. "
|
534 |
+
},
|
535 |
+
{
|
536 |
+
"role": "assistant",
|
537 |
+
"content": "Target Audience: 5/5 - Your target audience is perfectly clear. \n\nProblem: 5/5 - The problem of maintaining brand voice in social media posts is a common challenge, and you have articulated it well. \n\nSolution: 4/5 - Your solution is correct, as ChatGPT can indeed help with this. Yet, you could have been more specific about how the tool will be used, such as providing an example prompt. \n\nVideo Objective: 4/5 - Your objective is clear, although a more detailed list of steps for using ChatGPT would be beneficial. Remember to break down the process into bitesize points that viewers can follow.\n\nOverall a good effort, a little more detail can, however, improve it and offer better clarity to your viewers."
|
538 |
+
},
|
539 |
+
{
|
540 |
+
"role": "user",
|
541 |
+
"content": user_message_content
|
542 |
+
}
|
543 |
+
],
|
544 |
+
temperature=1,
|
545 |
+
max_tokens=256,
|
546 |
+
top_p=1,
|
547 |
+
frequency_penalty=0,
|
548 |
+
presence_penalty=0
|
549 |
+
)
|
550 |
+
|
551 |
+
review = response.choices[0].message.content
|
552 |
+
return review
|
553 |
+
|
554 |
+
# Main
|
555 |
+
with gr.Blocks(theme=gr.themes.Soft()) as main:
|
556 |
+
with gr.Column():
|
557 |
+
gr.Markdown(introStatement)
|
558 |
+
|
559 |
+
# Main Inputs
|
560 |
+
gr.Markdown(step1Statement)
|
561 |
+
audienceBox = gr.Textbox(label="Who is your audience?")
|
562 |
+
problemBox = gr.Textbox(label="What problem does your audience have?")
|
563 |
+
solutionBox = gr.Textbox(label="How is ChatGPT able to solve this problem?")
|
564 |
+
objectiveBox = gr.Textbox(label="What is this video's objective?")
|
565 |
+
|
566 |
+
# Review Answers
|
567 |
+
reviewAnswersBtn = gr.Button("Review Answers")
|
568 |
+
reviewAnswersBox = gr.Textbox(label="Review Results", interactive=False)
|
569 |
+
|
570 |
+
# Start Button
|
571 |
+
startBtn = gr.Button("Let's start!")
|
572 |
+
|
573 |
+
|
574 |
+
# Forms
|
575 |
+
gr.Markdown(step2Statement)
|
576 |
+
|
577 |
+
with gr.Column():
|
578 |
+
step2aOutput = gr.Textbox(label="Step 2a. Hook")
|
579 |
+
with gr.Row():
|
580 |
+
step2aReject = gr.Button("Regenerate Current Step")
|
581 |
+
step2aApprove = gr.Button("Generate Next Step")
|
582 |
+
|
583 |
+
with gr.Column():
|
584 |
+
step2bOutput = gr.Textbox(label="Step 2b. Title and Introduction")
|
585 |
+
with gr.Row():
|
586 |
+
step2bReject = gr.Button("Regenerate Current Step")
|
587 |
+
step2bApprove = gr.Button("Generate Next Step")
|
588 |
+
|
589 |
+
with gr.Column():
|
590 |
+
step2cOutput = gr.Textbox(label="Step 2c. Learning Objectives")
|
591 |
+
with gr.Row():
|
592 |
+
step2cReject = gr.Button("Regenerate Current Step")
|
593 |
+
step2cApprove = gr.Button("Generate Next Step")
|
594 |
+
|
595 |
+
with gr.Column():
|
596 |
+
step2dOutput = gr.Textbox(label="Step 2d. Prompts")
|
597 |
+
with gr.Row():
|
598 |
+
step2dReject = gr.Button("Regenerate Current Step")
|
599 |
+
step2dApprove = gr.Button("Generate Next Step")
|
600 |
+
|
601 |
+
with gr.Column():
|
602 |
+
step2eOutput = gr.Textbox(label="Step 2e. Tutorial Section and Conclusion")
|
603 |
+
with gr.Row():
|
604 |
+
step2eReject = gr.Button("Regenerate Current Step")
|
605 |
+
step2eApprove = gr.Button("Generate full script")
|
606 |
+
|
607 |
+
# Conclusion
|
608 |
+
gr.Markdown(step3Statement)
|
609 |
+
output = gr.Textbox(label="Output Box")
|
610 |
+
# restart = gr.Button("Want to make another script? Click me!")
|
611 |
+
|
612 |
+
# Set up click events: startBtn
|
613 |
+
startBtn.click(fn = GenerateHook, inputs=[audienceBox, problemBox, solutionBox, objectiveBox, reviewAnswersBox], outputs=step2aOutput)
|
614 |
+
|
615 |
+
# Set up click events: Review
|
616 |
+
reviewAnswersBtn.click(fn = ReviewAnswers, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=reviewAnswersBox)
|
617 |
+
|
618 |
+
# Set up click events: Hook
|
619 |
+
step2aApprove.click(fn = GenerateTitleAndIntro, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=step2bOutput)
|
620 |
+
step2aReject.click(fn = GenerateHook, inputs=[audienceBox, problemBox, solutionBox, objectiveBox, reviewAnswersBox], outputs=step2aOutput)
|
621 |
+
|
622 |
+
# Set up click events: Title and Intro
|
623 |
+
step2bApprove.click(fn = GenerateLearningObjectives, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=step2cOutput)
|
624 |
+
step2bReject.click(fn = GenerateTitleAndIntro, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=step2bOutput)
|
625 |
+
|
626 |
+
# Set up click events: Learning Objecitves
|
627 |
+
step2bApprove.click(fn = GenerateLearningObjectives, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=step2cOutput)
|
628 |
+
step2bReject.click(fn = GenerateTitleAndIntro, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=step2bOutput)
|
629 |
+
|
630 |
+
# Set up click events: Prompts
|
631 |
+
step2cApprove.click(fn = GeneratePrompts, inputs=[audienceBox, problemBox, solutionBox, objectiveBox, step2cOutput], outputs=step2dOutput)
|
632 |
+
step2cReject.click(fn = GenerateLearningObjectives, inputs=[audienceBox, problemBox, solutionBox, objectiveBox], outputs=step2cOutput)
|
633 |
+
|
634 |
+
# Set up click events: Tutorial Sections
|
635 |
+
step2dApprove.click(fn = GenerateTutorialSections, inputs=[objectiveBox, step2cOutput, step2dOutput], outputs=step2eOutput)
|
636 |
+
step2dReject.click(fn = GeneratePrompts, inputs=[audienceBox, problemBox, solutionBox, objectiveBox, step2cOutput], outputs=step2dOutput)
|
637 |
+
|
638 |
+
# Set up click events: Final Script
|
639 |
+
step2eApprove.click(fn = GenerateFullScript, inputs=[step2aOutput, step2bOutput, step2cOutput, step2eOutput], outputs=output)
|
640 |
+
step2eReject.click(fn = GenerateTutorialSections, inputs=[objectiveBox, step2cOutput, step2dOutput], outputs=step2eOutput)
|
641 |
+
|
642 |
+
# Set up click events: reset
|
643 |
+
allElems = [
|
644 |
+
audienceBox,
|
645 |
+
problemBox,
|
646 |
+
solutionBox,
|
647 |
+
objectiveBox,
|
648 |
+
step2aOutput,
|
649 |
+
step2bOutput,
|
650 |
+
step2cOutput,
|
651 |
+
step2dOutput,
|
652 |
+
step2eOutput
|
653 |
]
|
654 |
+
#restart.click(fn = ClearAndReset, inputs=[allElems])
|
655 |
+
|
656 |
|
657 |
+
# Launch
|
658 |
+
main.launch()
|
|
|
|
|
|
|
|
|
|
|
659 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|