0PricingLogin
AI Agents · Lesson

Zero-shot, Few-shot and Chain-of-Thought

Three core prompting techniques: ask directly, show examples, or ask the model to reason step-by-step before answering.

Three Foundational Techniques

Three prompting techniques every agent engineer must know:

  1. Zero-shot — ask directly, no examples
  2. Few-shot — show 1-5 examples of the desired behavior
  3. Chain-of-thought (CoT) — make the model reason step by step before answering

Zero-shot Example

Zero-shot is the default: just ask.

prompt = 'Translate to French: Hello, how are you?'
# Model output: 'Bonjour, comment allez-vous?'

All lessons in this course

  1. Zero-shot, Few-shot and Chain-of-Thought
  2. System vs User vs Assistant Roles
  3. Output Formatting (JSON, XML, Markdown)
  4. Avoiding Prompt Injection in Inputs
← Back to AI Agents