kerplunk-ai-prompts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f39c88fe4bac3bb08cb9a8f52f30360831f219518c95c1fd600133d14e800473
4
+ data.tar.gz: d5e3d7bc404e0a74cd1d88c3f00a3db28c88b0829352eb9023c98b67b9f8c823
5
+ SHA512:
6
+ metadata.gz: e5ef8534948d80d132591b58772ebd3a7fcaa58cbea02876d8ed2243e1bcb192ea23fab5dfb6db11a8897adc157d01c521063b27532b5e95fe002b6aa41ed87f
7
+ data.tar.gz: c6b6a0cdb09389bc156458cb99d68ea026faa0b12003c431739a8bf78227f549ad640409767e5a73bf4b00a703823ac0be415d1a3bdc807a4a96658ae9fc7d64
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/standardrb/standard
3
+ ruby_version: 3.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-06-19
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at kschutt@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Kyle Schutt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Kerplunk::AI::Prompts
2
+
3
+ [![Ruby](https://github.com/KerplunkAI/kerplunk-ai-prompts/actions/workflows/main.yml/badge.svg)](https://github.com/KerplunkAI/kerplunk-ai-prompts/actions/workflows/main.yml)
4
+
5
+ Kerplunk::AI::Prompts is a collection of AI prompt templates for use in Kerplunk. It includes templates for generating job descriptions, interview questions, and analyzing resumes and interviews.
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add kerplunk-ai-prompts
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install kerplunk-ai-prompts
16
+
17
+ ## Usage
18
+
19
+ To generate a prompt, use the `generate_prompt` method with the appropriate prompt key and arguments. Example:
20
+
21
+ ```ruby
22
+ require 'kerplunk/ai/prompts'
23
+ prompt = Kerplunk::AI::Prompts.generate_prompt(:job_description, job_title, industry, organization_name, organization_size, job_location, job_description, raw_string)
24
+ puts prompt
25
+ ```
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/kerplunk-ai-prompts. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/kerplunk-ai-prompts/blob/main/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Kerplunk::AI::Prompts project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/kerplunk-ai-prompts/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[spec standard]
@@ -0,0 +1,5 @@
1
+ require "active_support/inflector"
2
+
3
+ ActiveSupport::Inflector.inflections(:en) do |inflect|
4
+ inflect.acronym "AI"
5
+ end
@@ -0,0 +1,41 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Models
4
+ # Represents an interview question with its associated details.
5
+ class InterviewQuestion
6
+ attr_accessor :index, :content, :suggested_answers, :transcript, :category, :previous_score
7
+
8
+ # Initializes a new InterviewQuestion object.
9
+ #
10
+ # @param index [Integer] the index of the question
11
+ # @param content [String] the content of the question
12
+ # @param suggested_answers [String] the suggested answers for the question
13
+ # @param transcript [String, nil] the transcript of the interview related to the question
14
+ # @param category [String] the category of the question
15
+ # @param previous_score [Float] the previous score of the question
16
+ def initialize(index:, content:, suggested_answers:, category:, previous_score:, transcript: nil)
17
+ @index = index
18
+ @content = content
19
+ @suggested_answers = suggested_answers
20
+ @transcript = transcript.nil? ? "<NOTRANSCRIPT />" : transcript
21
+ @category = category
22
+ @previous_score = previous_score
23
+ end
24
+
25
+ # Generates a formatted prompt for the interview question.
26
+ #
27
+ # @return [String] the formatted question prompt
28
+ def question_prompt
29
+ <<~QUESTION_PROMPT
30
+ ==== Question No. #{index + 1}
31
+ Question Text: #{content}
32
+ Suggested Answer: #{suggested_answers}
33
+ Transcript: #{transcript}
34
+ Category: #{category}
35
+ Previous Score: #{previous_score}
36
+ QUESTION_PROMPT
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,40 @@
1
+ require_relative "templates/generation/interview_questions"
2
+ require_relative "templates/generation/job_description"
3
+ require_relative "templates/analysis/interview"
4
+ require_relative "templates/analysis/interview_question"
5
+ require_relative "templates/analysis/resume"
6
+
7
+ module Kerplunk
8
+ module AI
9
+ module Prompts
10
+ # The PromptHandler module is responsible for handling different types of prompts
11
+ # based on the provided prompt key. It delegates the prompt generation to the
12
+ # appropriate template class.
13
+ module PromptHandler
14
+ # Handles the prompt generation based on the provided prompt key.
15
+ #
16
+ # @param prompt_key [Symbol] the key representing the type of prompt to generate
17
+ # @param args [Array] additional arguments to pass to the prompt generation method
18
+ # @param kwargs [Hash] additional keyword arguments to pass to the prompt generation method
19
+ # @return [String] the generated prompt
20
+ # @raise [RuntimeError] if the prompt key is unknown
21
+ def self.handle_prompt(prompt_key, *args, **kwargs)
22
+ case prompt_key
23
+ when :interview_questions
24
+ Templates::Generation::InterviewQuestions.generate_prompt(*args)
25
+ when :job_description
26
+ Templates::Generation::JobDescription.generate_prompt(*args)
27
+ when :interview_question_analysis
28
+ Templates::Analysis::InterviewQuestion.generate_prompt(*args)
29
+ when :interview_analysis
30
+ Templates::Analysis::Interview.generate_prompt(*args)
31
+ when :resume_analysis
32
+ Templates::Analysis::Resume.generate_prompt(*args)
33
+ else
34
+ raise "Unknown prompt key: #{prompt_key}"
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,131 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ module Templates
5
+ module Analysis
6
+ # The Interview class is responsible for generating a prompt for interview analysis.
7
+ class Interview
8
+ # Generates a prompt for analyzing an interview.
9
+ #
10
+ # @param job_title [String] the title of the job for which the interview is being conducted
11
+ # @param job_description [String] the description of the job for which the interview is being conducted
12
+ # @param organization_name [String] the name of the organization conducting the interview
13
+ # @param question_models [Array<Kerplunk::AI::Models::InterviewQuestion>] an array of InterviewQuestion objects
14
+ # @return [String] the generated prompt for the interview analysis
15
+ # @raise [TypeError] if question_models is not an array of InterviewQuestion objects
16
+ def self.generate_prompt(job_title, job_description, organization_name, question_models)
17
+ raise ArgumentError, "job_title is required" if job_title.nil? || job_title.empty?
18
+ raise ArgumentError, "job_description is required" if job_description.nil? || job_description.empty?
19
+ raise ArgumentError, "organization_name is required" if organization_name.nil? || organization_name.empty?
20
+
21
+ raise TypeError, "question_models must be an array of InterviewQuestion objects" unless question_models.is_a?(Array) && question_models.all? { |qm| qm.is_a?(Kerplunk::AI::Models::InterviewQuestion) }
22
+
23
+ question_answer_prompts = question_models.collect(&:question_prompt)
24
+
25
+ <<~PROMPT
26
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them for a new role at #{organization_name}.
27
+
28
+ === Nonnegotiables for the interview analysis
29
+
30
+ - If there is a lack of data, please provide a score of 0.
31
+ - Please do not be afraid to mention in the commentary if there is not enough data to provide an opinion.
32
+ - If there are inconsistencies in the transcripts, please double-check your analysis.
33
+ - Please highlight any red flags or toxic behavior.
34
+ - Always ensure that all the provided JSON format has a value even if there is not enough data available. Providing a score of 0 or stating there is not enough information is perfectly fine.
35
+ - If a phone screen would be more appropriate, please do not hesitate to indicate that in your analysis.
36
+
37
+ === The Indicators
38
+
39
+ When analyzing the interview, please consider the following 6 indicators:
40
+
41
+ 1. Interview Score
42
+
43
+ This is the overall score of the interview and how well the candidate fits the job description.
44
+
45
+ 2. X-Factor Score
46
+
47
+ This is the score of the candidate's personality and cultural fit. This should be something that stood out during the interview or something that the candidate has that is unique and valuable.
48
+
49
+ 3. Soft Skills Score
50
+
51
+ This is the score of the candidate's soft skills. This should be based on inflection and word choice. Please consider their use of language and how they present themselves.
52
+
53
+ 4. Resume Score
54
+
55
+ Based on the candidate's interview, provide a prediction on how the resume will score. This should be based on the candidate's experience and how well they fit the job description.
56
+
57
+ 5. Culture Fit Score
58
+
59
+ This is the score of the candidate's personality and cultural fit. This should be based on the candidate's personality and how well they fit the company culture.
60
+
61
+ 6. Technical Score
62
+
63
+ This is the score of the candidate's technical skills. This should be based on the candidate's technical knowledge and how well they fit the job description.
64
+
65
+ === The Commentary
66
+
67
+ In addition to scoring the candidate on various indicators, please provide commentary on the following. We are looking for a short comment on each category as well as a longer detailed commentary.
68
+
69
+ 1. Analysis
70
+
71
+ Overall analysis of the candidate and how they fit the job description and the company culture. The output should include a summary paragraph followed by three succinct highlights in an array.
72
+
73
+ 2. Soft Skills
74
+
75
+ The candidate's soft skills and how they presented themselves during the interview.
76
+
77
+ 3. Culture Fit
78
+
79
+ The candidate's personality and cultural fit.
80
+
81
+ 4. Feedback
82
+
83
+ In the third person voice, generate a one-paragraph feedback report. Analyze the interview for content relevance and depth, determine communication effectiveness, and evaluate cues for professional presentation. Provide specific examples from the interview to substantiate your points and offer constructive suggestions for improvement where applicable.
84
+
85
+ === JSON Output Example
86
+ Please output the scores in a JSON object. Please make sure that the scores are aggregated by category and are between 1 and 100. An example output should be JSON and look like the below. Please be sure the output is a valid JSON format even if you cannot generate the interview questions. The JSON should not include any markdown or newline characters such as "```json" that would normally be used for rendering in markdown.
87
+
88
+ {
89
+ "scores": {
90
+ "interview_score": 4.5,
91
+ "x_factor_score": 4.5,
92
+ "soft_skills_score": 4.5,
93
+ "resume_score": 4.5,
94
+ "culture_fit_score": 4.5,
95
+ "technical_score": 4.5
96
+ },
97
+ "commentary": {
98
+ "analysis": "The candidate overview",
99
+ "soft_skills": "The candidate's soft skills",
100
+ "culture_fit": "The candidate's personality and cultural fit",
101
+ "feedback": "Feedback for the candidate"
102
+ },
103
+ "detailed_commentary": {
104
+ "overview": "The candidate overview of how they did",
105
+ "conclusion": "The conclusion of the interview",
106
+ "experience": "The candidate's experience and expertise",
107
+ "adaptability": "The candidate's adaptability and efficiency",
108
+ "communication": "The candidate's communication skills and empathy",
109
+ "professionalism": "The candidate's professionalism and work ethic and dedication",
110
+ "continuous_improvement": "The candidate's continuous improvement and learning and education",
111
+ "financial_impact": "The candidate's financial impact and cost-effectiveness and value alignment"
112
+ }
113
+ }
114
+
115
+ === The Job Title
116
+ #{job_title}
117
+
118
+ === The Job Description
119
+ #{job_description}
120
+
121
+ === The Interview Questions with the Transcript of the Interview Answers (some answers may have a score from a previous analysis, please aggregate these scores by category). Some Interview Questions will provide an array of suggested answers, please evaluate the Transcript answer against the suggested answers where each one could be the correct answer.
122
+
123
+ #{question_answer_prompts.join("\n\n")}
124
+ PROMPT
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,49 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ module Templates
5
+ module Analysis
6
+ # The InterviewQuestion class is responsible for generating prompts for interview questions.
7
+ class InterviewQuestion
8
+ # Generates a prompt for evaluating a candidate's response to an interview question.
9
+ #
10
+ # @param question [String] the interview question being asked
11
+ # @param question_type [String] the type/category of the interview question
12
+ # @param transcript [String] the transcript of the candidate's response
13
+ # @return [String] the generated prompt
14
+ def self.generate_prompt(question, question_type, transcript)
15
+ raise ArgumentError, "question is required" if question.nil? || question.empty?
16
+ raise ArgumentError, "question_type is required" if question_type.nil? || question_type.empty?
17
+
18
+ transcript = "<NOTRANSCRIPT />" if transcript.nil? || transcript.empty?
19
+
20
+ <<~PROMPT
21
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them for their #{question_type} skills. Please provide a score from 1 to 100. Please provide three high-level bullet pointed comments about how the candidate did on the question as the `commentary` key.
22
+
23
+ Please ensure the following:
24
+ - If no transcript is available (denoted by <NOTRANSCRIPT />), a score of 0 is assigned
25
+ - The commentary is a high-level bullet pointed comments about how the candidate did on the question
26
+
27
+ An example output should be JSON and look like this:
28
+ {
29
+ "commentary": [
30
+ "Comment 1",
31
+ "Comment 2",
32
+ "Comment 3"
33
+ ],
34
+ "score": 4.5
35
+ }
36
+
37
+ Please remember that the question category is #{question_type} and the question is:
38
+ #{question}
39
+
40
+ This is the transcript of the Interview Answers:
41
+ #{transcript}
42
+ PROMPT
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,102 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ module Templates
5
+ module Analysis
6
+ # The Resume class is responsible for generating a prompt for resume analysis.
7
+ class Resume
8
+ # Generates a prompt for analyzing a resume.
9
+ #
10
+ # @param organization_name [String] the name of the organization conducting the interview
11
+ # @param job_title [String] the title of the job for which the resume is being analyzed
12
+ # @param job_description [String] the description of the job for which the resume is being analyzed
13
+ # @param resume_text [String] the text of the candidate's resume
14
+ # @return [String] the generated prompt
15
+ def self.generate_prompt(organization_name, job_title, job_description, resume_text)
16
+ raise ArgumentError, "organization_name is required" if organization_name.nil? || organization_name.empty?
17
+ raise ArgumentError, "job_title is required" if job_title.nil? || job_title.empty?
18
+ raise ArgumentError, "job_description is required" if job_description.nil? || job_description.empty?
19
+ raise ArgumentError, "resume_text is required" if resume_text.nil? || resume_text.empty?
20
+
21
+ <<~PROMPT
22
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them for a new role at #{organization_name}. Please analyze the resume added after `====`. Please provide a score from 1 to 100.
23
+
24
+ === The Job Title
25
+ #{job_title}
26
+
27
+ === The Job Description
28
+ #{job_description}
29
+
30
+ === Nonnegotiables for analyses on the resume
31
+
32
+ - If there is a lack of data, please provide a score of 0.
33
+ - Please do not be afraid to mention in the commentary if there is not enough data to provide an opinion.
34
+ - If there are inconsistencies in the transcripts, please double-check your analysis.
35
+ - Please highlight any red flags or toxic behavior.
36
+ - Always ensure that all the provided JSON format has a value even if there is not enough data available. Providing a score of 0 or stating there is not enough information is perfectly fine.
37
+ - If a phone screen would be more appropriate, please do not hesitate to indicate that in your analysis.
38
+ - Please attempt to extract the following from the resume: phone number, current title, current experience level, and current location.
39
+
40
+ === The Indicators
41
+
42
+ When analyzing the interview, please consider the following 6 indicators:
43
+
44
+ 1. Interview Score
45
+
46
+ Based on the candidate's resume, provide a prediction of the interview and how well the candidate fits the job description.
47
+
48
+ 2. X-Factor Score
49
+
50
+ This is the score of the candidate's personality and cultural fit. This should be something that stood out on the resume or something that the candidate has that is unique and valuable.
51
+
52
+ 3. Soft Skills Score
53
+
54
+ This is the score of the candidate's soft skills. This should be based on inflection and word choice. Please consider their use of language and how they present themselves.
55
+
56
+ 4. Resume Score
57
+
58
+ This should be based on the candidate's experience and how well they fit the job description.
59
+
60
+ 5. Culture Fit Score
61
+
62
+ This is the score of the candidate's personality and cultural fit. This should be based on the candidate's personality and how well they fit the company culture.
63
+
64
+ 6. Technical Score
65
+
66
+ This is the score of the candidate's technical skills. This should be based on the candidate's technical knowledge and how well they fit the job description.
67
+
68
+ An example output should be JSON and look like the below. Please be sure the output is a valid JSON format even if you cannot generate the interview questions. The JSON should not include any markdown or newline characters such as "```json" that would normally be used for rendering in markdown.
69
+ === JSON Output
70
+ {
71
+ "scores": {
72
+ "interview_score": 4.5,
73
+ "x_factor_score": 4.5,
74
+ "soft_skills_score": 4.5,
75
+ "resume_score": 4.5,
76
+ "culture_fit_score": 4.5,
77
+ "technical_score": 4.5
78
+ },
79
+ "commentary": {
80
+ "analysis": "The candidate overview",
81
+ "soft_skills": "The candidate's soft skills",
82
+ "culture_fit": "The candidate's personality and cultural fit",
83
+ "feedback": "Feedback for the candidate"
84
+ },
85
+ "details": {
86
+ "phone_number": "The candidate's phone number",
87
+ "current_title": "The candidate's current title",
88
+ "experience_level": "The candidate's experience level",
89
+ "current_location": "The candidate's current location"
90
+ }
91
+ }
92
+
93
+ ====
94
+ #{resume_text}
95
+ PROMPT
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,55 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ module Templates
5
+ module Generation
6
+ class InterviewQuestions
7
+ # Generates a prompt for creating interview questions based on the provided job description.
8
+ #
9
+ # @param description [String] the job description to base the interview questions on
10
+ # @return [String] the generated prompt for interview questions
11
+ def self.generate_prompt(description)
12
+ raise ArgumentError, "description is required" if description.nil? || description.empty?
13
+
14
+ <<~PROMPT
15
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them on all fronts: personal skills, technical skills, job-specific skills, soft-skills, and the “x-factor”. The interview should start off with a few questions about the candidate, then go to exactly 5 questions regarding the job posting listed below after ###, and then finally please ask a few questions to help assess personality and cultural fit (you can be creative here). These questions should aim to be simple, effective, empathetic, non-biased, and descriptive enough to be used in further prompts when analyzing the results of the interview.
16
+
17
+ Please output the questions in a JSON array. Please make sure that there are 2-3 personal questions, exactly 5 questions regarding the job posting (at least 1 technical question should be about an example scenario), and 2-3 questions to assess personality and cultural fit.
18
+
19
+ Please ensure all questions:
20
+ - are unique. Please ensure there are no duplicate questions.
21
+ - are not too long.
22
+ - are grammatically correct.
23
+ - are not too similar to each other.
24
+ - are not offensive.
25
+ - do not contain any profanity.
26
+ - are not superficial.
27
+ - have some variety.
28
+ - maintain a consistent tone.
29
+ - flow well together.
30
+ - are not too similar to the job description.
31
+
32
+ Please ensure that the technical questions:
33
+ - are not too easy.
34
+ - are deep enough to assess the candidate’s technical knowledge.
35
+ - use industry standard terminology and jargon as much as possible.
36
+
37
+ If for any reason you are unable to generate the questions, please try again. Please check your output, and rerun the prompt if you are not satisfied with the results.
38
+
39
+ An example output should be JSON and look like the below. Please be sure the output is a valid JSON format even if you cannot generate the interview questions. The JSON should not include any markdown or newline characters such as "```json" that would normally be used for rendering in markdown.
40
+ {
41
+ "personal_questions": ["question1", "question2", "question3"],
42
+ "technical_questions": ["question4", "question5"],
43
+ "cultural_questions": ["question6", "question7"]
44
+ }
45
+
46
+ ###
47
+ #{description}
48
+ PROMPT
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,76 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ module Templates
5
+ module Generation
6
+ class JobDescription
7
+ # Generates a job description prompt for a given job title and organization.
8
+ #
9
+ # @param job_title [String] the title of the job position
10
+ # @param industry [String] the industry in which the organization operates
11
+ # @param organization_name_requirement [Boolean] whether the organization name is required in the description
12
+ # @param organization_name [String] the name of the organization to be highlighted
13
+ # @param organization_size [String] the size of the organization in terms of number of employees
14
+ # @param job_location [String] the location of the job
15
+ # @param job_description [String] the current job description, if any
16
+ # @param raw_string [String] the raw JSON string containing the full job listing details
17
+ # @return [String] the generated job description prompt
18
+ def self.generate_prompt(
19
+ job_title,
20
+ industry,
21
+ organization_name_requirement = true,
22
+ organization_name,
23
+ organization_size,
24
+ job_location,
25
+ job_description,
26
+ raw_string
27
+ )
28
+ raise ArgumentError, "job_title is required" if job_title.nil? || job_title.empty?
29
+ raise ArgumentError, "industry is required" if industry.nil? || industry.empty?
30
+ raise ArgumentError, "organization_name is required" if organization_name.nil? || organization_name.empty?
31
+ raise ArgumentError, "organization_size is required" if organization_size.nil? || organization_size.empty?
32
+ raise ArgumentError, "job_location is required" if job_location.nil? || job_location.empty?
33
+ raise ArgumentError, "job_description is required" if job_description.nil? || job_description.empty?
34
+
35
+ if organization_name_requirement
36
+ organization_name_requirement_text = "Please ensure the job description includes the organization name."
37
+ else
38
+ organization_name = "an organization"
39
+ organization_name_requirement_text = "Please ensure the job description does not include the organization name."
40
+ end
41
+ <<~PROMPT
42
+ You are an expert recruiter. You are creating a job description for "#{job_title}" for #{organization_name}. They are a key player in the "#{industry}" industry. They currently have a staff size of "#{organization_size} employees" and are looking for top-tier talent. Always include bullet points in the following sections: Responsibilities, Qualifications. If a description is provided below, please use that to help formulate a high-quality description.
43
+
44
+ Please ensure the description:
45
+ - is grammatically correct
46
+ - is not offensive
47
+ - does not contain any profanity
48
+ - is not superficial
49
+ - maintains a consistent tone
50
+ - Always include bullet points in the following sections: Responsibilities, Qualifications, Benefits, and Requirements
51
+ - Please ensure the generated HTML is valid
52
+ #{organization_name_requirement_text}
53
+
54
+ If for any reason you are unable to generate the description, please try again. Please check your output, and rerun the prompt if you are not satisfied with the results.
55
+
56
+ An example output should be JSON and look like this. The description should be formatted with valid HTML, not Markdown or newline characters.
57
+ {
58
+ description: ""
59
+ }
60
+
61
+ === Job Location
62
+ #{job_location}
63
+
64
+ === Current Description
65
+ #{job_description}
66
+
67
+ === Full Job Listing JSON - Please consider the categories and subcategories carefully
68
+ #{raw_string}
69
+ PROMPT
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kerplunk
4
+ module AI
5
+ module Prompts
6
+ VERSION = "0.1.0"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "prompts/version"
4
+ require_relative "prompts/prompt_handler"
5
+ require_relative "models/interview_question"
6
+
7
+ module Kerplunk
8
+ module AI
9
+ module Prompts
10
+ # Custom error class for the Prompts module
11
+ class Error < StandardError; end
12
+
13
+ class << self
14
+ # Returns an array of supported prompt keys.
15
+ #
16
+ # @return [Array<Symbol>] List of supported prompt keys.
17
+ def supported_prompt_keys
18
+ [
19
+ :interview_questions,
20
+ :job_description,
21
+ :interview_question_analysis,
22
+ :interview_analysis,
23
+ :resume_analysis
24
+ ]
25
+ end
26
+
27
+ # Generates a prompt based on the given prompt key and arguments.
28
+ #
29
+ # @param prompt_key [Symbol] The key representing the type of prompt to generate.
30
+ # @param args [Array] Additional arguments for the prompt generation.
31
+ # @param kwargs [Hash] Keyword arguments for the prompt generation.
32
+ # @return [String] The generated prompt.
33
+ # @raise [Error] if the prompt key is unknown.
34
+ def generate_prompt(prompt_key, *args, **kwargs)
35
+ PromptHandler.handle_prompt(prompt_key, *args, **kwargs)
36
+ rescue RuntimeError => e
37
+ raise Error, e.message
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,8 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ VERSION: String
5
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
6
+ end
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kerplunk-ai-prompts
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kyle Schutt
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A collection of AI prompt templates for use in Kerplunk
14
+ email:
15
+ - kschutt@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rspec"
21
+ - ".standard.yml"
22
+ - CHANGELOG.md
23
+ - CODE_OF_CONDUCT.md
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - config/initializers/inflections.rb
28
+ - lib/kerplunk/ai/models/interview_question.rb
29
+ - lib/kerplunk/ai/prompts.rb
30
+ - lib/kerplunk/ai/prompts/prompt_handler.rb
31
+ - lib/kerplunk/ai/prompts/templates/analysis/interview.rb
32
+ - lib/kerplunk/ai/prompts/templates/analysis/interview_question.rb
33
+ - lib/kerplunk/ai/prompts/templates/analysis/resume.rb
34
+ - lib/kerplunk/ai/prompts/templates/generation/interview_questions.rb
35
+ - lib/kerplunk/ai/prompts/templates/generation/job_description.rb
36
+ - lib/kerplunk/ai/prompts/version.rb
37
+ - sig/kerplunk/ai/prompts.rbs
38
+ homepage: https://kerplunk.com
39
+ licenses:
40
+ - MIT
41
+ metadata:
42
+ allowed_push_host: https://rubygems.org
43
+ homepage_uri: https://kerplunk.com
44
+ source_code_uri: https://kerplunk.com
45
+ changelog_uri: https://kerplunk.com/CHANGELOG.md
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.0
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubygems_version: 3.5.11
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Kerplunk AI Prompt Templates
65
+ test_files: []