| from typing import Dict, List |
|
|
| def map_facts(facts: Dict[str, str]) -> Dict[str, List[str]]: |
| """Map enriched facts into 10 predefined buckets""" |
| |
| |
| buckets = { |
| "Team & Manager": [], |
| "Tech Stack Snapshot": [], |
| "Business Context": [], |
| "Comp & Leveling": [], |
| "Career Trajectory": [], |
| "Culture/WLB": [], |
| "Interview Runway": [], |
| "Onboarding & Tooling": [], |
| "Location/Remote": [], |
| "Strategic Risks": [] |
| } |
| |
| |
| for key, value in facts.items(): |
| if not value or value.strip() == "": |
| continue |
| |
| |
| if any(keyword in key.lower() for keyword in ["manager", "team", "hiring"]): |
| buckets["Team & Manager"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| elif any(keyword in key.lower() for keyword in ["stack", "tools", "github", "tech"]): |
| buckets["Tech Stack Snapshot"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| elif any(keyword in key.lower() for keyword in ["news", "business", "company", "domain"]): |
| buckets["Business Context"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| elif any(keyword in key.lower() for keyword in ["salary", "comp", "levels", "pay"]): |
| buckets["Comp & Leveling"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| elif any(keyword in key.lower() for keyword in ["culture", "blind", "rating", "wlb", "work"]): |
| buckets["Culture/WLB"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| elif any(keyword in key.lower() for keyword in ["location", "remote", "office", "hybrid"]): |
| buckets["Location/Remote"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| else: |
| buckets["Business Context"].append(f"**{key.replace('_', ' ').title()}**: {value}") |
| |
| |
| buckets = {k: v for k, v in buckets.items() if v} |
| |
| return buckets |