Welcome to AI Sparks ✨
Ever feel like the world of AI is moving too fast and you're being left behind? You see the headlines and cool demos, but you're not sure where to even start when it comes to building your own projects and skills? My name is Hao Yue, and I started AI Sparks to make AI approachable for every student, help you build knowledge and skills—one small, practical step each week—toward an AI-ready career.
Each week, you'll unlock:
- 📡 AI Radar: Stay ahead of the curve. We cut through the noise and deliver the key AI news and trends, explaining exactly why they matter for your projects, internship interviews, and future career.
- 💡 Concept Quick-Dive: Finally understand the AI concepts you hear everywhere. We break down complex topics into simple, clear explanations you can grasp in minutes.
- 🛠 Hands-on Lab: Build your portfolio, one project at a time. This is where theory becomes reality. Every week, you'll get a practical, step-by-step project that adds a tangible skill to your resume and gives you something impressive to show recruiters.
- 👥 Community Spotlight: You're not learning alone. Join a network of students on the same journey to ask questions, share projects, and find collaborators.
🔥 The First AI Hands-on Lab: Build a ChatGPT-style Chatbot
Ready to build something cool in the next 30 minutes? By the end of this hands-on lab, you'll have your very own working ChatGPT-style chatbot. Just like the real ChatGPT, this is a powerful AI application that can understand users' questions and give intelligent, conversational answers—all from a simple script powered by just 10 lines of code.
💻 Getting Started: Setup & Tools
- A Python IDE (like VS Code) or Google Colab (2-min Tutorial on Google Colab)
- An OpenAI API key — quick guide: How to get my OpenAI API key?
📋 Instructions
-
Open your editor:
IDE (like VS Code): Create a new file named
chat.py.
Google Colab: Create a new notebook. -
Install the OpenAI package:
IDE on macOS or Linux:
Go to Terminal, and run:python3 -m pip install openaiIDE on Windows:
Go to Terminal, and run:py -m pip install openaiGoogle Colab:
Create a code cell, paste and run:%pip install -q openai -
Add code:
IDE:
- Copy-paste the following code into
chat.py. - Replace
"YOUR_API_KEY_HERE"with your OpenAI API key"sk-xxx".
Google Colab:
- Create a second code cell and copy-paste the following code.
- Replace
"YOUR_API_KEY_HERE"with your OpenAI API key"sk-xxx".
# Import the official OpenAI library from openai import OpenAI # Make sure to replace "YOUR_API_KEY_HERE" with your actual API key API_KEY = "YOUR_API_KEY_HERE" client = OpenAI(api_key=API_KEY) # Get a prompt from the user prompt = input("User: ") # Make the API call to the GPT model response = client.chat.completions.create( model="gpt-5", messages=[{"role": "user", "content": prompt}] ) # Print the AI's response print("AI:", response.choices[0].message.content) - Copy-paste the following code into
-
Run it. When prompted, type a question and watch the chatbot reply.
Congratulations! You just built your first AI application. Take a moment to appreciate that—you've taken a huge first step.
🔒 Quick heads-up: Your API key is sensitive. Don't share your file or notebook. Otherwise, your key could be leaked or abused. Once you’ve finished this project, delete your key from the code. We’ll cover safer storage in a later issue.
🎯 Challenge
- Modify the prompt so the AI responds with three bullet points instead of one paragraph. Try asking: “Give me three study tips for finals.”
- Add a
whileloop so the chatbot keeps prompting and responding until the user types"quit".
💡 Why This Matters
This request-and-response workflow is the core pattern behind most AI apps. With just a few lines of code, you’ve created your own ChatGPT-style chatbot. Next steps—like adding memory or different roles—are how real AI products are built.
Your Journey Starts Now 🚀
You just completed your first AI Sparks project. If you found this valuable, imagine what you could build every week. Subscribing is free. Just enter your email below to get a new hands-on AI project, challenge, and career insight delivered straight to your inbox every week.