Spaces:
Running
Running
| from __future__ import annotations | |
| from services.model_router import ModelRouter | |
| from config.prompts import TUTOR_AGENT_SYSTEM | |
| class TutorAgent: | |
| def __init__(self, router: ModelRouter): self._router = router | |
| def hint(self, question: str, student_answer: str, correct_answer: str, | |
| explanation: str, source_excerpt: str = "") -> str: | |
| context = f"\nSource context: {source_excerpt}" if source_excerpt else "" | |
| prompt = (f"Question: {question}\nStudent answered: {student_answer}\n" | |
| f"Correct answer (do not reveal directly): {correct_answer}\n" | |
| f"Stored explanation: {explanation}{context}\n\nProvide a Socratic hint.") | |
| return self._router.reason(prompt, TUTOR_AGENT_SYSTEM).strip() | |