{"service":"AI Resume Analyzer with Role-Specific Analysis","version":"5.1.0","description":"AI resume analysis with four-layer validation (incl. image PDF detection), role-specific scoring, honest mismatch detection, and analysis_status in every response","what_changed_in_v5_1":{"new_1":"Layer 0 image PDF detection — scanned/photo PDFs are detected and rejected instantly, before any LLM call","new_2":"analysis_status: true/false field in every API response","new_3":"failure_reason object with type, message, and action in all error responses","new_4":"File bytes read once only — no double-consume, no seek() needed","new_5":"Post-extraction fallback image check for edge-case scanned PDFs"},"what_changed_in_v5":{"problem_fixed":"Previously the analyzer gave high scores and generic strengths regardless of role fit","fix_1":"System prompt now enforces strict role-specific evaluation for ALL analysis sections","fix_2":"Added pre-analysis role-fit check (_check_role_mismatch) that runs before full analysis","fix_3":"Added role_fit_assessment block in every response with compatibility rating and mismatch explanation","fix_4":"Honest scoring bands defined — a CS resume for Dancer role now correctly scores 10-25%","fix_5":"Strengths now only list skills RELEVANT to the target role","fix_6":"Primary weakness is now the background mismatch itself when roles don't align"},"features":{"image_pdf_detection":"✅ Layer 0 — scanned/photo PDFs rejected instantly (zero API cost)","analysis_status":"✅ analysis_status: true/false in every response","failure_reason":"✅ failure_reason with type, message, action when analysis_status is false","role_specific_analysis":"✅ All strengths, weaknesses, and scores tied to target role","honest_scoring":"✅ Low score for mismatched roles, high for matching ones","mismatch_detection":"✅ Pre-analysis check detects role-background mismatch","role_fit_assessment":"✅ Dedicated block in response explaining compatibility","validation_pipeline":["Layer 0: Image PDF detection — rejects scanned/photo PDFs instantly (no API cost)","Layer 1: LLM document classifier — catches non-resume documents","Layer 2: Heuristic keyword validator — fast weighted scoring (no API cost)","Layer 3: LLM validator — only for ambiguous cases from Layer 2"],"resume_analysis":"✅ Complete resume analysis with ATS scoring","job_search":"✅ Integrated job search with realistic listings","scoring_system":"✅ Multi-category scoring with detailed breakdowns","strengths_analysis":"✅ Role-relevant strengths only","weaknesses_analysis":"✅ Mismatch-first weaknesses with fix priorities","improvement_plan":"✅ Role-specific actionable recommendations","job_market_analysis":"✅ Honest role compatibility and market positioning","caching":"✅ Content-based caching for consistent results","database":"✅ Shared database integration","user_tracking":"✅ Per-user analysis storage and retrieval","analysis_history":"✅ Full analysis history for each user","pdf_extraction":"✅ Optimized PDF text extraction","error_handling":"✅ Comprehensive error handling","performance":"✅ Parallel processing and optimization"},"endpoints":{"/analyze-resume":{"method":"POST","description":"Role-specific analysis with three-layer validation","content_type":"multipart/form-data","fields":{"file":"PDF file (required)","username":"string (required) - User identifier","target_role":"string (optional) - Critical for role-specific scoring","search_jobs":"boolean (default: true)","location":"string (default: India)"}},"/user/{username}/analyses":{"method":"GET","description":"Get all analyses for a specific user"},"/analysis/{username}/{analysis_id}":{"method":"DELETE","description":"Delete a specific analysis"},"/health":{"method":"GET","description":"Service health check with features"}},"scoring_guide":{"0-20":"Completely mismatched background — no relevant experience for target role","21-40":"Severe mismatch — only very minor transferable skills","41-55":"Partial mismatch — transferable soft skills but missing core requirements","56-70":"Moderate fit — some relevant skills but lacks key requirements","71-85":"Good fit — meets most requirements with minor gaps","86-100":"Excellent fit — strong match for the target role"}}