File size: 3,222 Bytes
1fe46a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
59
60
61
62
63
64
65
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.prompts import PromptTemplate
from config.settings import get_settings


def get_llm():
    settings = get_settings()
    return ChatGoogleGenerativeAI(
        model=settings["llm_model"],
        temperature=settings["temperature"],
        google_api_key=settings["google_api_key"],
    )


def get_unified_resume_prompt():
    return PromptTemplate(
        input_variables=["resume_text", "relevant_content", "job_role"],
        template='''You are a professional resume analyzer with expertise in technical recruiting.
            
        Your task is to extract both basic information and relevant work experience from the resume.

        RESUME CONTENT:
        {resume_text}

        MOST RELEVANT SECTIONS (semantically similar to job requirements):
        {relevant_content}

        TARGET JOB ROLE: {job_role}

        TASK INSTRUCTIONS:
        Basic Information:
        1. Extract basic information that is explicitly stated in the text
        2. For fields where information is not found, use null
        3. Do not invent or infer information not present in the text
        4. If multiple educational institutions are mentioned, include the most recent one
        5. For role, use the most recent/current position mentioned
        6. Return complete values - do not truncate or summarize unnecessarily
        7. Maintain exact formatting/capitalization as shown in the resume

        Experience Analysis:
        1. Write a SINGLE comprehensive paragraph describing ALL relevant work experience for the target job role
        2. Focus ONLY on experiences that are DIRECTLY relevant to the specified job role
        3. Include specific responsibilities, achievements, and technologies that directly relate to the target role
        4. Be EXTREMELY STRICT - only include experiences that explicitly demonstrate relevant skills
        5. Organize the information chronologically within the single paragraph
        6. If no relevant experience is found, state this clearly

        FORMAT YOUR RESPONSE AS A VALID JSON OBJECT WITH THIS EXACT STRUCTURE:
        {{
            "candidate_name": "full name of the candidate",
            "university_name": "name of university/institute if mentioned, do not add location of institute, example : ABC College, USA, just return ABC COllege",
            "location": "location of the institute if mentioned,example : ABC College, USA, just return USA",
            "physical_address": "complete physical address of the candidate if mentioned",
            "role": "current or most recent role/position",
            "relevant_experiences": "A single comprehensive paragraph describing all relevant work experience for the target role",
            "experience_summary": "brief summary analyzing how the candidate's relevant experiences align with the job role"
        }}

        IMPORTANT:
        - DO NOT INVENT OR ADD INFORMATION that is not in the resume
        - BE EXTREMELY STRICT about experience relevance
        - Response must be a valid JSON object
        - The relevant_experiences field must be a single text paragraph, not a list or nested object'''
    )