kerplunk-ai-prompts 0.1.18 → 0.1.21

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16a539ca2d9fc02c4d60eb273371cdaed7dbeea1d0e18a9aa57838a927da87df
4
- data.tar.gz: 238f0067c8c9cb273f41e3486251b2a9c1c6e1c7632898af9e498470e598c6b3
3
+ metadata.gz: 764160d106f197a673b5e4c8015c84db95773881f6d0f90511efc125023cb90f
4
+ data.tar.gz: 65690dd8efd05625009d605ad4d1529d559c56015c830cc551efa516cfd8ae20
5
5
  SHA512:
6
- metadata.gz: 61a5cdef9f903272d2d8d164def83a00a09822526750230a8439c8f4c059fe335dcdcaedf98d18dffd4ed1ce0920e21b585765515bed037f0a32e3e1bba9233b
7
- data.tar.gz: 2e69ee1fe1efeb724f5df998bff0369bed8e06b28b1a67b3ff5d89e8bf5350a4a8088faa7287b5c4fdb03a2301468979b71b98619307c0d87052fbf643a5f23b
6
+ metadata.gz: 18cdf4be20194d4d2b5747e4e8a3209e63fe1109793403f392d3a7549bbd2daa6f507617c06bd286d5049308ffc786bff00bb970b9c661db8ecc97b8d5a622a3
7
+ data.tar.gz: bcb3297000ee00c43a4e2e7e41032b1470ca3c18f856fb245ae21413697132bda04d2f5b932d2f4ecf8ebefef61c8187847cd9a2c3bb62bfc11508aa82d80af4
@@ -0,0 +1,14 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Models
4
+ class AttendeeTranscript
5
+ attr_accessor :transcript, :name
6
+
7
+ def initialize(transcript:, name:)
8
+ @transcript = transcript
9
+ @name = name
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -17,7 +17,7 @@ module Kerplunk
17
17
  @index = index
18
18
  @content = content
19
19
  @suggested_answers = suggested_answers
20
- @transcript = transcript.nil? ? "<NOTRANSCRIPT />" : transcript
20
+ @transcript = transcript
21
21
  @category = category
22
22
  @previous_score = previous_score
23
23
  @code_blocks = code_blocks
@@ -27,15 +27,17 @@ module Kerplunk
27
27
  #
28
28
  # @return [String] the formatted question prompt
29
29
  def question_prompt
30
- <<~QUESTION_PROMPT
30
+ prompt = <<~QUESTION_PROMPT
31
31
  ==== Question No. #{index + 1}
32
32
  Question Text: #{content}
33
33
  Question Code Blocks (if any): #{code_blocks}
34
- Suggested Answer: #{suggested_answers}
35
- Transcript: #{transcript}
36
34
  Category: #{category}
37
- Previous Score: #{previous_score}
38
35
  QUESTION_PROMPT
36
+
37
+ prompt << "Previous Score: #{previous_score}\n" if previous_score
38
+ prompt << "Suggested Answers: #{suggested_answers}\n" if suggested_answers && !suggested_answers.empty?
39
+ prompt << "Transcript: #{transcript}\n" if transcript && !transcript.empty?
40
+ prompt
39
41
  end
40
42
  end
41
43
  end
@@ -30,6 +30,8 @@ module Kerplunk
30
30
  Templates::Analysis::Interview.generate_prompt(*args)
31
31
  when :resume_analysis
32
32
  Templates::Analysis::Resume.generate_prompt(*args)
33
+ when :copilot_interview_analysis
34
+ Templates::Analysis::CopilotInterview.generate_prompt(*args)
33
35
  else
34
36
  raise "Unknown prompt key: #{prompt_key}"
35
37
  end
@@ -0,0 +1,159 @@
1
+ module Kerplunk
2
+ module AI
3
+ module Prompts
4
+ module Templates
5
+ module Analysis
6
+ # The CopilotInterview class is responsible for generating a prompt for copilot interview analysis.
7
+ class CopilotInterview
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
+ # @param attendee_transcripts [Array<Kerplunk::AI::Models::AttendeeTranscript>] an array of AttendeeTranscript objects
15
+ # @return [String] the generated prompt for the interview analysis
16
+ # @raise [TypeError] if question_models is not an array of InterviewQuestion objects
17
+ def self.generate_prompt(job_title, job_description, organization_name, question_models, attendee_transcripts)
18
+ raise ArgumentError, "job_title is required" if job_title.nil? || job_title.empty?
19
+ raise ArgumentError, "job_description is required" if job_description.nil? || job_description.empty?
20
+ raise ArgumentError, "organization_name is required" if organization_name.nil? || organization_name.empty?
21
+
22
+ 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) }
23
+ raise TypeError, "attendee_transcripts must be an array of AttendeeTranscript objects" unless attendee_transcripts.is_a?(Array) && attendee_transcripts.all? { |at| at.is_a?(Kerplunk::AI::Models::AttendeeTranscript) }
24
+
25
+ question_answer_prompts = question_models.collect(&:question_prompt)
26
+
27
+ attendee_transcripts_array = []
28
+ attendee_transcripts.each do |attendee|
29
+ attendee.transcript.each do |entry|
30
+ attendee_transcripts_array << {
31
+ name: attendee.name,
32
+ start_time: entry[:start_time],
33
+ text: entry[:text]
34
+ }
35
+ end
36
+ end
37
+
38
+ # Sort the transcript by start time
39
+ attendee_transcripts_array.sort_by! { |line| line[:start_time].to_f }
40
+
41
+ attendee_transcript_full = attendee_transcripts_array.collect do |entry|
42
+ "#{entry[:name]} (#{entry[:start_time]}s): #{entry[:text]}"
43
+ end.join("\n")
44
+
45
+ <<~PROMPT
46
+ Respond with a RAW JSON object only. Do not include any explanatory text outside the JSON.
47
+
48
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them for a new role at #{organization_name}.
49
+
50
+ === Nonnegotiables for the interview analysis
51
+
52
+ - If there is a lack of data, please provide a score of 0.
53
+ - Please do not be afraid to mention in the commentary if there is not enough data to provide an opinion.
54
+ - If there are inconsistencies in the transcripts, please double-check your analysis.
55
+ - Please highlight any red flags or toxic behavior.
56
+ - 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.
57
+ - If a phone screen would be more appropriate, please do not hesitate to indicate that in your analysis.
58
+
59
+ === The Indicators
60
+
61
+ When analyzing the interview, please consider the following 6 indicators:
62
+
63
+ 1. Interview Score
64
+
65
+ This is the overall score of the interview and how well the candidate fits the job description.
66
+
67
+ 2. X-Factor Score
68
+
69
+ 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.
70
+
71
+ 3. Soft Skills Score
72
+
73
+ 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.
74
+
75
+ 4. Resume Score
76
+
77
+ 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.
78
+
79
+ 5. Culture Fit Score
80
+
81
+ 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.
82
+
83
+ 6. Technical Score
84
+
85
+ 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.
86
+
87
+ === The Commentary
88
+
89
+ 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. Also, please provide a Pros and Cons statement (one sentence each) about the candidate. Please remember that this will be shown to the candidate so please be positive and constructive.
90
+
91
+ 1. Analysis
92
+
93
+ 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.
94
+
95
+ 2. Soft Skills
96
+
97
+ The candidate's soft skills and how they presented themselves during the interview.
98
+
99
+ 3. Culture Fit
100
+
101
+ The candidate's personality and cultural fit.
102
+
103
+ 4. Feedback
104
+
105
+ 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.
106
+
107
+ === JSON Output Example
108
+ 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.
109
+
110
+ {
111
+ "scores": {
112
+ "interview_score": 4.5,
113
+ "x_factor_score": 4.5,
114
+ "soft_skills_score": 4.5,
115
+ "resume_score": 4.5,
116
+ "culture_fit_score": 4.5,
117
+ "technical_score": 4.5
118
+ },
119
+ "pros_and_cons": {
120
+ "pros": "The candidate's strengths",
121
+ "cons": "The candidate's weaknesses"
122
+ },
123
+ "commentary": {
124
+ "analysis": "The candidate overview",
125
+ "soft_skills": "The candidate's soft skills",
126
+ "culture_fit": "The candidate's personality and cultural fit",
127
+ "feedback": "Feedback for the candidate"
128
+ },
129
+ "detailed_commentary": {
130
+ "overview": "The candidate overview of how they did",
131
+ "conclusion": "The conclusion of the interview",
132
+ "experience": "The candidate's experience and expertise",
133
+ "adaptability": "The candidate's adaptability and efficiency",
134
+ "communication": "The candidate's communication skills and empathy",
135
+ "professionalism": "The candidate's professionalism and work ethic and dedication",
136
+ "continuous_improvement": "The candidate's continuous improvement and learning and education",
137
+ "financial_impact": "The candidate's financial impact and cost-effectiveness and value alignment"
138
+ }
139
+ }
140
+
141
+ === The Job Title
142
+ #{job_title}
143
+
144
+ === The Job Description
145
+ #{job_description}
146
+
147
+ === The Interview Questions. Not all of the questions will be asked during the interview, please use the full transcript below to verify if a question was asked or not. If a question was not asked, it should not count towards the candidate's score.
148
+ #{question_answer_prompts.join("\n\n")}
149
+
150
+ === The Full Transcript of the Interview
151
+ #{attendee_transcript_full}
152
+ PROMPT
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
@@ -3,7 +3,7 @@
3
3
  module Kerplunk
4
4
  module AI
5
5
  module Prompts
6
- VERSION = "0.1.18"
6
+ VERSION = "0.1.21"
7
7
  end
8
8
  end
9
9
  end
@@ -20,6 +20,7 @@ module Kerplunk
20
20
  :job_description,
21
21
  :interview_question_analysis,
22
22
  :interview_analysis,
23
+ :copilot_interview_analysis,
23
24
  :resume_analysis
24
25
  ]
25
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kerplunk-ai-prompts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Schutt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-29 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A collection of AI prompt templates for use in Kerplunk
14
14
  email:
@@ -25,9 +25,11 @@ files:
25
25
  - README.md
26
26
  - Rakefile
27
27
  - config/initializers/inflections.rb
28
+ - lib/kerplunk/ai/models/attendee_transcript.rb
28
29
  - lib/kerplunk/ai/models/interview_question.rb
29
30
  - lib/kerplunk/ai/prompts.rb
30
31
  - lib/kerplunk/ai/prompts/prompt_handler.rb
32
+ - lib/kerplunk/ai/prompts/templates/analysis/copilot_interview.rb
31
33
  - lib/kerplunk/ai/prompts/templates/analysis/interview.rb
32
34
  - lib/kerplunk/ai/prompts/templates/analysis/interview_question.rb
33
35
  - lib/kerplunk/ai/prompts/templates/analysis/resume.rb