Spaces:
Runtime error
Runtime error
| from __future__ import annotations | |
| from typing import Literal, Optional, Dict, Any | |
| class RouterAgent: | |
| """Simple router that decides the next step in the pipeline.""" | |
| def route(self, payload: Dict[str, Any]) -> Literal["profile", "job", "resume", "cover", "review"]: | |
| # Basic heuristics based on provided payload | |
| if payload.get("cv_text") and not payload.get("profile"): | |
| return "profile" | |
| if payload.get("job_posting") and not payload.get("job_analysis"): | |
| return "job" | |
| if payload.get("profile") and payload.get("job_analysis") and not payload.get("resume_draft"): | |
| return "resume" | |
| if payload.get("resume_draft") and not payload.get("cover_letter_draft"): | |
| return "cover" | |
| return "review" |