Generative AI for Kids

advanced · 7 lessons

Generate text, images, and code with AI. Use modern LLMs in your own apps.

Try in Applaa Builder — Free

7 lessons

  1. 1

    Tokens — How AI Reads Text

    AI models don't read words — they read tokens. A token is roughly 4 characters or ¾ of a word. 'Hello world' is about 2 tokens. Why does it matter? Because AI models have a context window — a maximum number of tokens they can process at once. Understanding tokens helps you write better prompts!

    3 min10 XPQuiz
  2. 2

    Prompt Engineering — Talking to AI Effectively

    The way you phrase a prompt dramatically changes the AI's response. Be specific, give context, tell the AI its role, and give examples of what you want. Bad prompt = vague answer. Great prompt = exactly what you need. Let's learn the patterns!

    3 min10 XPQuiz
  3. 3

    Calling an AI API with fetch()

    AI models are accessed over the internet using APIs. You send a POST request with your prompt as JSON, the server runs the AI model, and sends back the response. Let's see the structure — even if you don't have an API key, you'll understand exactly how it works!

    3 min10 XPQuiz
  4. 4

    Chat History — Making AI Remember

    By default, AI has no memory between calls. To have a conversation, you send the ENTIRE history each time: the system prompt + all previous messages. This is how ChatGPT works under the hood! You maintain a messages array and append each new exchange.

    3 min10 XPQuiz
  5. 5

    System Prompts — Giving AI a Personality

    The system prompt is a special message sent before the user's messages. It defines the AI's persona, constraints, and style. Changing the system prompt changes how the AI responds to the same question. This is how apps like Duolingo's AI tutor or Snapchat's AI work!

    3 min10 XPQuiz
  6. 6

    Structured Output — Getting JSON from AI

    Sometimes you need AI to return structured data (not just text) so you can use it in your code. Ask the AI to respond with JSON and parse it with JSON.parse(). Modern AI APIs also support 'response_format: json_object' mode. This is powerful for building apps!

    3 min10 XPQuiz
  7. 7

    Mini Project — Build a Study Buddy Chatbot

    Let's combine everything to build a Study Buddy chatbot! It has a system prompt persona, maintains conversation history, handles the user's messages, and formats the response. In a real app you'd connect to an actual AI API, but we'll simulate the full structure.

    3 min10 XPQuiz