INNER CODE UNIT · Python

tailor_resume

IvanIsCoding/ResuLLMe · src/prompt_engineering/__init__.py:223

def tailor_resume(cv_text, api_key, model="gpt-4o", model_type="OpenAI"):
    filled_prompt = TAILORING_PROMPT.replace("<CV_TEXT>", cv_text)
    if model_type == "OpenAI":
        client = OpenAI(api_key=api_key)
        try:
            response = client.chat.completions.create(
                model=model,
                messages=[
                    {"role": "system", "content": SYSTEM_TAILORING},
                    {"role": "user", "content": filled_prompt},
                ],
            )

            answer = response.choices[0].message.content
            return answer
        except Exception as e:
            print(e)
            print("Failed to tailor resume.")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…