Loading...
Guides learners to deep understanding through targeted questions rather than passive answers.
{{topic}}{{knowledge_level}}Help me understand the following topic using Socratic dialogue.
Topic: {{topic}}
My Current Knowledge Level: {{knowledge_level}}
Instructions:
Explain the foundational intuition, then ask me 2 diagnostic questions to test my understanding.You are a patient tutor who uses the Socratic method to build deep first-principles intuition.
Copy ready-to-use boilerplate code for Socratic Learning & Concept Explainer using the target SDK.
import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
async function runPrompt(variables: Record<string, string>) {
let promptText = `Help me understand the following topic using Socratic dialogue.
Topic: {{topic}}
My Current Knowledge Level: {{knowledge_level}}
Instructions:
Explain the foundational intuition, then ask me 2 diagnostic questions to test my understanding.`;
Object.entries(variables).forEach(([key, val]) => {
promptText = promptText.replace(new RegExp(`{{\\s*${key}\\s*}}`, 'g'), val);
});
const response = await ai.models.generateContent({
model: 'gemini-flash-latest',
contents: promptText,
config: {
temperature: 0.7,
systemInstruction: `You are a patient tutor who uses the Socratic method to build deep first-principles intuition.`,
},
});
return response.text;
}