Spaces:
Sleeping
Sleeping
| from dataclasses import asdict | |
| from typing import List | |
| from src.models import CompanyRanking, JobMatch, ResumeProfile | |
| def resume_profile_to_json(profile: ResumeProfile) -> dict: | |
| return asdict(profile) | |
| def build_talking_points(rankings: List[CompanyRanking], matches: List[JobMatch], max_companies: int = 8) -> str: | |
| if not rankings: | |
| return "No strong matches found yet. Try a larger company list or resume with more role-specific keywords." | |
| lines = ["## Suggested Recruiter Talking Points", ""] | |
| match_map = {} | |
| for match in matches: | |
| match_map.setdefault(match.company, []).append(match) | |
| for rank in rankings[:max_companies]: | |
| company_matches = sorted(match_map.get(rank.company, []), key=lambda item: item.score, reverse=True) | |
| top = company_matches[0] if company_matches else None | |
| score_text = f"{rank.company_score:.1f}" | |
| lines.append(f"### {rank.company} (Fit Score: {score_text})") | |
| if top: | |
| lines.append( | |
| f"- I noticed your {top.title} role and my resume aligns through {top.explanation}." | |
| ) | |
| lines.append( | |
| "- I can contribute quickly in internship/new-grad responsibilities and would love to discuss current hiring priorities." | |
| ) | |
| else: | |
| lines.append("- Your company aligns with my career goals, and I would like to learn which early-career teams are hiring now.") | |
| lines.append("") | |
| return "\n".join(lines) | |