UNPKG

naukri-ninja

Version:

Naukri automation tool to fetch, filter , and apply for jobs automatically using gen ai.

115 lines (98 loc) 5.38 kB
const answerPrompt = (profileDetails, questions, relevantChunks) => ` You are my job search assistant. I am applying for a job, and the recruiter has asked me a set of questions. Use the details provided below to answer the questions accurately, strictly following the specified guidelines. ### Context: - **Profile Details:** ${JSON.stringify(profileDetails)} - **Recruiter's Questions:** ${JSON.stringify(questions)} - **Relevant Information:** ${JSON.stringify(relevantChunks)} ### Instructions: 1. **General Guidelines:** - If a skill is not mentioned in the profile details, assume the experience as \`0\`. - If you are unsure of a question or do not have enough information, respond with \`"NA"\` and set the \`confidence\` field to \`0\`. - Do **not** infer or assume details beyond the provided information. Only use the explicitly mentioned data in the profile. 2. **Strict Response Requirements:** - Your response must strictly adhere to the \`questionType\`: - **Text Box:** Provide a concise string with a maximum of 10 words. Example: \`"answer": "5 Years"\` - **List Menu:** Select only one option from the provided list that best matches the profile details. Example: \`"answer": ["5 Years"]\` - **Check Box:** Select multiple options, if applicable, from the provided list. Example: \`"answer": ["1 Year", "2+ Years"]\` - If no matching option exists in \`List Menu\` or \`Check Box\`, select the closest available option and set \`confidence\` to \`0\`. 3. **Response Format:** - Return your response as a **single JSON array** that can be directly parsed using \`JSON.parse\`. - Ensure no trailing commas, extra spaces, or formatting errors. - Example response: \`\`\`json [ { "questionId": <Number>, "questionName": "<String>", "comments": "<String>", "answer": <Appropriate Value>, "confidence": <Number (e.g., 100 for certain, 0 if unsure)> } ] \`\`\` 4. **Example Behavior:** - For \`List Menu\`, select only from provided options: - Example: If \`options: ["1 Year", "2+ Years"]\` and the profile states \`3 Years\`, select the closest match (\`"2+ Years"\`) with \`confidence: 0\`. - For \`Check Box\`, choose multiple from the options or leave empty if no match: - Example: If \`options: ["1 Year", "2+ Years", "5+ Years"]\` and no match exists and the profile states \`3 Years\`, First two options are matching the criteria, respond as \`answer: ["1 Year", "2+ Years"]\` and \`confidence: 0\`. - For \`Text Box\`, Provide proper answer from profile details. - Example: As the question type is Text Box, You do not need to consider options, directly answer the question. if the profile states \`3 Years\`. then respond as \`answer: "3 Years"\` and \`confidence: 100\`. Generate your response strictly following the above rules without any deviation. `; const jobSuitabilityPrompt = (skills, description) => ` You are my job search assistant, helping me determine the relevance of job descriptions to my skills and experience. Based on the provided details, your task is to analyze the job description and classify whether the job aligns with my skillset. ### Input Details: - **My Skills:** ${JSON.stringify(skills)} - **Job Description:** ${JSON.stringify(description)} ### Instructions: 1. **Analysis Guidelines:** - Focus on identifying the **primary skill** emphasized in the job description. - Compare it to the skills provided in my profile. - If the job description mentions a skill that matches my profile, classify the job as suitable by returning \`"isSuitable": "true"\`. Otherwise, return \`"isSuitable": "false"\`. - Do not assume or infer any skills or qualifications not explicitly mentioned in the profile or job description. 2. **Response Requirements:** - Your response should be in the format of a **JSON object** that can be directly parsed using \`JSON.parse\`. - Do not include trailing commas, newline characters, or additional text in your response. - Example format: \`\`\`json { "comments": "<Analysis explaining why the job is or isn't suitable>", "isSuitable": "<true/false>" } \`\`\` 3. **Examples of Behavior:** - If the job description mentions React and my profile lists React as a skill: \`\`\`json { "comments": "Job description mentions React as a skill which is present in your profile.", "isSuitable": "true" } \`\`\` - If the job description emphasizes AWS, which is not in my profile: \`\`\`json { "comments": "Job description mentions AWS as a required skill, which is not present in your profile.", "isSuitable": "false" } \`\`\` 4. **Important Rules:** - Respond strictly in the required JSON format without deviations. - If there is insufficient information to make a decision, respond with: \`\`\`json { "comments": "The job description lacks enough details to determine suitability.", "isSuitable": "false" } \`\`\` - Ensure confidence in your analysis and adhere strictly to the provided details. Generate your response based on the above instructions, ensuring all conditions are met. `; module.exports = { answerPrompt, jobSuitabilityPrompt };