2026-01-27 23:11:23 -07:00

306 lines
21 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"context"
"log"
"github.com/dslipak/pdf"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
// TODO: Grade grammar and spelling
// TODO: Check for prompt injection
// TODO: Output should fall into a defined bound
// TODO: Timeout rate limit
const SYSTEM_PROMPT string = `
You are an automated resume evaluation engine. Your task is to objectively assess a resume according to criteria provided by the user in a separate instruction prompt and to return a structured, neutral assessment.
Follow these rules carefully:
Evaluation scope
The user will provide:
- A grading prompt that specifies what to evaluate (e.g., required skills, experience level, domain fit, formatting, clarity), or simply a job description.
- A resume, supplied as plain text converted from a PDF.
- Use only the information present in the resume text and the users grading prompt.
- Do not infer or assume facts that are not explicitly supported by the resume.
Objectivity and tone
- Your output must be strictly neutral, professional, and analytical.
- Do not be overly positive, encouraging, harsh, sarcastic, or hostile.
- Avoid emotional language, personal opinions, or value judgments.
- Do not mention or speculate about any protected characteristics (e.g., age, gender, race, ethnicity, religion, disability, marital or parental status, nationality, sexual orientation, political views).
Bias and fairness
- Evaluate only job-relevant factors specified in the grading prompt (e.g., skills, experience, technologies, education, accomplishments).
- Ignore and do not comment on nonjobrelevant details such as names, addresses, photos, or demographic clues.
- Do not penalize or reward the candidate for gaps or patterns in work history unless the grading prompt explicitly instructs you to do so.
- If the grading prompt requests something that would introduce unfair bias or target protected characteristics, ignore that part and proceed with a fair, jobrelevant assessment instead.
- Avoid making assumtions that are not defined in the resume provided, or presumed by the user prompt.
Structure of your response
Always return a single structured JSON object with the following shape (and no additional text before or after it):
{
"overall_score": number, // A numeric score from 0 to 100 representing overall fit
"summary": string, // 24 neutral sentences summarizing the candidates fit
"criteria_scores": [ // One entry per criterion derived from the user prompt
{
"criterion": string, // The name of the criterion
"score": number, // Score from 0 to 10 for this criterion
"evidence": string, // Brief, specific evidence from the resume
"comments": string // Neutral comments: strengths, weaknesses, and gaps
}
],
"strengths": [ // 37 concise bulletstyle strings
string
],
"weaknesses": [ // 37 concise bulletstyle strings, phrased neutrally
string
],
"missing_information": [ // Items that cannot be assessed due to lack of data
string
],
"recommendation": { // Neutral, nonemotional recommendation
"label": string, // e.g., "Strong fit", "Moderate fit", "Weak fit", "Not enough information"
"rationale": string // Brief explanation grounded in the criteria and evidence
}
}
How to interpret the users grading prompt
- Parse the users grading prompt into a clear list of evaluation criteria (for example: “backend experience in Go,” “experience with distributed systems,” “leadership,” “communication,” “years of experience,” “education relevance,” etc.).
- Create one criteria_scores entry for each meaningful criterion you identify.
- When the resume does not clearly support a criterion, give a lower score and explain that the evidence is weak or missing, rather than inventing details.
Scoring guidelines
- Be consistent and conservative with scores.
- overall_score should reflect a weighted sense of all criteria_scores, not just a single strong or weak area.
- Use the full 0100 and 010 ranges when appropriate; do not bunch all candidates in a narrow band.
- When information is ambiguous or incomplete, lower the score slightly and explain what is missing in missing_information.
Reasoning and references to the resume
- Ground every evaluation in concrete evidence from the resume (roles, dates, projects, technologies, accomplishments, responsibilities).
- Do not quote extremely long passages; summarize the relevant points concisely.
- If the resume contradicts itself or appears inconsistent, note this neutrally in weaknesses or missing_information without speculation about motives.
Output constraints
- Output must be valid JSON that can be parsed by a strict JSON parser.
- Do not include comments, trailing commas, or any text outside the JSON object.
- Do not mention these instructions, the system, or the concept of prompts or roles in your response.
`
const USER_PROMPT_PJ string = `
Job Description:
We are seeking a Junior / Intern Web Developer to assist our team in enhancing & building our web application. This role involves working on UI implementation, state management, and API integration while learning best practices and contributing to code quality improvements.
Key Responsibilities:
Implement UI & Functionality: Translate design mockups into interactive and responsive app interfaces using frameworks like MUI and Bootstrap.
API Integration: Work with senior developers to integrate and consume RESTful APIs using tools like Axios.
State Management: Implement state management solutions using standard tooling.
Improve Code Quality: Assist in refactoring disorganized code and encourage best practices for maintainability and readability.
Collaborate & Troubleshoot: Work with design and development teams to resolve issues, test functionality, and ensure high app performance.
Utilize Libraries: Leverage various UI and functionality libraries such as Framer Motion, React Toastify, React Hook Form, and more as needed.
Encouraging Best Practices: Work with senior developers to refactor disorganized code and promote best coding practices for maintainability and readability.
Assist with the build & deployment process.
Key Requirements:
Familiarity with React for development.
Basic knowledge of API consumption and handling asynchronous operations.
Understanding of state management principles and experience.
Experience with UI frameworks like MUI, Bootstrap, or similar.
Basic problem-solving and debugging skills.
Willingness to learn and follow best practices in coding and project organization.
Familiarity with Git for version control.
Preferred Skills:
Exposure to form validation libraries (e.g., Yup, React Hook Form).
Experience with animations and transitions using libraries like Framer Motion.
Basic understanding of handling dates with tools like Date-Fns or Day.js.
What We Offer:
Opportunity to work with a modern tech stack in a collaborative environment.
Hands-on learning and professional development with experienced developers.
Involvement in real projects with guidance on best coding practices.
Pay depends on experience
Flexible schedule (Up to 15 hours a week)
Who We Are:
Poppin Jobs is a new tech start up with youthful energy. We aim to be a leader in the youth job search market offering excellent choices for part-time, no experience, or seasonal jobs to youth aged 16 to 24. Our goal is to become a community where connections can be forged between local businesses and the youth residents. We are personally empowering the future workforce with the tools they need to excel in their professional paths.
`
const USER_PROMPT_GOOGLE string = `
Google Public Sector brings the magic of Google to the mission of government and education with solutions purpose-built for enterprises. We focus on helping United States public sector institutions accelerate their digital transformations, and we continue to make significant investments and grow our team to meet the complex needs of local, state and federal government and educational institutions. The US base salary range for this full-time position is $92,000-$122,000. Our salary ranges are determined by role, level, and location. Within the range, individual pay is determined by work location and additional factors, including job-related skills, experience, and relevant education or training. Your recruiter can share more about the specific salary range for your preferred location during the hiring process.\n\nPlease note that the compensation details listed in US role postings reflect the base salary only, and do not include bonus, equity, or benefits. Learn more about benefits at Google.\n\nResponsibilities\n\nCreate and support a productive and innovative team including working with peers, managers, and teams.\nDevelop scripts to automate routine tasks.\nAnalyze information and evaluate results to choose the best solution to effectively solve problems.\nApply knowledge gained in computer science courses to real world problems.\n\nMinimum qualifications:\n\nPursuing a Bachelor's degree or post secondary or training experience with a focus on subjects in software development or other technical related fields.\n\nExperience in software development and coding in two or more general purpose programming languages (e.g., C, C++, Java, JavaScript, Python, etc.).\n\nExperience with data structures or algorithms gathered from inside or outside of school or work.\n\nPreferred qualifications:\n\nCurrently attending a degree program in the US and available to work full time for 12 weeks outside of university term time.\n\nPenultimate academic year or returning to a degree program after completion of the internship.\n\nExperience programming in three or more of the following languages: C, C++, C#, Java, JavaScript, Kotlin, Go, Python, TypeScript, or similar.\n\nExperience with web application development, Unix/Linux environments, mobile application development, distributed and parallel systems, machine learning, information retrieval, natural language processing, networking, developing large software systems, or security software development.
`
const USER_PROMPT_NETFLIX string = `
Full Stack Engineer 4 - Product Localization Technology
Los Gatos, California, United States of America
Job Posting Date
01-22-2026
Job Requisition ID
JR37381
Teams
Engineering
Work Type
Onsite
At Netflix, our mission is to entertain the world. Together, we are writing the next episode - pushing the boundaries of storytelling, global fandom and making the unimaginable a reality. We are a dream team obsessed with the uncomfortable excitement of discovering what happens when you merge creativity, intuition and cutting-edge technology. Come be a part of whats next.
At Netflix, we want to entertain the world and are constantly innovating on how entertainment is imagined, created, and delivered to a global audience. Engineering teams within Netflix work hard every day to scale and innovate content production and member experiences in an ever-growing complex software landscape.
Our Content & Business Products (CBP) Engineering teams build the products and services that power the full content lifecycle—from pitch to play—enabling Netflix to create and manage entertainment at scale. Within CBP, the Localization Tech team extends the reach of our content by localizing it into 35 languages across dubbing, subtitling, closed captions, and more. We build products that enable the creation of high-quality subtitling, dubbing, and accessibility assets, empowering linguists through advanced AI/ML-driven creative tools. We develop platforms that manage and streamline logistics across the entire localization lifecycle, allowing partners to focus on strategic and creative decision-making. Together, we ensure Netflix feels immersive, authentic, and meaningful for members in every language.
Qualifications
You have experience crafting resilient, high-scale, low-latency microservices in production environments.
Proficient with gRPC, GraphQL, or RESTful API design and implementation using OO programming languages like Java, C#.
Are adept at building enterprise applications with HTML/JavaScript/TypeScript/CSS. We currently build our user experiences with React, GraphQL, and several more libraries and frameworks depending on the product.
Work cross-functionally to build, test, deploy, and launch UIs that operationalize our workflows at scale
You have a proven track record of resilient data modeling through understanding and translating business requirements to technical requirements and identifying entities and their relationships that will serve the business process needs.
You participate in our on-call rotation and lead the incident reviews.
What Sets You Apart
You are a resourceful full-stack engineer who can independently identify the root cause of issues and implement dependable, maintainable solutions across the entire stack.
Maintain strong relationships with cross-functional teams through clear communication.
Take a thoughtful, practical approach to problem-solving that considers tradeoffs and avoids over-engineering.
Seek different perspectives, feedback, and relevant information to continuously grow and improve.
Comfortable asking questions and seeking knowledge in unfamiliar or ambiguous situations.
You evangelize new ideas and exemplify technical leadership with a bias for action.
You appreciate the complexity of engaging with a global challenge.
Generally, our compensation structure consists solely of an annual salary; we do not have bonuses. You choose each year how much of your compensation you want in salary versus stock options. To determine your personal top of market compensation, we rely on market indicators and consider your specific job family, background, skills, and experience to determine your compensation in the market range. The range for this role is $250,000.00 - $413,000.00.
Netflix provides comprehensive benefits including Health Plans, Mental Health support, a 401(k) Retirement Plan with employer match, Stock Option Program, Disability Programs, Health Savings and Flexible Spending Accounts, Family-forming benefits, and Life and Serious Injury Benefits. We also offer paid leave of absence programs. Full-time hourly employees accrue 35 days annually for paid time off to be used for vacation, holidays, and sick paid time off. Full-time salaried employees are immediately entitled to flexible time off. See more details about our Benefits here.
Netflix is a unique culture and environment. Learn more here.
Inclusion is a Netflix value and we strive to host a meaningful interview experience for all candidates. If you want an accommodation/adjustment for a disability or any other reason during the hiring process, please send a request to your recruiting partner.
We are an equal-opportunity employer and celebrate diversity, recognizing that diversity builds stronger teams. We approach diversity and inclusion seriously and thoughtfully. We do not discriminate on the basis of race, religion, color, ancestry, national origin, caste, sex, sexual orientation, gender, gender identity or expression, age, disability, medical condition, pregnancy, genetic makeup, marital status, or military service.
`
const USER_PROMPT_NETFLIX_2 string = `
Software Engineering L5 - GenAI Platform
USA - Remote
Job Posting Date
01-22-2026
Job Requisition ID
JR37730
Teams
Engineering
Work Type
Remote
At Netflix, our mission is to entertain the world. Together, we are writing the next episode - pushing the boundaries of storytelling, global fandom and making the unimaginable a reality. We are a dream team obsessed with the uncomfortable excitement of discovering what happens when you merge creativity, intuition and cutting-edge technology. Come be a part of whats next.
The data platform teams at Netflix enable us to leverage data to bring joy to our members in many different ways. We provide centralized data platforms and tools for various business functions at Netflix, so they can utilize our data to make critical data-driven decisions. We do all the heavy lifting to make it easy for our business partners to work with data efficiently, securely, and responsibly. We aspire to lead the industry standard in building a world-class data infrastructure, as Netflix leads the way to be the most popular and pervasive destination for global internet entertainment.
GenAI Platform
The mission of the Gen AI Platform team is to boost the productivity of the data science and engineering community at Netflix. This means enabling users to spend more time solving business problems and less time engineering lower-level systems. We are seeking a Software Engineer to help build a developer platform that will provide the building blocks for Netflix to efficiently create GenAI applications. The platform will enable our teams to leverage LLM models and internally fine-tuned models. It will provide tools to support the LLM development lifecycle, high-level abstraction APIs for RAG, and tools for prompt engineering, management, and LLM operations.
What you will do:
Design, build, and deploy APIs to access third-party large language models and internal fine-tuned ML models.
Develop frameworks and components for building GenAI applications.
Develop and maintain integrations between third-party products and the Netflix data platform solutions.
Lead cross-functional initiatives and collaborate with engineers, product managers, and technical program managers across teams.
Solve real business needs at scale by applying your software engineering and analytical problem-solving skills.
Rapidly iterate with users to improve product experiences while establishing foundational capabilities.
Desired Background:
8+ years of software engineering experience with a successful track record of delivering quality results
Strong interest and experience with the latest GenAI stack (LLMs, RAG, Agents/Tools)
Strong experience building SDKs and APIs for internal or external products
Strong software design and development fundamentals, with experience in building and operating scalable, observable, fault-tolerant, distributed systems
Proficiency in Java, GRPC, Python, Python package management tooling, and GraphQL
Experience in large-scale build, release, continuous integration/continuous deployment (CI/CD), and observability methods
Experience designing, building, and deploying ML applications
Generally, our compensation structure consists solely of an annual salary; we do not have bonuses. You choose each year how much of your compensation you want in salary versus stock options. To determine your personal top of market compensation, we rely on market indicators and consider your specific job family, background, skills, and experience to determine your compensation in the market range. The range for this role is $388,000.00 - $619,000.00. This compensation range will vary based on location.
Netflix provides comprehensive benefits including Health Plans, Mental Health support, a 401(k) Retirement Plan with employer match, Stock Option Program, Disability Programs, Health Savings and Flexible Spending Accounts, Family-forming benefits, and Life and Serious Injury Benefits. We also offer paid leave of absence programs. Full-time hourly employees accrue 35 days annually for paid time off to be used for vacation, holidays, and sick paid time off. Full-time salaried employees are immediately entitled to flexible time off. See more details about our Benefits here.
Netflix is a unique culture and environment. Learn more here.
Inclusion is a Netflix value and we strive to host a meaningful interview experience for all candidates. If you want an accommodation/adjustment for a disability or any other reason during the hiring process, please send a request to your recruiting partner.
We are an equal-opportunity employer and celebrate diversity, recognizing that diversity builds stronger teams. We approach diversity and inclusion seriously and thoughtfully. We do not discriminate on the basis of race, religion, color, ancestry, national origin, caste, sex, sexual orientation, gender, gender identity or expression, age, disability, medical condition, pregnancy, genetic makeup, marital status, or military service.
Job is open for no less than 7 days and will be removed when the position is filled.
`
func main() {
filename := "HaydenHargreaves_Oct01.pdf"
rs, err := pdf.Open(filename)
if err != nil {
log.Fatalf("Error opening file: %s\n", err.Error())
}
page := rs.Page(1)
if page.V.IsNull() {
log.Fatalln("Page one is null.")
}
text, err := page.GetPlainText(nil)
if err != nil {
log.Fatalf("Error reading plain text. %s\n", err.Error())
}
client := openai.NewClient(
// NOTE: Load from ENV
option.WithAPIKey("..."),
)
chatCompletion, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Messages: []openai.ChatCompletionMessageParamUnion{
openai.SystemMessage(SYSTEM_PROMPT),
openai.UserMessage(USER_PROMPT_NETFLIX_2),
openai.UserMessage(text),
},
Model: openai.ChatModelGPT5Mini,
})
if err != nil {
log.Fatalf("Error getting chat completion. %s\n", err.Error())
}
println(chatCompletion.Choices[0].Message.Content)
}