kerplunk-ai-prompts 0.1.24 → 0.1.26

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: b6932f14a20da84996fcd0d99aa6314f1a8a48e168051ff74e88d0599922744c
4
- data.tar.gz: be4f5ca96755e15d1c15070db02b0c7ff8fb8f2aa1e87c61f09dc29ef9a08a0d
3
+ metadata.gz: 1ba83f1cdedbee256ac579565c9313e0a81375f5bfdee3171067b203b87cd2ca
4
+ data.tar.gz: 58102ace1df9df70b06aa974cce79f649d4a1a98e7f1a661ff7cfbe7d402a786
5
5
  SHA512:
6
- metadata.gz: 120fb885a5a169d8e59a89543d1dda76696c0277a5b21e23ebb14e6e67acf8589940480850bc04f3c5121076b4c04044e40f19887046804e2d9be5c4370cf5d6
7
- data.tar.gz: 7743d5de7bb125a1120cde6e78a584fb7c588af5845cd482cba06faebf38f13793ea992ad61ed50164c3af77611e6857700225ee7ab4f11ba4edc30f8a7f2d78
6
+ metadata.gz: 8c26e8f50de5edd5bec173f0fa937baccc6c696478267718eceee410802dba85d4db555edd799156f1e1898ed056d9e86c8100c0362d43d851f702107393902e
7
+ data.tar.gz: 06efedcb08ec1bc87d74e25ebec1be1b0b4ad814d2260431cd57f3770ce104718cfb044519c5c89e8d5d1c137530aabd1b3f4638b582c264a919b9e67be5a8ed
@@ -10,8 +10,10 @@ module Kerplunk
10
10
  # @param question [String] the interview question being asked
11
11
  # @param question_type [String] the type/category of the interview question
12
12
  # @param transcript [String] the transcript of the candidate's response
13
+ # @param suggested_answers [String] the suggested answers for the question
14
+ # @param user_input [String] the user's input for the question
13
15
  # @return [String] the generated prompt
14
- def self.generate_prompt(question, question_type, transcript)
16
+ def self.generate_prompt(question, question_type, transcript, suggested_answers = nil, user_input = nil)
15
17
  raise ArgumentError, "question is required" if question.nil? || question.empty?
16
18
  raise ArgumentError, "question_type is required" if question_type.nil? || question_type.empty?
17
19
 
@@ -20,12 +22,12 @@ module Kerplunk
20
22
  <<~PROMPT
21
23
  Respond with a RAW JSON object only. Do not include any explanatory text outside the JSON.
22
24
 
23
-
24
- 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.
25
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them for their #{question_type} skills.
26
+ #{generate_scoring_instructions(question_type, suggested_answers)}
25
27
 
26
28
  Please ensure the following:
27
29
  - If no transcript is available (denoted by <NOTRANSCRIPT />), a score of 0 is assigned
28
- - The commentary is a high-level bullet pointed comments about how the candidate did on the question
30
+ - The commentary is high-level bullet pointed comments about how the candidate did on the question
29
31
 
30
32
  An example output should be JSON and look like this:
31
33
  {
@@ -34,16 +36,35 @@ module Kerplunk
34
36
  "Comment 2",
35
37
  "Comment 3"
36
38
  ],
37
- "score": 4.5
39
+ "score": 4.5#{(question_type.downcase == "yes/no") ? ',
40
+ "answer": "Yes" or "No"' : ""}
41
+ "user_input": "#{user_input}"
38
42
  }
39
43
 
40
44
  Please remember that the question category is #{question_type} and the question is:
41
45
  #{question}
42
46
 
43
47
  This is the transcript of the Interview Answers:
48
+ #{user_input}
44
49
  #{transcript}
45
50
  PROMPT
46
51
  end
52
+
53
+ class << self
54
+ private
55
+
56
+ def generate_scoring_instructions(question_type, suggested_answers)
57
+ if question_type.downcase == "yes/no"
58
+ if suggested_answers
59
+ "Please provide a score from 1 to 100 based on the correctness of the answer. Also, provide three high-level bullet pointed comments about how the candidate did on the question as the `commentary` key. Additionally, include the candidate's answer (Yes or No) in the `answer` key."
60
+ else
61
+ "Please do not provide a score. Provide three high-level bullet pointed comments about the candidate's response as the `commentary` key. Include the candidate's answer (Yes or No) in the `answer` key."
62
+ end
63
+ else
64
+ "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."
65
+ end
66
+ end
67
+ end
47
68
  end
48
69
  end
49
70
  end
@@ -3,7 +3,7 @@
3
3
  module Kerplunk
4
4
  module AI
5
5
  module Prompts
6
- VERSION = "0.1.24"
6
+ VERSION = "0.1.26"
7
7
  end
8
8
  end
9
9
  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.24
4
+ version: 0.1.26
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-09-05 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A collection of AI prompt templates for use in Kerplunk
14
14
  email: