26 lines
773 B
Python
26 lines
773 B
Python
#!/usr/bin/env python3
|
|
import sys
|
|
from openai import OpenAI
|
|
from pdfminer.high_level import extract_text
|
|
|
|
client = OpenAI()
|
|
|
|
def analyze_resume(text):
|
|
response = client.chat.completions.create(
|
|
model="gpt-4o-mini",
|
|
messages=[{
|
|
"role": "system",
|
|
"content": "Provide a concise summary of the resume, highlighting key skills and potential areas for improvement, in a few sentences."
|
|
},
|
|
{"role": "user", "content": text}]
|
|
)
|
|
return response.choices[0].message.content
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) > 1:
|
|
text_content = sys.argv[1]
|
|
summary = analyze_resume(text_content)
|
|
print(summary)
|
|
else:
|
|
print("Please provide text content as a command line argument.")
|