Module 7: Building Prompt-Based Projects


    7.1 Resume Generator with Prompt Templates

    A Resume Generator using prompt templates allows you to quickly generate professional resumes by filling in user details and sending them as a structured prompt to an AI like ChatGPT or Claude. This is ideal for job seekers, developers, or SaaS builders.

    What Are Prompt Templates?

    Prompt templates are reusable text patterns with placeholders like {name}, {skills}, or {experience} that are filled with real user input before sending to the AI.

    Example Prompt Template

    Create a modern and professional resume for the following person:
    
    Name: {name}  
    Email: {email}  
    Phone: {phone}  
    Career Objective: {objective}  
    Skills: {skills}  
    Work Experience: {experience}  
    Education: {education}  
    Certifications: {certifications}  
    
    Format the resume in bullet points, suitable for applying to tech jobs.
      

    How to Build It

    1. Design a form (web/mobile) to collect user info: name, skills, experience, etc.
    2. Fill the prompt template using the collected data.
    3. Send it to an AI API like ChatGPT via backend using OpenAI's API.
    4. Display or download the formatted resume to the user.

    Example Backend in Node.js (Express + OpenAI)

    const express = require("express");
    const bodyParser = require("body-parser");
    const { Configuration, OpenAIApi } = require("openai");
    
    const app = express();
    app.use(bodyParser.json());
    
    const openai = new OpenAIApi(new Configuration({ apiKey: "your-api-key" }));
    
    app.post("/generate-resume", async (req, res) => {
      const data = req.body;
    
      const prompt = `
    Create a professional resume for:
    Name: ${data.name}
    Email: ${data.email}
    Phone: ${data.phone}
    Career Objective: ${data.objective}
    Skills: ${data.skills}
    Work Experience: ${data.experience}
    Education: ${data.education}
    Certifications: ${data.certifications}
    `;
    
      const response = await openai.createChatCompletion({
        model: "gpt-4",
        messages: [{ role: "user", content: prompt }],
      });
    
      res.send({ resume: response.data.choices[0].message.content });
    });
    
    app.listen(3000, () => console.log("Resume API running on port 3000"));
      

    Features to Add

    • Download resume as PDF
    • Multiple resume styles (Modern, Classic, ATS-optimized)
    • Multi-language support
    • Auto-correct spelling and grammar before submission

    Benefits of Prompt-Based Resume Generator

    • Saves time for job seekers
    • Removes the need for resume-writing skills
    • Helps create tailored resumes per job role
    • Easy to deploy as SaaS or portfolio project


    7.2 YouTube Script Bot

    A YouTube Script Bot automates the process of generating engaging and structured video scripts using prompt templates and AI like ChatGPT or Claude. This is useful for creators, faceless channels, education, tech news, and more.

    Core Idea

    You take an input (e.g., topic, tone, duration) and pass it to a structured prompt that asks the AI to write a full YouTube script including intro, hook, main content, and outro.

    Sample Prompt Template

    Write a YouTube script in a [tone] tone for the topic: "[topic]".
    
    Instructions:
    - Hook the viewer in the first 10 seconds
    - Provide engaging and informative content
    - Include interesting facts or stats
    - End with a strong CTA (subscribe/like)
    
    Video Duration: [duration] minutes
    Script Language: [language]
      

    Example Filled Prompt

    Write a YouTube script in an engaging tone for the topic: "Rise and Fall of Nokia".
    
    Instructions:
    - Hook the viewer in the first 10 seconds
    - Provide a historical timeline and key events
    - Mention the impact of smartphones
    - End with a CTA to like and subscribe
    
    Video Duration: 6 minutes
    Script Language: English
      

    Frontend Features

    • Input fields: Topic, Tone, Duration, Language
    • Dropdowns for genre: Tech, Finance, Documentary, Comedy
    • “Generate Script” button to call backend
    • Display result in a textarea with “Copy” and “Download” options

    Backend Sample (Node.js + OpenAI)

    app.post("/generate-script", async (req, res) => {
      const { topic, tone, duration, language } = req.body;
    
      const prompt = \`
    Write a YouTube script in a \${tone} tone for the topic: "\${topic}".
    Instructions:
    - Hook the viewer in the first 10 seconds
    - Provide valuable and engaging content
    - Include facts or storytelling
    - End with a CTA to like/subscribe
    
    Video Duration: \${duration} minutes
    Script Language: \${language}
    \`;
    
      const response = await openai.createChatCompletion({
        model: "gpt-4",
        messages: [{ role: "user", content: prompt }],
      });
    
      res.send({ script: response.data.choices[0].message.content });
    });
      

    Advanced Features You Can Add

    • Voiceover integration (ElevenLabs, Google TTS)
    • Thumbnail title suggestions
    • Script styling: Short-form (Reels), Long-form (10+ mins)
    • Multi-lingual support
    • Export as PDF or .txt

    Use Cases

    • Faceless YouTube channels
    • Educational content creators
    • Crypto/Tech news channels
    • Reel/Shorts script generation


    7.3 Custom Chatbot for a PDF

    A Custom PDF Chatbot allows users to interact with the contents of a PDF using natural language. It’s useful for summarizing reports, answering questions from documentation, analyzing legal documents, and more.

    Core Workflow

    1. Upload a PDF
    2. Parse and chunk its text using tools like PDF.js or PyMuPDF
    3. Store the chunks in a vector database (e.g., ChromaDB, Pinecone, Weaviate)
    4. Use semantic search (via embeddings) to retrieve relevant chunks based on the user's query
    5. Pass the retrieved chunks + user query into a prompt to generate a final response

    Prompt Template (for GPT)

    You are an expert assistant helping a user read a document.
    
    Context:
    [INSERT relevant PDF chunks]
    
    Question:
    [USER QUERY]
    
    Answer the question based on the above context only.
    If not answerable, say "Sorry, I couldn't find that in the document."
      

    Frontend Features

    • Upload PDF button
    • Textbox for asking questions
    • Chat-style response window
    • “Reset Chat” or “Clear” button

    Backend Stack

    • PDF Parser: PyMuPDF / pdfplumber
    • Embedding: OpenAI Embeddings or HuggingFace Transformers
    • Vector DB: Chroma, Pinecone, FAISS
    • LLM: GPT-3.5 / GPT-4 / Claude

    Sample Code (Python + LangChain)

    from langchain.document_loaders import PyMuPDFLoader
    from langchain.vectorstores import FAISS
    from langchain.embeddings import OpenAIEmbeddings
    from langchain.chains import RetrievalQA
    from langchain.chat_models import ChatOpenAI
    
    # Load PDF
    loader = PyMuPDFLoader("sample.pdf")
    documents = loader.load()
    
    # Create vector DB
    embeddings = OpenAIEmbeddings()
    db = FAISS.from_documents(documents, embeddings)
    
    # Setup retriever
    qa = RetrievalQA.from_chain_type(
        llm=ChatOpenAI(),
        chain_type="stuff",
        retriever=db.as_retriever()
    )
    
    # Ask a question
    query = "What is the summary of Chapter 2?"
    answer = qa.run(query)
    print(answer)
      

    Advanced Features

    • Chunk PDF intelligently (based on headings, not fixed length)
    • Highlight relevant text in the original PDF viewer
    • Support multiple PDFs at once
    • Login system for saving user history
    • Export chat history as TXT or PDF

    Use Cases

    • Legal document Q&A
    • Educational material reader
    • Internal company handbooks
    • Research paper summarization


    7.4 Email Summarizer from Inbox

    An Email Summarizer helps users save time by providing concise summaries of their emails. By integrating with a user's inbox, we can automatically fetch recent emails and use LLMs to summarize them intelligently.

    Core Workflow

    1. Connect to user's email inbox via Gmail API or IMAP
    2. Fetch the latest emails (with optional filters: unread, last 24 hours, etc.)
    3. Extract relevant fields: subject, sender, date, and body
    4. Clean the text and remove signatures, repeated content, etc.
    5. Chunk if necessary and summarize using an LLM (like GPT-4 or Claude)

    Prompt Template for Summarization

    You are an assistant summarizing emails for a user.
    
    Email Content:
    [INSERT EMAIL BODY TEXT]
    
    Write a concise, clear summary of this email in 2-3 lines.
    If the email is spam or promotional, just return "Spam/Promotional Email".
      

    Frontend Features

    • Login via Google (OAuth2) to access Gmail inbox
    • Button: “Summarize My Inbox”
    • Filter options: unread, last 7 days, important only
    • Display summarized emails in a clean UI
    • Download summary as PDF or send to your email

    Tech Stack

    • Frontend: React / Next.js
    • Backend: Python Flask / Node.js
    • Email Access: Gmail API or IMAP
    • LLM: OpenAI GPT-3.5/4, Claude, Gemini

    Sample Python Code (Using Gmail API + OpenAI)

    from google.oauth2.credentials import Credentials
    from googleapiclient.discovery import build
    from openai import OpenAI
    
    # Connect to Gmail API
    creds = Credentials.from_authorized_user_file("token.json")
    service = build('gmail', 'v1', credentials=creds)
    results = service.users().messages().list(userId='me', labelIds=['INBOX'], maxResults=5).execute()
    messages = results.get('messages', [])
    
    # Fetch email content
    email_data = []
    for msg in messages:
        txt = service.users().messages().get(userId='me', id=msg['id']).execute()
        payload = txt['payload']
        headers = payload['headers']
        parts = payload.get('parts', [])
        body = parts[0]['body']['data'] if parts else ''
        decoded_body = base64.urlsafe_b64decode(body).decode('utf-8')
        email_data.append(decoded_body)
    
    # Summarize using OpenAI
    for email in email_data:
        response = openai.ChatCompletion.create(
            model="gpt-3.5-turbo",
            messages=[{
                "role": "user",
                "content": f"Summarize this email: {email}"
            }]
        )
        print(response['choices'][0]['message']['content'])
      

    Advanced Features

    • Classify emails: Work, Personal, Promotional, Spam
    • Daily automatic summary digest
    • Smart notifications (e.g., urgent emails only)
    • Multi-account support
    • Voice assistant integration (e.g., "Read my summaries")

    Use Cases

    • Busy professionals managing high email volume
    • Customer support teams summarizing user queries
    • Students managing newsletters and updates
    • Project managers reviewing team status updates


    7.5 JSON to Blog Generator

    The JSON to Blog Generator is a powerful tool that allows users to input structured JSON data (like titles, bullet points, and metadata), and convert it into well-written, SEO-optimized blog posts using LLMs and custom prompts.

    Core Workflow

    1. User provides a JSON input with fields like: title, intro, points, tags, CTA, etc.
    2. Parse the JSON and extract all relevant values
    3. Feed the extracted data to a prompt template
    4. Send to an LLM like GPT-4 to generate the blog content
    5. Display the generated blog on the frontend with formatting options

    Sample JSON Input

    {
      "title": "Top 5 Productivity Tools in 2025",
      "intro": "In today's fast-paced world, staying productive is more important than ever.",
      "points": [
        "Notion – for note-taking and task management",
        "Slack – for team communication",
        "Trello – for project tracking",
        "Grammarly – for writing assistance",
        "Clockify – for time tracking"
      ],
      "conclusion": "These tools can supercharge your productivity. Try them out!",
      "cta": "Subscribe to our newsletter for more productivity tips!"
    }
      

    Prompt Template

    You are a professional blog writer.
    
    Given the following structured data in JSON format, generate a complete blog post with:
    - An engaging title
    - An attention-grabbing introduction
    - A detailed section on each point
    - A conclusion
    - A clear CTA (call to action)
    
    JSON:
    [INSERT_JSON_HERE]
    
    Generate the blog post in HTML format.
      

    Frontend Features

    • JSON Editor / Upload Box
    • “Generate Blog” button
    • Preview generated blog post
    • Copy, Download, or Export as HTML/Markdown
    • Toggle SEO suggestions (meta title, description, keywords)

    Tech Stack

    • Frontend: React.js / Vue
    • Backend: Python Flask / Node.js
    • LLM: OpenAI GPT-4 / Claude / Gemini

    Sample Python Code (JSON to Blog)

    import openai
    import json
    
    # Sample JSON input
    data = {
      "title": "Top 5 Productivity Tools in 2025",
      "intro": "In today's fast-paced world, staying productive is more important than ever.",
      "points": [
        "Notion – for note-taking and task management",
        "Slack – for team communication",
        "Trello – for project tracking",
        "Grammarly – for writing assistance",
        "Clockify – for time tracking"
      ],
      "conclusion": "These tools can supercharge your productivity. Try them out!",
      "cta": "Subscribe to our newsletter for more productivity tips!"
    }
    
    prompt = f"""
    You are a blog writer. Convert the following JSON data into a full blog post:
    {json.dumps(data, indent=2)}
    """
    
    response = openai.ChatCompletion.create(
        model="gpt-4",
        messages=[{"role": "user", "content": prompt}]
    )
    
    print(response['choices'][0]['message']['content'])
      

    Use Cases

    • SEO teams generating blogs from topic briefs
    • Automated blog creation from marketing data
    • Newsletter generation from structured input
    • Repurposing structured FAQs into articles

    Advanced Features

    • Multi-language blog generation
    • Auto-scheduling to publish via WordPress API
    • Auto-image suggestions using keywords
    • Content scoring for SEO and readability

    No comments:

    Post a Comment