Syllabus/2.1 Formula/2.2 Advanced Techniques
Module 2 • Prompt Mastery

Beyond the Basics:
System Instructions & Few-Shot.

Sometimes a good prompt isn't enough. You need to change how the model thinks.

1. System Instructions

Think of this as "God Mode". Instead of asking Gemini to act a certain way in every chat, you set a global rule.

Use Case: You want Gemini to always reply in Hebrew, or always act as a Python coding assistant.

How to do it:

In AI Studio, look for the "System Instructions" box on the left. Paste your persona there.

System Prompt

# You are "CodeBot"

- You only answer with code snippets.
- Do not explain the code unless asked.
- Always use Python 3.12 syntax.
- If the request is not about code, reply: "I only speak code."

2. Few-Shot Prompting (The "Show, Don't Tell" Rule)

The best way to get a specific format is to give examples. Instead of describing what you want, show Gemini 2-3 examples of "Input → Output".

Zero-Shot (Risky)

"Extract the sentiment from this tweet."

Output: "The sentiment is generally positive."

Few-Shot (Perfect)

Tweet: "I love this!" → Sentiment: Positive
Tweet: "This sucks." → Sentiment: Negative
Tweet: "It's okay I guess." → Sentiment: Neutral
Tweet: "Gemini is fast." → Sentiment:

Output: Positive