Summary of Today’s Gen AI Classroom: Three Tones, One Agent – Driving Behaviour from a Dictionary (1 Oct 2026)

Yesterday we wrote system prompts by hand. Today we made them configurable, so the tutor’s teaching style becomes a runtime choice rather than an edit to the code.

1. The Three Tones

ToneBehaviour
DetailedA tutor giving full explanations with examples
RevisionCrisp and minimal, for recall before an exam
BeginnerAssumes zero prior knowledge, starts from ground zero

Same question, same code. Only the system prompt changes.

2. Tones as Data, Not Code

TONES = {
    "detailed": "You are a tutor. Explain thoroughly with examples.",
    "revision": "Give crisp, exam-ready points. No elaboration.",
    "beginner": "Assume zero knowledge. Explain from first principles.",
}

tone = TONES.get(user_choice, TONES["beginner"])

Use .get(), not TONES[user_choice]. Square brackets raise a KeyError and kill the program when someone types a tone that doesn’t exist. .get() lets you fall back to the beginner tone instead.

Rule of thumb: any time user input becomes a dictionary key, use .get() with a default.

3. A Reusable Options Helper

def base_options(**kwargs):
    opts = {"system_prompt": tone, "max_turns": 1}
    opts.update(kwargs)
    return ClaudeAgentOptions(**opts)
  • **kwargs collects any extra settings the caller passes.
  • ClaudeAgentOptions(**opts) unpacks the dictionary into named arguments.
  • Adding tools or any other SDK property later means updating one dictionary, not every call site.

That’s the real point: configuration lives in one place.

4. Driving It from Input

The main() function now asks for two things: the question, and the tone. Testing showed the difference clearly — ask about data types and the beginner tone builds up from what a type even is, while the revision tone returns a categorised summary.

On cost: roughly 2–3 cents per question. That’s the default model doing the work. Set Haiku in your options and it drops by close to a factor of ten for this kind of task.

5. Workflow Tips

  • Paste LLM output into a .md file and preview it with Ctrl+Shift+V (Cmd+Shift+V on Mac). Markdown in a terminal is unreadable.
  • Keep a VS Code shortcut cheat sheet nearby rather than memorising shortcuts.

6. Honest Status: This Is Not Yet an Agent

What we have is a configured model call. No tools, no memory. It can’t act and it can’t remember you.

Next session we switch from query to ClaudeSDKClient and add:

  • Session IDs, so several simulated students (A, B, C) stay separate
  • Conversation history, so the tutor remembers what each student asked before

That’s when it starts behaving like a tutor rather than a search box.

✅ Action Items

  1. Implement the tone dictionary and the options helper yourself. Type it; don’t copy it.
  2. Run the same question through all three tones and compare the outputs side by side.
  3. Switch the model to Haiku and check the cost difference.
  4. Missed the last session? Review the posted summaries before the next one, since we build directly on them.

Note: today’s Python class was cancelled.

⏭️ Next up: the Claude client, session IDs and multi-user memory.

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading