The prompt
Question: Who was the president of the united states when Mozart died?
Are follow up questions needed?: yes.
Follow up: When did Mozart died?
Intermediate answer: 1791.
Follow up: Who was the president of the united states in 1791?
Intermediate answer: George Washington.
Final answer: When Mozart died George Washington was the president of the USA.
Question: Where did the Emperor of Japan, who ruled the year Maria
Skłodowska was born, die? What it is
A worked example that teaches the model to break a multi-step question into follow-up questions and intermediate answers before giving a final answer. The source describes it as similar to chain of thought, except that the model asks itself questions instead of going step by step in one answer. The prompt text comes from the Google Gemini API cookbook (Apache-2.0, Copyright 2026 Google LLC). Only the code indentation around it was removed. Original author: Google (google-gemini/cookbook).
Who it's for
- Prompt authors
- Researchers
مثال محلول يعلّم النموذج تقسيم السؤال متعدد الخطوات إلى أسئلة فرعية وإجابات وسيطة قبل الإجابة النهائية.
Examples
Output from the notebook
PromptAre follow up questions needed?: Yes.
Follow up: When was Maria Skłodowska born?
Intermediate answer: 1867.
Follow up: Who was the Emperor of Japan in 1867?
Intermediate answer: Emperor Kōmei.
Follow up: When did Emperor Kōmei die?
Intermediate answer: 1867.
Final answer: Emperor Kōmei died in Kyoto.Expected output: Model output as printed in the source. We did not fact-check it, so verify the intermediate answers.