Spaces:
Runtime error
Runtime error
File size: 8,819 Bytes
ec8f374 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
"""
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"
}
]
|