File size: 1,948 Bytes
602f88e
 
 
 
 
 
 
586b608
602f88e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

from pydantic import BaseModel, Field
from typing import List, Optional, Literal

class SkillGap(BaseModel):
    skill_name: str = Field(
        ..., 
        description="The specific  tool missing or requiring an upgrade (e.g., 'Docker')"
    )
    
    gap_type: Literal["missing_foundation", "needs_advanced_upgrade"] = Field(
        ...,
        description=(
            "missing_foundation: Candidate has no recorded experience in this core requirement. "
            "needs_advanced_upgrade: Candidate knows the basics but needs role-specific advanced training."
        )
    )
    
    priority: Literal["high", "medium", "low"] = Field(
        ...,
        description="How critical this skill is for the target job role."
    )
    
    reasoning: str = Field(
        ...,
        description=(
            "Explain exactly WHY this gap was flagged based on the resume vs JD comparison. "
            "Example: 'JD requires FastAPI; candidate has Python experience but no record of using FastAPI framework.'"
        )
    )
    
    target_competency: str = Field(
        ...,
        description="The specific outcome the candidate needs to reach (e.g., 'Build asynchronous database endpoints')"
    )

class SkillGapAnalysis(BaseModel):
    job_title: str = Field(..., description="The target role from the JD")
    candidate_name: Optional[str] = Field(None, description="Extracted name from resume")
    
    analyzed_gaps: List[SkillGap] = Field(
        default_factory=list,
        description="List of specific technical gaps found between Resume and JD"
    )
    
    is_fresher_adaptation_needed: bool = Field(
        default=False,
        description="True if foundational corporate/soft-skill modules should be added to the path."
    )
    
    executive_summary: str = Field(
        ...,
        description="A 2-3 sentence overview of the candidate's readiness and the primary focus of the onboarding."
    )