import openai import random import gradio as gr import os openai.api_key = os.environ.get('OPENAI_API_KEY') manual = r"""Input your variables in the fields on the left. The last two (Extra input and Team) are optional, but recommended. You can use it to steer the prompt into a certain direction by adding more requirements. """ # Define the messages for step_1 SystemPrompt_10 = r""""You are a script writer and prompt engineer creating engaging YouTube tutorial scripts 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 costs. Concepts must be explained, and one must always assume they are talking to a 5-year-old. The structure of the script will look like this: - Hook - Title - Introduction - 2 Learning Objectives and their execution - Conclusion You'll only focus on the Hook, Title and Intro. Here are instructions for each: THE HOOK: To write the hook, ask yourself, "In this video, what problem are we solving with ChatGPT and whose problem is it?" Take the answer to this question and then state how this problem can be solved with ChatGPT. Finally, put yourself in the target audience's shoes and restate the hook in an engaging manner that does not lose the student's attention - but not in a way that loses the original problem statement. For a video about "Creating Effective Drafts for Positioning Statements in Marketing with ChatGPT", an example of a good hook is: "As a marketer, have you ever wondered how to make your brand truly stand out in the crowded marketplace? Imagine if you could clearly define what makes your brand unique and why customers should choose it over others. That's the essence of a positioning statement, and with ChatGPT, crafting this vital piece of your marketing puzzle just got easier!" This is a good example because it focuses on the problem (creating drafts for positioning statements), it is targeted to a specific audience (marketer), and it explains what a positioning statement is. An example of a bad hook is "Have you ever found yourself stuck while trying to draft a compelling positioning statement for your brand? What if you could easily generate drafts that resonate with your target audience and stand out from your competitors? With ChatGPT, you can!" The bad example assumes that the audience understands the concept of a positioning statement. This is a bad example because it assumes the student knows what a positioning statement is, and it does not define who the target audience is (in this case, a marketer). THE TITLE: The title should be visualizing in an engaging way how the tutorial solves a specific problem for a specific target audience. The title must be straight to the point, consist of a maximum of two phrases. It must not use abstract phrasing. An example of a good title is "Proofread Your Marketing Content with ChatGPT" or "Draft Marketing Positioning Statements with ChatGPT." This is a good example because it is straight to the point and the student understands exactly what the video is going to cover. An example of a bad title is "Edit like a Pro: Using ChatGPT to Refine and Align Your Content" This is a bad example because it is unclear what "refining" or "aligning" marketing content even means and it does not specify a target audience. THE INTRO: To write the intro, first give an overview the problem that you are trying to solve. Present the student with context and an explanation of what the task is and why it's important. Then, finally conclude the intro by saying how ChatGPT can help you solve that problem. An example of a good intro is: "A positioning statement is a key tool in marketing that defines how you want your brand to be perceived in the minds of your customers. It's about pinpointing what sets you apart from competitors and why your target audience should care. But creating an effective positioning statement is often easier said than done. It's not just about catchy phrases; it involves a deep dive into understanding your market, what your brand stands for, and how you can uniquely fulfill your customers' needs. That's where ChatGPT steps in. In this tutorial, we'll guide you through the process of using ChatGPT to develop positioning statements that capture the essence of your brand and connect with your audience. Whether you're new to marketing or looking to refine your brand's message, this tool is your ally in crafting statements that are not only clear and memorable but also strategically aligned with your brand identity and business objectives. Ready to transform your brand's messaging? Let's dive in!" This is a good example because it explains in a straightforward way what is going to be learned in the tutorial. It provides context and explains the concept of a positioning statement, something that the audience may not understand. And example of a bad intro is: "Crafting the perfect positioning statement for your brand can be quite a challenge. It's not just about being creative; it requires deep understanding of your target market and competitors, strategic thinking, and continuous refining based on feedback. But what if there was a tool that could help you do all this without breaking a sweat? That's where ChatGPT comes in. In this tutorial, we'll show you how to use ChatGPT to create unique and compelling positioning statement drafts that align with your brand identity and marketing goals. Let's get started!" This is a bad example because it assumes the student knows what a positioning statement is. Sometimes additional instructions are given. These could be incorporated in the hook, title and/or intro if relevant, but often they should be ignored, if they apply to the learning objectives - which are outside the scope of your current task. """ UserPrompt_10 = r""""Task: Create a job ad with discoverable keywords Task Description: Create a job advertisement for a Human Resources (HR) team, strategically incorporating keywords to optimize discoverability. Ensure the ad highlights essential qualifications and responsibilities relevant to the role in HR. Emphasize the importance of teamwork, communication skills, and HR-specific knowledge in the task description. Additional instructions: The tutorial is aimed at employees in a HR department." """ AssistantPrompt_10 = r""""HOOK: As an HR recruiter, you might be struggling to find the right words to attract the perfect candidate for your job opening. Picture a tool that helps you create a job ad that not only outlines the role but also includes the right keywords to make it easily discoverable. With ChatGPT, writing a job ad that gets noticed just got a lot simpler! TITLE: Craft Attention-Grabbing Job Ads with ChatGPT: A Guide for HR Recruiters INTRO: Welcome, HR recruiters! Crafting a job advertisement is an art and a science. It's not just about listing the requirements of the job; it's about painting a vivid picture of the role and your company culture, while also strategically using keywords to attract a diverse pool of qualified candidates. Whether you're hiring for a technical wizard, a creative genius, or a strategic thinker, every word in your job ad matters. But how do you create an ad that's both engaging and easy to find for the right talent? Enter ChatGPT. In this tutorial, we'll explore how ChatGPT can be your ally in developing job ads that don't just list, but speak to, and engage with, potential candidates. From understanding the nuances of different roles to embedding the right keywords for optimal discoverability, ChatGPT is here to help you create ads that resonate with your target audience. Are you ready to transform your recruitment process and attract the best talent out there? Let's dive in! """ UserPrompt_11 = r""""Task: Crafting product update checklists on product updates and new features for customer onboarding Task Description: Review the latest product updates and new features, ensuring a comprehensive understanding of their functionalities and benefits. 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. 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. Additional instructions: The tutorial is aimed at employees in a Client Support department.""" AssistantPrompt_11 = r""""HOOK: 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! TITLE: Create Easy-to-Follow Product Update Checklists with ChatGPT: A Guide for Client Support Teams INTRO: 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. 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!""" # Define messages for stepTwo SystemPrompt_20 = r"""You are a script writer and prompt engineer creating engaging YouTube tutorial scripts on how to use ChatGPT for specific tasks in a corporate environment. Given some instructions, a hook, a title, and an introduction, you design the execution part of the script. Come up with 2 learning objectives about tasks that can be executed with the help of ChatGPT. This is the structure you'll follow: - Learning Objectives Summary - Learning Objective 1 - Learning Objective 2 - Learning Objective 3 (this third one is optional) - Conclusion The learning objectives state the specific learning objectives that will be covered in the tutorial. They must always start with an Action Verb that specifies what the learner should do. Common verbs include "demonstrate," "explain," "analyze," "solve," "create," "compare," and so on. The choice of verb reflects the type of cognitive or skill-based activity the learner should engage in. Make sure to also include: - the exact prompt(s) the user needs to type into ChatGPT. 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."; - realistic sample data for a case study, if applicable; - for every learning objective, explanations of concepts that the audience may not understand. """ UserPrompt_20 = r"""Topic of the tutorial: How to create a Job Ad with ChatGPT. Additional instructions: Use digital marketing manager as an example role. *HOOK* If you want your job ads to be found by the right candidates, you have to incorporate the right SEO-friendly keywords. But how do you accomplish this without a lot of experience in Search Engine Optimization? Well, with ChatGPT. *TITLE* Create a Job Ad with ChatGPT *INTRO* In this digital age, getting your job ad to stand out amongst the rest is crucial to finding the best candidates. Today, we'll show you how to use ChatGPT to create a job ad that not only resonates with your ideal candidates, but also ranks high with SEO-friendly keywords. """ AssistantPrompt_20 = r"""*LEARNING OBJECTIVES SUMMARY* You will learn how to: - Create an ideal job description - Extract SEO-friendly keywords - Craft a job ad Let's dive right in! *LEARNING OBJECTIVE 1* First, let's create the ideal job description. You can't create the perfect job ad without first creating the job description. 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. Creating a comprehensive job description is critical for attracting the right candidates, setting expectations, and ensuring both the employee and employer understand the role's responsibilities. To create a basic job description, you at least need to define the job title, the overview of the role, and the role's key responsibilities. It's also preferable to already identify any other details about the role, like qualifications and skills, experience level, salary and benefits, reporting structure, and working hours. Let's say you've been tasked to recruit a 'Digital Marketing Manager'. Gather as much information as you can on the specifics of this job from the person that made the request. For this tutorial, we’ll be using the following sample information. The job title is "Digital marketing manager." Here's an overview of the role: "The digital marketing manager is responsible for managing the overall digital marketing strategy of xpedite.ai. He/she is also responsible for: - overseeing online marketing campaigns and other digital projects to optimize online brand presence and boost revenue. - managing a team of 3 digital marketers." The key responsibilities of the role are "propose and execute digital marketing strategies, manage and oversee digital channels, monitor and measure ROI and KPIs of online campaigns." Now, we're ready to write our prompt. Type: “You are 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.) Ask me as many questions as you need until you have enough information to provide me with the desired output." Then press the send button. ChatGPT asked relevant questions until it had enough information to come up with the desired output. Make sure to review and revise this job description so it effectively communicates your expectations. *LEARNING OBJECTIVE 2* 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. Keywords are important because they make your job ad discoverable. The best keywords should resonate with the job seekers' search behavior. Let's get keywords from ChatGPT. Type: "Provide keywords related to the role of Digital Marketing Manager based on the description you've provided me." Then, press the send message button. ChatGPT came up with a couple of keywords that we can use when posting our final job ad. We can also incorporate these keywords into the job ad itself. *LEARNING OBJECTIVE 3* 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. Type: "Using the job description and the keywords you've provided, draft a job ad for a Digital Marketing Manager." Then, press the send button. Here's the response. ChatGPT drafted a job ad that contains specific details about the job description and incorporates keywords so that it's easier to find on the internet. Make sure to review and revise the ad and verify that all information is accurate before posting it online. *CONCLUSION* That's it! By leveraging the power of ChatGPT-4, HR professionals can create job advertisements that stand out and attract top talent. Remember, in the digital age of recruitment, your job ad is your first impression. So make it count!""" UserPrompt_21 = r""""Task: Crafting product update checklists on product updates and new features for customer onboarding Task Description: Review the latest product updates and new features, ensuring a comprehensive understanding of their functionalities and benefits. 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. 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. Additional instructions: The tutorial is aimed at employees in a Client Support department." HOOK: 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! TITLE: Create Easy-to-Follow Product Update Checklists with ChatGPT: A Guide for Client Support Teams INTRO: 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. 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!""" AssistantPrompt_21 = r"""*LEARNING OBJECTIVES SUMMARY* By the end of this tutorial, you will be able to: 1. Use ChatGPT to interpret product updates and new features 2. Generate detailed, user-friendly checklists for product onboarding *LEARNING OBJECTIVE 1* Firstly, let's get a comprehensive understanding of product updates and their benefits. 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. 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. To get a comprehensive understanding, feed this information to ChatGPT. Type into the ChatGPT: "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." Then, press the send button. ChatGPT will ask relevant questions until it has enough information to provide a detailed explanation. *LEARNING OBJECTIVE 2* 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. Type into the ChatGPT: "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." Then, press the send button. ChatGPT will generate a comprehensive checklist, breaking down complex procedures into simple, digestible steps. *CONCLUSION* 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!""" # Function to make API call def api_call(messages, temperature=0.9, model="gpt-4-1106-preview"): return openai.ChatCompletion.create( messages=messages, temperature=temperature, model=model ).choices[0].message.content # Function to be called by Gradio interface def process_inputs(EPA_title, Task_Description, Extra_input, Department): # Check if EPA_title is empty if not EPA_title: return manual if not Extra_input: stepOne = [ {"role": "system", "content": SystemPrompt_10}, {"role": "user", "content": UserPrompt_10}, {"role": "assistant", "content": AssistantPrompt_10}, {"role": "user", "content": UserPrompt_11}, {"role": "assistant", "content": AssistantPrompt_11}, {"role": "user", "content": f"""Task: {EPA_title}. Task Description: {Task_Description} Additional Instructions: The tutorial should be aimed at employees in a {Department} department."""} ] Script_1st_half = api_call(stepOne, 0.7) stepTwo = [ {"role": "system", "content": SystemPrompt_20}, {"role": "user", "content": UserPrompt_20}, {"role": "assistant", "content": AssistantPrompt_20}, {"role": "user", "content": UserPrompt_21}, {"role": "assistant", "content": AssistantPrompt_21}, {"role": "user", "content": f"""Task: {EPA_title}. Task Description: {Task_Description} Additional Instructions: The tutorial should be aimed at employees in a {Department} department."""} ] Script_2nd_half = api_call(stepTwo, 0.7) Script_complete = Script_1st_half + "\n\n" + Script_2nd_half return Script_complete else: # Step 1: User input and first API call ~5secs stepOne = [ {"role": "system", "content": SystemPrompt_10}, {"role": "user", "content": UserPrompt_10}, {"role": "assistant", "content": AssistantPrompt_10}, {"role": "user", "content": UserPrompt_11}, {"role": "assistant", "content": AssistantPrompt_11}, {"role": "user", "content": f"""Topic of the tutorial: {EPA_title} Additional instructions: {Extra_input} The tutorial is aimed at employees in a {Department} department."""} ] Script_1st_half = api_call(stepOne, 0.7) stepTwo = [ {"role": "system", "content": SystemPrompt_20}, {"role": "user", "content": UserPrompt_20}, {"role": "assistant", "content": AssistantPrompt_20}, {"role": "user", "content": f"""Topic of the tutorial: {EPA_title} Additional instructions: {Extra_input} The tutorial is aimed at employees in a {Department} department. {Script_1st_half}"""} ] Script_2nd_half = api_call(stepTwo, 0.7) Script_complete = Script_1st_half + "\n\n" + Script_2nd_half return Script_complete departments = { "3D": "3D Modeling", # Label and value differ "Client Support": "Client Support", "Data Entry & Back Office": "Data Entry & Back Office", "Education Administration (ENI)": "Education Administration", # Label and value differ "Finance": "Finance", "Marketing": "Marketing", "HR": "HR", "IT": "IT", "Legal": "Legal", "Product Management": "Product Management", "Project Management/Coordination": "Project Management/Coordination", "Process Management": "Process Management", "QA": "QA", "R&D": "R&D", "Sales": "Sales", "Software": "Software", "Video Production": "Video Production", "Visual Management": "Visual Management" } # Create the Gradio interface iface = gr.Interface( fn=process_inputs, inputs=[ gr.Textbox(lines=2, label='Task Title Here... (Start the phrase with a verb, like Obtain, Create etc.")'), gr.Textbox(lines=2, label='Task Description (Input a single sentence, if possible.)'), gr.Textbox(lines=2, label='Extra input Here... (You may leave this part empty)'), gr.Dropdown(choices=departments, label="Select Team", searchable=True) ], outputs=gr.Textbox(label="Script", show_copy_button=True) ) iface.launch(share=True) iface.launch()