File size: 5,492 Bytes
9607899
 
 
 
 
 
 
 
76b5430
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9607899
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
JD_PATH = "../jd_data/*"
RESUME_PATH = "../resume_data/*/*"
EMBEDDING_MODEL_NAME = "text-embedding-3-large"
OUTPUT_PATH = "./output/"

JD_EMBEDDINGS_FILENAME = "jd_embeddings_large.pkl"
RESUME_EMBEDDINGS_FILENAME = "resume_embeddings_large.pkl"
IS_EMBEDDINGS_CREATED = True
PROVIDERS = {
    "OpenAI": {
        "env_var": "OPENAI_API_KEY",
        "models": ["gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini"],
        "url": "https://platform.openai.com/api-keys",
    },
    "xAI": {
        "env_var": "XAI_API_KEY",
        "models": ["xai/grok-2-latest", "xai/grok-2-mini"],
        "url": "https://console.x.ai/",
    },
    "Anthropic": {
        "env_var": "ANTHROPIC_API_KEY",
        "models": ["anthropic/claude-sonnet-4-5-20250929", "anthropic/claude-haiku-4-5-20251001"],
        "url": "https://console.anthropic.com/settings/keys",
    },
    "Google": {
        "env_var": "GEMINI_API_KEY",
        "models": ["gemini/gemini-2.0-flash", "gemini/gemini-2.5-flash-preview-04-17"],
        "url": "https://aistudio.google.com/apikey",
    },
}
TEMPLATE_CONTENT = """You are a helpful assistant. You do not respond as 'User' or pretend to be 'User'. You only 
respond once as 'assistant'. 

System Role: Resume Reviewer 

Your role is to act as a resume reviewer. You will assist users in improving their resumes to better align with specific 
job descriptions. Provide professional advice on resume building, interview preparation, and career development. 
Offer constructive feedback and encouragement. Whenever you are given a resume and a job description, there will be 
tokens added before and after the resume and job description. The tokens are as follows: <RESUME STARTS HERE> and 
<RESUME ENDS HERE> for the resume and <JOB DESCRIPTION STARTS HERE> and <JOB DESCRIPTION ENDS HERE> for the job 
description. Utilize these tokens to provide feedback and suggestions and clearly segregate the resume and job
description. Do not mix up the content of the resume and job description. In case the resume or job requirements 
in the description do not align with each other, do not mix up the content of the resume and job description and 
keep them separate and process them accordingly. Provide feedback based only on the content provided.
Strictly ONLY answer the question if it is relevant to resume and job description provided otherwise reply with 
'Please ask a relevant question'. Do not answer general knowledge questions.
"""

comparison_prompt = "Compare the resume: <RESUME STARTS HERE> {}. <RESUME ENDS HERE> with the job description: <JOB DESCRIPTION STARTS HERE> {}.<JOB DESCRIPTION ENDS HERE> Do they match? If not, what are the gaps? Do not make any assumptions about the candidate's skills or experience or the job requirements."
resume_analysis_prompt = "Provide a detailed summary of the candidate's skills, experience, and qualifications based on the content of the following resume: <RESUME STARTS HERE> {}. <RESUME ENDS HERE>"
job_description_analysis_prompt = "List the key skills, qualifications, and experience required as outlined in the following job description: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE>"
gap_analysis_prompt = "Compare the skills and experience detailed in this resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> with the requirements listed in the job description: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE> Identify any gaps or mismatches."
actionable_steps_prompt = "Given the gaps identified between the resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> and the job description: <JOB DESCRIPTION STARTS HERE> {} <JOB DESCRIPTION ENDS HERE>, suggest actionable steps for the candidate to acquire the necessary skills and experience."
experience_enhancement_prompt = "Based on the candidate's experience outlined in this resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE>, recommend practical activities or steps to gain or improve the experience aligned with the needs of this role: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE>"
additional_qualifications_prompt = "For areas where this resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> falls short or does not satisfy the requirements of the job role : <JOB DESCRIPTION STARTS HERE> {} <JOB DESCRIPTION ENDS HERE>, suggest specific areas for improvement. Include recommendations for additional qualifications or certifications."
resume_tailoring_prompt = "Advise on how the candidate can tailor their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> to align more closely with this job description: <JOB DESCRIPTION STARTS HERE> {} <JOB DESCRIPTION ENDS HERE>, focusing on emphasizing skills and experiences relevant to the job description."
relevant_skills_highlight_prompt = "Analyze this resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> and provide suggestions on restructuring it to foreground skills and experiences pertinent to the job description: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE>"
resume_formatting_prompt = "Offer guidance on how the candidate can enhance the formatting of their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> to improve visual appeal and readability."
resume_length_prompt = "Recommend strategies for the candidate to adjust the length of their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE>, ensuring it is concise while remaining aligned with the requirements in the job description: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE>"