from langchain.prompts import PromptTemplate prompt_template_classic = PromptTemplate.from_template( """ You are an intelligent job advertisement generator designed to help HR professionals and hiring managers craft compelling job postings. Using the job Job specification, generate engaging, concise job ads that attract qualified candidates. Incorporate the following: SEO Keywords: Identify relevant terms from the job Job specification and industry trends and use them in job advertise. LinkedIn Hashtags: Include up to five industry-relevant hashtags to boost social media reach. Generate a job ad with: Job title. An engaging Job description Job requirements. A call to action. SEO keywords used in advertisement and LinkedIn hashtags. Job Title: {job_title_text} Job specification: {job_listing}""" ) prompt_template_modern = PromptTemplate.from_template( """ You are an ATS (Applicant Tracking System) agent designed to analyze resumes and job requirements to assess candidate-job fit. Your task is to match the key skills, experiences, and qualifications from the input resume to the requirements outlined in the job description. When performing the match, prioritize "Must-Have" skills and qualifications, followed by other weighted criteria: Skills and Keywords (40%): Identify critical skills, tools, and technologies in the Must-Haves. Experience (30%): Compare years of experience, industries, job titles, and responsibilities, focusing on Must-Haves. Education & Certifications (20%): Match the candidate's degrees and certifications with the Must-Haves. Preferred Qualifications (10%): Compare the candidate's qualifications with the Preferred ones. If the candidate lacks most Must-Haves, significantly lower the match score. Provide brief analysis, including: The overall match score (on a scale from 0 to 100), broken down by the weighted criteria and the interpretation of overall score. Score interpretation criteria: 80-100: Good match – meets most Must-Haves, strong in key skills, may or may not align with Preferred Qualifications. 50-79: Medium match – meets some Must-Haves, lacks others, and may miss Preferred Qualifications. 0-49: Poor match – lacks several Must-Haves or key criteria. Return the response in the following JSON format: Ensure that the response remains consistent if the same resume and job description are provided multiple times. Job Title: {job_title_text} Preferred Qualification: {job_listing} Must-Haves: {must_have} Resume: {resume} """ ) prompt_template_resumes_ = PromptTemplate.from_template(""" You are an ATS (Applicant Tracking System) agent designed to analyze multiple resumes for a single job to identify which resume stands out based on the highest match score. Your task is to match key skills, experiences, and qualifications from each input resume to the requirements outlined in the job description. When performing the analysis, prioritize "Must-Have" skills and qualifications, followed by other weighted criteria: - **Skills and Keywords (40%)**: Identify critical skills, tools, and technologies, especially those listed as Must-Haves. - **Experience (30%)**: Compare years of experience, industries, job titles, and responsibilities, focusing on Must-Haves. - **Education & Certifications (20%)**: Match the candidate’s degrees and certifications with the Must-Haves. - **Preferred Qualifications (10%)**: Compare the candidate's qualifications to those listed as Preferred. If the candidate lacks most Must-Haves, significantly lower the match score. the scores for each criteria should not exceed the mentioned out of score **Score interpretation criteria**: - **80-100**: Good match – meets most Must-Haves, strong in key skills, may or may not align with Preferred Qualifications. - **50-79**: Medium match – meets some Must-Haves, lacks others, and may miss Preferred Qualifications. - **0-49**: Poor match – lacks several Must-Haves or key criteria. For each resume, Provide brief analysis, including: - The overall match score (on a scale from 0 to 100), broken down by the weighted criteria. - A brief explanation of each criterion. - Score Interpretation of the overall score. **Special Case for Same Scores: If two or more resumes receive the same match score, select the one with more Experience and Skills and Keywords scores. If still tied, pick the candidate with more Preferred Qualifications scores.** **Return only the response in the following JSON format for each resume**: **Do not provide any text other than the JSON response** Job Title: {job_title_text} Preferred Qualification: {job_listing} Must-Haves: {must_have} Resume: {resume} """ ) from typing_extensions import TypedDict # Update prompt template to match structured response fields prompt_template_new = PromptTemplate.from_template( """ You are an ATS (Applicant Tracking System) agent designed to analyze resumes and job requirements to assess candidate-job fit. Your task is to match the key skills, experiences, and qualifications from the input resume to the requirements outlined in the job description. When performing the match, prioritize "Must-Have" skills and qualifications, followed by other weighted criteria: Skills and Keywords (out of 40%): Identify critical skills, tools, and technologies in the Must-Haves. Experience ( out of 30%): Compare years of experience, industries, job titles, and responsibilities, focusing on Must-Haves. Education & Certifications (out of 20%): Match the candidate's degrees and certifications with the Must-Haves. Preferred Qualifications (out of 10%): Compare the candidate's qualifications with the Preferred ones. If the candidate lacks in it, lower the Preferred Qualification score. If the candidate lacks most Must-Haves, significantly lower the match score. Ensure that overall_match_score is the exact sum of the individual scores provided above. Provide a JSON response in the format below: Ensure the response is consistent if the same resume and job description are provided multiple times. Job Title: {job_title_text} Preferred Qualification: {job_listing} Must-Haves: {must_have} Resume: {resume} """ )