Revisiting My GPT-Powered Resume Writer
I took another crack at my resume writer to write more accurately and also include a cover letter
This is a remake of my original resmue writer
A friend of mine is looking to get back out there and test the job market. It hasn't gotten any easier to find a new job since I made the first version, but I knew there were ways I could improve my script. The original was admittedly a good idea with poor execution. It did what it needed to, but it wasn't very robust. I created version 2 to address some of those concerns, make it more user-friendly, and make the outputs more accurate. Version 1 had an issue where it would confuse the users' existing job experiences with the job requirements. That appears to be fixed in this version. I also added a second Open AI call that generates a cover letter. In my current position, I have read a lot of cover letters, and ones written by AI are pretty easy to spot. I'd love to collaborate with a good prompt engineer to explore ways to make the cover letter match the user's writing style and voice.
Running it is similar to before, you just need to make sure that Pandoc is downloaded. If you don't have that, you can disable the line that executes the command to generate the pdf and just use the .md resume.
import openai
import subprocess
# Set OpenAI API key
openai.api_key = "OPEN-AI-KEY"
first_name = "First"
last_name = "Last"
phone_number = "111-111-1111"
email = "email@bytebistro.dev"
address = "City, State"
full_resume = "Enter your job experiences, education, projects, etc here."
skill_list = "Enter your list of skills"
def generate_resume(
company, description, full_resume=full_resume, highlighted_skills=skill_list
):
prompt = f" Using markdown formatting, Help me craft a resume for the following job at {company}. The Job Description is: {description}. My name is {first_name} {last_name}, my phone number is {phone_number} and my email is {email}. Write the email and phone number in plaintext. My Address is {address}. The resume Section titles should be Bolded and Uppercased. The Company names should be bolded. Using this list of my existing work experiences, highlight the best 3-5 bullet-points for each for this role and rewrite each bullet point if it needs it. Experiences: {full_resume}\n Finally, highlight The most relevant 5-10 skills from the following list that best complement the Job Description. Skills list: {highlighted_skills}. Use professional buzzwords and phrases as long as it doesn't change the meaning of the sentence. Use consistant formatting. Include a summary at the beginning. The summary voice should be confident but not dry."
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{
"role": "system",
"content": "You are a career advisor and professional writer in the technology and business world. Your job is to create the best and most competetive software developer resumes using markdown formatting possible. ",
},
{"role": "user", "content": prompt},
],
max_tokens=3200,
)
return response["choices"][0]["message"]["content"]
def generate_cover_letter(company, description, resume):
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[
{
"role": "system",
"content": "You are a career advisor and professional writer in the technology and business world. Your job is to create the best and most competetive software developer cover letters possible. Your voice is friendly, professional and passionate. ",
},
{
"role": "user",
"content": f"Write a cover letter for the following Job at {company}. The Job Description is the following: '{description}'\n My resume is: '{resume}'\n Only respond with the cover letter. One sentence in the middle should have awkward grammar.",
},
],
)
return response["choices"][0]["message"]["content"]
def main():
company_name = input("Please enter the company name: ")
job_description = input(
"Please enter the job description at company (eg. 'Entry Level programmer at Example Company. Description: This role demands 100+ years of experience..': )"
)
resume_markdown = generate_resume(company_name, job_description)
cover_letter = generate_cover_letter(company_name, job_description, resume_markdown)
if resume_markdown is not None:
filename = f"{first_name}_{last_name}_{company_name}.md"
try:
with open(filename, "w") as f:
f.write(resume_markdown)
except Exception as e:
print(f"Error during file writing: {e}")
else:
print("Result was empty")
print(cover_letter)
subprocess.run(
["pandoc", filename, "-o", f"{first_name}_{last_name}_{company_name}.pdf"]
)
try:
with open(f"{first_name}_{last_name}_{company_name}_CoverLetter.txt", "w") as f:
f.write(cover_letter)
except Exception as e:
print(f"error with cover letter: {e}")
if __name__ == "__main__":
main()
If you like our content, please consider subscribing to our weekly newsletter. I'm biased, but it's pretty great.Sign Up