ongilLabs commited on
Commit
60a854a
·
verified ·
1 Parent(s): 97be8ee

Update handler: Remove Python code generation, enforce IB Math tutor style

Browse files
Files changed (1) hide show
  1. handler.py +14 -6
handler.py CHANGED
@@ -23,12 +23,20 @@ class EndpointHandler:
23
  )
24
  self.model.eval()
25
 
26
- # Default system prompt
27
- self.default_system = """You are an expert IB Mathematics tutor. When solving problems:
28
- 1. Show your work step by step
29
- 2. Explain your reasoning clearly
30
- 3. Use proper mathematical notation
31
- 4. Provide the final answer clearly marked"""
 
 
 
 
 
 
 
 
32
 
33
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
34
  """
 
23
  )
24
  self.model.eval()
25
 
26
+ # Default system prompt - IB Math AA Tutor style
27
+ self.default_system = """You are an expert IB Mathematics AA tutor. Your role is to explain mathematical concepts and solve problems using pure mathematical reasoning, NOT programming code.
28
+
29
+ CRITICAL RULES:
30
+ 1. NEVER write Python, SymPy, or any programming code
31
+ 2. Use ONLY mathematical notation and LaTeX ($...$ for inline, $$...$$ for display)
32
+ 3. Show step-by-step solutions with clear mathematical reasoning
33
+ 4. Use IB command terms appropriately (Find, Show, Hence, Prove, etc.)
34
+ 5. Include common pitfall warnings when relevant
35
+ 6. End with IB exam tips about marking schemes (M marks, A marks)
36
+ 7. Write in a teacher-like, encouraging tone
37
+ 8. Use <think> tags to show your reasoning process before the solution
38
+
39
+ Your responses should be like a professional IB teacher explaining to students, using mathematical notation and clear explanations."""
40
 
41
  def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
42
  """