File size: 960 Bytes
aa925e5
 
 
 
 
 
94c47e8
aa925e5
 
 
 
 
 
 
 
 
 
 
 
94c47e8
aa925e5
 
 
94c47e8
aa925e5
 
 
 
94c47e8
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
'''
    This module generates top accomplishment from resume
'''

from loaders import get_chain_for_pdf

def generate_query(title:str, company:str, job_description: str):
    '''
    Generate a query from a title and company
    '''
    query = f"""
    What are the top accomplishments from the candidate resume relevant to the job given below? \
    The job is {title} at {company}. \
    The job description is: \n 
    {job_description} \n
    Return the top accomplishments as bullet points sorted by relevance to the job description. Do not include points that are NOT in the resume. \
    """
    return query

def get_accomplishments(title:str, company:str, job_description: str, resume_path = "resume.pdf"):
    '''
    Generate a cover letter from a title and company
    '''
    query = generate_query(title, company, job_description)
    chain = get_chain_for_pdf(resume_path)
    response = chain({"query": query})
    return response['result']