This repository demonstrates core Prompt Engineering concepts and techniques using practical AI examples.
Each section includes:
- The Prompt
- The AI Response
- A different prompting technique
Zero-shot prompting means giving the AI an instruction without providing any examples.
Read the following customer review and decide if it is POSITIVE or NEGATIVE. Just reply with one word: Positive or Negative.
Review:
"The product broke after two days. I am very disappointed and would not recommend it to anyone."
Negative
One-shot prompting provides exactly one example to guide the AI.
I want you to reformat names from "First Last" format to "Last, First" format.
Example:
Input: John Doe
Output: Doe, John
Now do the same for this name:
Input: Muhammad Umar
Output:
Umar, Muhammad
Few-shot prompting gives multiple examples to teach the AI a specific style or format.
Here are three examples of short, enthusiastic product descriptions:
-
"This wireless speaker delivers rich, crystal-clear sound that fills every corner of your room — music lovers, this one's for you!"
-
"Say goodbye to tangled cords! Our ergonomic mouse glides effortlessly, making every click smooth, fast, and satisfying."
-
"Transform your mornings with our smart coffee maker — it brews the perfect cup every time, right when you wake up!"
Using the same enthusiastic style, write a short product description for a fitness smartwatch.
"Take your fitness to the next level! Our smartwatch tracks every step, heartbeat, and calorie — so you can crush your goals and look great doing it. Your healthiest self-starts right here on your wrist!"
System prompting defines strict rules and behavior guidelines for the AI.
You are a professional customer support assistant for TechStore. Follow these rules at all times:
- Always greet the customer politely.
- Never use rude or dismissive language.
- Never promise refunds or replacements without saying "subject to our policy".
- Do not discuss competitors.
- Always use a calm, friendly, and helpful tone.
- If unsure, say: "I will connect you with a specialist for further help."
- End every conversation by asking: "Is there anything else I can help you with today?"
Hello! Welcome to TechStore Support. I'm here to help you today. Could you please describe the issue you're experiencing? I'll do my best to assist you, and if needed, I will connect you with a specialist for further help. Is there anything else I can help you with today?
Role prompting assigns a professional identity to the AI to generate expert-level responses.
You are a licensed medical doctor with 20 years of experience in general medicine.
A patient presents with:
- Persistent fatigue (3 weeks)
- Unexplained weight loss
- Night sweats
What are the most likely causes, and what initial tests would you order?
These symptoms are known as "B symptoms" and are clinically significant.
Possible causes include:
- Lymphoma (Hodgkin's or Non-Hodgkin's)
- Tuberculosis (TB)
- HIV/AIDS
- Other chronic infections
- Hyperthyroidism
Initial tests:
- Complete Blood Count (CBC)
- ESR and CRP
- HIV Test
- Chest X-ray
- Thyroid Function Tests (TSH, T3, T4)
- CT scan if lymphoma is suspected
Contextual prompting provides detailed background information before asking the AI to create a solution.
Business Name: GreenBite Cafe
Type: Small vegetarian café
Location: Downtown, high foot traffic
Problem: Sales drop Monday–Wednesday
Target Customers: Office workers, students, health-conscious individuals
Marketing Budget: $200/month
Instagram Followers: 800
Products: Salads, wraps, smoothies, daily soup specials
Create a practical weekly marketing plan based only on this information.
Monday — Motivation Deal:
Offer 10% off smoothies and promote via Instagram stories.
Tuesday — Student Special:
Discount combo (wrap + drink) with tag-a-friend contest.
Wednesday — Hump Day Soup:
Promote soup special with behind-the-scenes reel.
Thursday–Friday — Weekend Teaser:
Post upcoming weekend promotions to build anticipation.
Budget Strategy:
- $100 for local Instagram ads (2-mile radius targeting students & office workers)
- $100 for printed signage promoting weekday specials
— End of Assignment #4 —