CV_Reviewer / backend.py
Jonah Ramponi
commiting day1
22be37d
raw
history blame
911 Bytes
from utils.prompts import (
cv_extract_prompt,
cv_format,
job_posting_extract_prompt,
job_posting_format,
)
from utils.gpt import gpt_response
def process_cv(cv_contents: str, API_KEY: str) -> str:
"""Process CV contents, using Cohere"""
prompt = cv_extract_prompt.replace("<input-cv>", cv_contents)
response = gpt_response(
prompt=prompt,
api_key=API_KEY,
)
return response
def process_job_posting(job_post_contents: str, API_KEY: str) -> str:
"""Process a job posting, using Cohere"""
prompt = job_posting_extract_prompt.replace("<job-posting>", job_post_contents)
response = gpt_response(
prompt=prompt,
api_key=API_KEY,
)
return response
if __name__ == "__main__":
with open("sample_data/meta_job.txt", "r") as file:
post_contents = file.read()
output = process_job_posting(post_contents)