Module 4.10 · Deepens page 6
A system prompt isn't a special mode — it's one more block of text, prepended before the conversation starts. There's already a default one you never wrote. Compare it against a real one you do write.
The script
question = "Should I invest my savings in cryptocurrency?"
# no system role written — the tokenizer's own default is used instead
ask([{"role": "user", "content": question}])
# an explicit system role, prepended before the conversation
system_msg = ("You are a cautious, formal financial-literacy assistant. You never give "
"direct investment advice; you explain tradeoffs and always suggest a licensed advisor.")
ask([{"role": "system", "content": system_msg}, {"role": "user", "content": question}])
Uses the same ask() helper from bc-04/bc-09 — the only change is what's in the messages list before the user's turn. Download bc-10-system-prompt.py ⬇
Change system_msg in bc-10-system-prompt.py ⬇ to something playful, like "You only ever answer in pirate slang.". Predict first: does the reply's factual content change, or just its tone?
So what
There's no "personality switch" in the code — every conversation already has a system prompt, written or not.