SYSTEM_PROMPT = """You are an expert educational content analyzer. Your task is to analyze text content, identify distinct segments, and create high-quality educational quiz questions for each segment.""" ANALYSIS_PROMPT_TEMPLATE_GEMINI = """Analyze the following text and identify distinct segments within it and do text segmentation: 1. Segments should be STRICTLY max=15 2. For each segment/topic you identify: - Provide a SPECIFIC and UNIQUE topic name (3-5 words) that clearly differentiates it from other segments - List 3-5 key concepts discussed in that segment (be precise and avoid repetition between segments) - Write a brief summary of that segment (3-5 sentences) - Create 5 high-quality, meaningful quiz questions based DIRECTLY on the content in that segment only - Questions and answers should be only from the content of the segment For each quiz question: - Create cognitively demanding questions that test COMPREHENSION and ANALYSIS, not just recall - Focus on CORE PRINCIPLES, key insights, and conceptual understanding - Questions should require readers to think critically about the material - AVOID superficial questions about statistics, numbers, or trivial details - AVOID questions about the document structure or presentation - Create one correct answer that comes DIRECTLY from the text - Create two plausible but incorrect answers that require discernment - Ensure all answer options have similar length (± 2 words) - Ensure the correct answer is clearly indicated with a ✓ symbol IMPORTANT QUIZ QUESTION CRITERIA: - Questions should assess understanding of fundamental concepts and principles - Questions should require application of knowledge, not just memorization - Questions should focus on important ideas that have educational value - Questions should be meaningful in an educational context - Questions should challenge the reader to think about implications and connections - No need questions on the introduction, conclusion or the demonstration from the context, ADDITIONAL REQUIREMENT: - **First, detect the language of the original text.** - **Generate ALL output (topic names, key concepts, summaries, and quizzes) in the same language as the original text.** - If the text is in another language, STRICTLY generate responses in that original language. - If the text is in English, generate responses in English language. - If the text is in Russian, generate responses in Russian language. - If the text is in Uzbek, generate responses in Uzbek language. COURSE INFORMATION: - Course Name: {course_name} - Section Name: {section_name} - Lesson Name: {lesson_name} - Use this information to contextualize the quiz and make it relevant to the educational content. - Include this information in the JSON response structure. Text: {text} RESPONSE FORMAT: Return your answer as a valid JSON object with the following structure: {{ "course_info": {{ "course_name": "{course_name}", "section_name": "{section_name}", "lesson_name": "{lesson_name}" }}, "segments": [ {{ "topic_name": "Unique and Specific Topic Name", "key_concepts": ["concept1", "concept2", "concept3"], "summary": "Brief summary of this segment.", "quiz_questions": [ {{ "question": "Question text?", "options": [ {{ "text": "Option A", "correct": false }}, {{ "text": "Option B", "correct": true }}, {{ "text": "Option C", "correct": false }} ] }} ] }} ] }} """ ANALYSIS_PROMPT_TEMPLATE_CLAUDE = """Analyze the following text and identify distinct segments within it and do text segmentation: 1. Segments should be STRICTLY max=15 2. For each segment/topic you identify: - Provide a SPECIFIC and UNIQUE topic name (3-5 words) that clearly differentiates it from other segments - List 3-5 key concepts discussed in that segment (be precise and avoid repetition between segments) - Write a brief summary of that segment (3-5 sentences) - Create 5 high-quality, meaningful quiz questions based DIRECTLY on the content in that segment only - Questions and answers should be only from the content of the segment For each quiz question: - Create cognitively demanding questions that test COMPREHENSION and ANALYSIS, not just recall - Focus on CORE PRINCIPLES, key insights, and conceptual understanding - Questions should require readers to think critically about the material - AVOID superficial questions about statistics, numbers, or trivial details - AVOID questions about the document structure or presentation - Create one correct answer that comes DIRECTLY from the text - Create two plausible but incorrect answers that require discernment - Ensure all answer options have similar length (± 2 words) - Ensure the correct answer is clearly indicated with a ✓ symbol IMPORTANT QUIZ QUESTION CRITERIA: - Questions should assess understanding of fundamental concepts and principles - Questions should require application of knowledge, not just memorization - Questions should focus on important ideas that have educational value - Questions should be meaningful in an educational context - Questions should challenge the reader to think about implications and connections - No need for questions on the introduction, conclusion or the demonstration from the context ADDITIONAL REQUIREMENT: - **First, detect the language of the original text.** - **Generate ALL output (topic names, key concepts, summaries, and quizzes) in the same language as the original text.** - If the text is in Russian, generate all responses in Russian. - If the text is in another language, generate responses in that original language. Text: {text} Course information: - Course name: {course_name} - Section name: {section_name} - Lesson name: {lesson_name} - Do NOT repeat key concepts across multiple segments unless absolutely necessary. - Ensure the quiz questions challenge the reader and are not easily guessable. - FOCUS ON CONCEPTUAL UNDERSTANDING, not trivial facts or statistics. """