Spaces:
Runtime error
Runtime error
| """ | |
| Education Tutor domain template. | |
| """ | |
| from typing import List | |
| from .base_domain import BaseDomain | |
| class EducationTutorDomain(BaseDomain): | |
| """ | |
| Education tutor domain for academic subjects, | |
| test preparation, and learning assistance. | |
| """ | |
| def __init__(self): | |
| super().__init__() | |
| self._name = "Education Tutor" | |
| self._description = "Educational tutor assistant for K-12 through college subjects, test preparation, homework help, and learning strategies." | |
| self._icon = "@" | |
| def get_topics(self) -> List[str]: | |
| """Get education tutor topics""" | |
| return [ | |
| "Mathematics - Algebra", | |
| "Mathematics - Geometry", | |
| "Mathematics - Calculus", | |
| "Mathematics - Statistics", | |
| "Mathematics - Trigonometry", | |
| "Mathematics - Pre-Calculus", | |
| "Mathematics - Linear Algebra", | |
| "Mathematics - Differential Equations", | |
| "Physics - Mechanics", | |
| "Physics - Electricity and Magnetism", | |
| "Physics - Thermodynamics", | |
| "Physics - Optics", | |
| "Physics - Quantum Mechanics", | |
| "Chemistry - General Chemistry", | |
| "Chemistry - Organic Chemistry", | |
| "Chemistry - Biochemistry", | |
| "Biology - Cell Biology", | |
| "Biology - Genetics", | |
| "Biology - Ecology", | |
| "Biology - Anatomy and Physiology", | |
| "Computer Science - Programming", | |
| "Computer Science - Data Structures", | |
| "Computer Science - Algorithms", | |
| "Computer Science - Databases", | |
| "English - Grammar and Composition", | |
| "English - Literature Analysis", | |
| "English - Essay Writing", | |
| "English - Reading Comprehension", | |
| "History - World History", | |
| "History - US History", | |
| "History - European History", | |
| "Social Studies - Geography", | |
| "Social Studies - Civics", | |
| "Social Studies - Economics", | |
| "Foreign Languages - Spanish", | |
| "Foreign Languages - French", | |
| "Foreign Languages - German", | |
| "Foreign Languages - Mandarin", | |
| "Test Prep - SAT", | |
| "Test Prep - ACT", | |
| "Test Prep - GRE", | |
| "Test Prep - GMAT", | |
| "Test Prep - MCAT", | |
| "Test Prep - LSAT", | |
| "Test Prep - AP Exams", | |
| "Study Skills and Time Management", | |
| "Note-taking Strategies", | |
| "Memory Techniques", | |
| "Research Methods", | |
| "Critical Thinking" | |
| ] | |
| def get_system_prompt(self) -> str: | |
| """Get education tutor system prompt""" | |
| return """You are an expert educational tutor with deep knowledge across: | |
| - K-12 and college-level academic subjects | |
| - Mathematics (algebra through calculus and beyond) | |
| - Sciences (physics, chemistry, biology) | |
| - Computer science and programming | |
| - English, literature, and writing | |
| - History and social studies | |
| - Foreign languages | |
| - Test preparation (SAT, ACT, GRE, AP exams, etc.) | |
| - Study skills and learning strategies | |
| Your role is to: | |
| 1. Explain concepts clearly and build understanding from fundamentals | |
| 2. Use the Socratic method - ask questions to guide learning | |
| 3. Provide step-by-step explanations for problem-solving | |
| 4. Offer multiple approaches and perspectives | |
| 5. Create practice problems and examples | |
| 6. Adapt explanations to the student's level | |
| 7. Encourage critical thinking and independent learning | |
| 8. Identify knowledge gaps and address misconceptions | |
| Teaching approach: | |
| - Start with what the student knows | |
| - Break complex topics into manageable parts | |
| - Use analogies and real-world examples | |
| - Show work step-by-step | |
| - Explain the "why" behind the "how" | |
| - Encourage questions and exploration | |
| - Provide positive, constructive feedback | |
| - Relate new concepts to previously learned material | |
| For homework help: | |
| - Guide toward the answer rather than giving it directly | |
| - Help students understand the underlying concepts | |
| - Teach problem-solving strategies | |
| - Check understanding with follow-up questions | |
| For test preparation: | |
| - Identify key concepts and common question types | |
| - Provide practice problems with increasing difficulty | |
| - Teach test-taking strategies and time management | |
| - Explain answer choices and common traps | |
| - Build confidence through mastery | |
| Remember: Your goal is to help students truly understand material, not just get correct answers. Foster curiosity, critical thinking, and independent learning skills.""" | |
| def get_example_questions(self) -> List[str]: | |
| """Get example education questions""" | |
| return [ | |
| "Can you explain how to solve quadratic equations?", | |
| "What's the difference between mitosis and meiosis?", | |
| "How do I write a strong thesis statement?", | |
| "Can you help me understand Newton's laws of motion?", | |
| "What are the causes of World War I?", | |
| "How do I balance chemical equations?", | |
| "Can you explain the Pythagorean theorem?", | |
| "What's the difference between DNA and RNA?", | |
| "How should I prepare for the SAT math section?", | |
| "Can you help me understand Shakespeare's use of metaphor?" | |
| ] | |
| def get_specialized_tools(self) -> List[dict]: | |
| """Get education tutor tools""" | |
| return [ | |
| { | |
| "name": "solve_math_problem", | |
| "description": "Solve mathematical problems step-by-step", | |
| "parameters": { | |
| "problem": "string (equation or word problem)", | |
| "subject": "string (algebra, calculus, statistics, etc.)", | |
| "show_steps": "boolean" | |
| }, | |
| "returns": "Solution with detailed steps" | |
| }, | |
| { | |
| "name": "generate_practice_problems", | |
| "description": "Generate practice problems for a topic", | |
| "parameters": { | |
| "subject": "string", | |
| "topic": "string", | |
| "difficulty": "string (easy, medium, hard)", | |
| "quantity": "int" | |
| }, | |
| "returns": "List of practice problems with solutions" | |
| }, | |
| { | |
| "name": "explain_concept", | |
| "description": "Provide detailed explanation of academic concept", | |
| "parameters": { | |
| "concept": "string", | |
| "subject": "string", | |
| "grade_level": "string (elementary, middle, high_school, college)" | |
| }, | |
| "returns": "Explanation with examples and analogies" | |
| }, | |
| { | |
| "name": "check_grammar", | |
| "description": "Check grammar and writing quality", | |
| "parameters": { | |
| "text": "string", | |
| "check_type": "string (grammar, style, structure, all)" | |
| }, | |
| "returns": "Grammar corrections and writing suggestions" | |
| }, | |
| { | |
| "name": "create_study_guide", | |
| "description": "Create study guide for a topic", | |
| "parameters": { | |
| "subject": "string", | |
| "topic": "string", | |
| "format": "string (outline, flashcards, summary, practice_test)" | |
| }, | |
| "returns": "Formatted study guide" | |
| }, | |
| { | |
| "name": "analyze_literary_text", | |
| "description": "Analyze literary devices and themes", | |
| "parameters": { | |
| "text_excerpt": "string", | |
| "author": "string (optional)", | |
| "analysis_focus": "string (theme, symbolism, character, etc.)" | |
| }, | |
| "returns": "Literary analysis with examples" | |
| }, | |
| { | |
| "name": "translate_text", | |
| "description": "Translate text between languages", | |
| "parameters": { | |
| "text": "string", | |
| "source_language": "string", | |
| "target_language": "string", | |
| "include_explanation": "boolean" | |
| }, | |
| "returns": "Translation with grammatical notes" | |
| }, | |
| { | |
| "name": "get_historical_context", | |
| "description": "Get historical context for events or periods", | |
| "parameters": { | |
| "event_or_period": "string", | |
| "region": "string (optional)" | |
| }, | |
| "returns": "Historical context with key dates and figures" | |
| } | |
| ] | |