Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,331 +5,75 @@ import os
|
|
| 5 |
|
| 6 |
openai.api_key = os.environ["OpenAPI_Key"]
|
| 7 |
|
| 8 |
-
manual = r"""
|
| 9 |
-
"""
|
| 10 |
|
| 11 |
-
# Define the
|
| 12 |
-
SystemPrompt_10 = r"""
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
- Hook
|
| 16 |
-
- Title
|
| 17 |
-
- Introduction
|
| 18 |
-
- 2 Learning Objectives and their execution
|
| 19 |
-
- Conclusion
|
| 20 |
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|
| 38 |
-
|
| 39 |
-
But how do you accomplish this without a lot of experience in Search Engine Optimization?
|
| 40 |
-
|
| 41 |
-
Well, with ChatGPT.
|
| 42 |
-
|
| 43 |
-
*TITLE*
|
| 44 |
-
Create a Job Ad with ChatGPT
|
| 45 |
-
|
| 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 |
-
|
| 108 |
-
*LEARNING OBJECTIVE 1*
|
| 109 |
-
You can't create the perfect job ad without first creating the job description.
|
| 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 |
-
|
| 117 |
-
Let's say you've been tasked to recruit a 'Digital Marketing Manager'.
|
| 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*
|
| 150 |
-
With this description, we can proceed to extract keywords which potential candidates might use when searching for this job.
|
| 151 |
-
|
| 152 |
-
Keywords are important because they make your job ad discoverable. The best keywords should resonate with the job seekers' search behavior.
|
| 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 |
-
|
| 161 |
-
ChatGPT came up with a couple of keywords that we can use when posting our final job ad.
|
| 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.
|
| 172 |
-
|
| 173 |
-
Here's the response.
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
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.
|
| 177 |
-
|
| 178 |
-
Make sure to review and revise the ad and verify that all information is accurate before posting it online.
|
| 179 |
-
|
| 180 |
-
*CONCLUSION*
|
| 181 |
-
That's it!
|
| 182 |
-
|
| 183 |
-
By leveraging the power of ChatGPT-4, HR professionals can create job advertisements that stand out and attract top talent.
|
| 184 |
-
|
| 185 |
-
Remember, in the digital age of recruitment, your job ad is your first impression. So make it count!"""
|
| 186 |
|
| 187 |
|
| 188 |
# Function to make API call
|
| 189 |
-
def api_call(messages, temperature=0.
|
| 190 |
-
return openai.ChatCompletion.create(
|
| 191 |
messages=messages,
|
| 192 |
temperature=temperature,
|
| 193 |
model=model
|
| 194 |
).choices[0].message.content
|
| 195 |
|
| 196 |
-
|
| 197 |
# Function to be called by Gradio interface
|
| 198 |
-
def process_inputs(
|
| 199 |
-
# Check if
|
| 200 |
-
if not
|
| 201 |
return manual
|
| 202 |
-
if not
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
{"role": "assistant", "content": AssistantPrompt_10},
|
| 207 |
-
{"role": "user", "content": UserPrompt_11},
|
| 208 |
-
{"role": "assistant", "content": AssistantPrompt_11},
|
| 209 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}"""}
|
| 210 |
-
]
|
| 211 |
-
Script_1st_half = api_call(stepOne, 0.7)
|
| 212 |
-
|
| 213 |
-
stepTwo = [
|
| 214 |
-
{"role": "system", "content": SystemPrompt_20},
|
| 215 |
-
{"role": "user", "content": UserPrompt_20},
|
| 216 |
-
{"role": "assistant", "content": AssistantPrompt_20},
|
| 217 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 218 |
-
|
| 219 |
-
{Script_1st_half}"""}
|
| 220 |
-
]
|
| 221 |
-
Script_2nd_half = api_call(stepTwo, 0.7)
|
| 222 |
-
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
| 223 |
-
return Script_complete
|
| 224 |
-
if Extra_input and not Department:
|
| 225 |
-
stepOne = [
|
| 226 |
-
{"role": "system", "content": SystemPrompt_10},
|
| 227 |
-
{"role": "user", "content": UserPrompt_10},
|
| 228 |
-
{"role": "assistant", "content": AssistantPrompt_10},
|
| 229 |
-
{"role": "user", "content": UserPrompt_11},
|
| 230 |
-
{"role": "assistant", "content": AssistantPrompt_11},
|
| 231 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 232 |
-
Additional instructions: {Extra_input}"""}
|
| 233 |
-
]
|
| 234 |
-
Script_1st_half = api_call(stepOne, 0.7)
|
| 235 |
-
|
| 236 |
-
stepTwo = [
|
| 237 |
-
{"role": "system", "content": SystemPrompt_20},
|
| 238 |
-
{"role": "user", "content": UserPrompt_20},
|
| 239 |
-
{"role": "assistant", "content": AssistantPrompt_20},
|
| 240 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 241 |
-
Additional instructions: {Extra_input}
|
| 242 |
-
|
| 243 |
-
{Script_1st_half}"""}
|
| 244 |
-
]
|
| 245 |
-
Script_2nd_half = api_call(stepTwo, 0.7)
|
| 246 |
-
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
| 247 |
-
return Script_complete
|
| 248 |
-
|
| 249 |
-
if Department and not Extra_input:
|
| 250 |
-
stepOne = [
|
| 251 |
-
{"role": "system", "content": SystemPrompt_10},
|
| 252 |
-
{"role": "user", "content": UserPrompt_10},
|
| 253 |
-
{"role": "assistant", "content": AssistantPrompt_10},
|
| 254 |
-
{"role": "user", "content": UserPrompt_11},
|
| 255 |
-
{"role": "assistant", "content": AssistantPrompt_11},
|
| 256 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 257 |
-
The tutorial is aimed at employees in a {Department} department."""}
|
| 258 |
-
]
|
| 259 |
-
Script_1st_half = api_call(stepOne, 0.7)
|
| 260 |
-
|
| 261 |
-
stepTwo = [
|
| 262 |
-
{"role": "system", "content": SystemPrompt_20},
|
| 263 |
-
{"role": "user", "content": UserPrompt_20},
|
| 264 |
-
{"role": "assistant", "content": AssistantPrompt_20},
|
| 265 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 266 |
-
The tutorial is aimed at employees in a {Department} department.
|
| 267 |
-
|
| 268 |
-
{Script_1st_half}"""}
|
| 269 |
-
]
|
| 270 |
-
Script_2nd_half = api_call(stepTwo, 0.7)
|
| 271 |
-
Script_complete = Script_1st_half + "\n\n" + Script_2nd_half
|
| 272 |
-
return Script_complete
|
| 273 |
-
|
| 274 |
-
else: # All fields filled out
|
| 275 |
-
# Step 1: User input and first API call ~5secs
|
| 276 |
stepOne = [
|
| 277 |
{"role": "system", "content": SystemPrompt_10},
|
| 278 |
-
{"role": "user", "content":
|
| 279 |
-
{"role": "assistant", "content": AssistantPrompt_10},
|
| 280 |
-
{"role": "user", "content": UserPrompt_11},
|
| 281 |
-
{"role": "assistant", "content": AssistantPrompt_11},
|
| 282 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}.
|
| 283 |
-
Additional instructions: {Extra_input}.
|
| 284 |
-
The tutorial is aimed at employees in a {Department} department."""}
|
| 285 |
-
]
|
| 286 |
-
Script_1st_half = api_call(stepOne, 0.7)
|
| 287 |
-
|
| 288 |
-
stepTwo = [
|
| 289 |
-
{"role": "system", "content": SystemPrompt_20},
|
| 290 |
-
{"role": "user", "content": UserPrompt_20},
|
| 291 |
-
{"role": "assistant", "content": AssistantPrompt_20},
|
| 292 |
-
{"role": "user", "content": f"""Topic of the tutorial: {EPA_title}
|
| 293 |
-
Additional instructions: {Extra_input}
|
| 294 |
-
The tutorial is aimed at employees in a {Department} department.
|
| 295 |
-
|
| 296 |
-
{Script_1st_half}"""}
|
| 297 |
]
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
|
| 302 |
|
| 303 |
-
departments = {
|
| 304 |
-
"3D": "3D Modeling", # Label and value differ
|
| 305 |
-
"Client Support": "Client Support",
|
| 306 |
-
"Data Entry & Back Office": "Data Entry & Back Office",
|
| 307 |
-
"Education Administration (ENI)": "Education Administration", # Label and value differ
|
| 308 |
-
"Finance": "Finance",
|
| 309 |
-
"Marketing": "Marketing",
|
| 310 |
-
"HR": "HR",
|
| 311 |
-
"IT": "IT",
|
| 312 |
-
"Legal": "Legal",
|
| 313 |
-
"Product Management": "Product Management",
|
| 314 |
-
"Project Management/Coordination": "Project Management/Coordination",
|
| 315 |
-
"Process Management": "Process Management",
|
| 316 |
-
"QA": "QA",
|
| 317 |
-
"R&D": "R&D",
|
| 318 |
-
"Sales": "Sales",
|
| 319 |
-
"Software": "Software",
|
| 320 |
-
"Video Production": "Video Production",
|
| 321 |
-
"Visual Management": "Visual Management"
|
| 322 |
-
}
|
| 323 |
|
| 324 |
-
# Create the Gradio interface
|
| 325 |
iface = gr.Interface(
|
| 326 |
-
fn=process_inputs,
|
| 327 |
inputs=[
|
| 328 |
-
|
| 329 |
-
gr.Textbox(lines=2, label='
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
outputs=gr.Textbox(label="Script", show_copy_button=True)
|
| 333 |
)
|
| 334 |
|
| 335 |
iface.launch(share=True)
|
|
|
|
| 5 |
|
| 6 |
openai.api_key = os.environ["OpenAPI_Key"]
|
| 7 |
|
| 8 |
+
manual = r"""Vul beide velden in door titel en course tree te kopiëren vanuit de Factsheet in MES Editor, en druk op Submit."""
|
|
|
|
| 9 |
|
| 10 |
+
# Define the system message
|
| 11 |
+
SystemPrompt_10 = r"""You're a factsheets creator: creating factsheets for our e-learning modules that comply precisely with the requirements. The user will send as input:
|
| 12 |
+
1. Title of e-learning
|
| 13 |
+
2. Course structure
|
| 14 |
|
| 15 |
+
You will convert this info into a factsheet, with the following components:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
-Description:
|
| 18 |
+
[Catchy text with a short explanation what the module is about(75 - 100 words, a few sentences), in Dutch.Use language like: 'In deze module bespreken we ...'.]
|
| 19 |
|
| 20 |
+
-Competencies:
|
| 21 |
+
f.Competences: Select the competences, related to this course from the list below and should not exceed 3:
|
| 22 |
+
1.Vakinhoudelijk / Klinisch handelen
|
| 23 |
+
2. Communicatie
|
| 24 |
+
3. Samenwerking
|
| 25 |
+
4. Organisatie
|
| 26 |
+
5. Maatschappelijk handelen
|
| 27 |
+
6. Kennis en wetenschap
|
| 28 |
+
7. Professionaliteit
|
| 29 |
|
| 30 |
+
Please add the respective percentage for each competence. Use % that are only multiples of 10, e.g. 10%, 20% and so on, and not 15%, 25% and so on. Naturally, the sum of all should be 100%.
|
| 31 |
+
Just give your best estimate.
|
| 32 |
|
| 33 |
+
- Target group(s)
|
| 34 |
+
[pick one from: Onderwijsassistent / Persoonlijk Begeleider MZ / Gespecialiseerd pedagogisch medewerker. If none of those qualify, make up your own.]"""
|
| 35 |
+
UserPrompt_10 = r""""""
|
| 36 |
+
AssistantPrompt_10 = r""""""
|
| 37 |
+
UserPrompt_11 = r""""""
|
| 38 |
+
AssistantPrompt_11 = r""""""
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
# Function to make API call
|
| 43 |
+
def api_call(messages, temperature=0.5, model="gpt-4"):
|
| 44 |
+
return openai.ChatCompletion.create(
|
| 45 |
messages=messages,
|
| 46 |
temperature=temperature,
|
| 47 |
model=model
|
| 48 |
).choices[0].message.content
|
| 49 |
|
|
|
|
| 50 |
# Function to be called by Gradio interface
|
| 51 |
+
def process_inputs(Name, Tree):
|
| 52 |
+
# Check if either field is empty
|
| 53 |
+
if not Name:
|
| 54 |
return manual
|
| 55 |
+
if not Tree:
|
| 56 |
+
return manual
|
| 57 |
+
else:
|
| 58 |
+
# Step 1: User input and first API call
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
stepOne = [
|
| 60 |
{"role": "system", "content": SystemPrompt_10},
|
| 61 |
+
{"role": "user", "content": f"Title of e-learning: {Name}\n\nCourse structure:\n{Tree}"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
]
|
| 63 |
+
|
| 64 |
+
Script_1 = api_call(stepOne, 0.7)
|
| 65 |
+
return Script_1
|
| 66 |
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
# Create the Gradio interface
|
| 70 |
iface = gr.Interface(
|
| 71 |
+
fn=process_inputs,
|
| 72 |
inputs=[
|
| 73 |
+
gr.Textbox(lines=2, label='Name of e-learning'),
|
| 74 |
+
gr.Textbox(lines=2, label='Course Structure')
|
| 75 |
+
],
|
| 76 |
+
outputs=gr.Textbox(label="Suggested Factsheet info (please revise)", show_copy_button=True)
|
|
|
|
| 77 |
)
|
| 78 |
|
| 79 |
iface.launch(share=True)
|