kerplunk-ai-prompts 0.1.24 → 0.1.25

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: e35a7d7ca0a9bdfb4cf82483aad37fc15965376b22739a93e5d061b3516b47d1
4
+ data.tar.gz: f35e162269e93eaf78b0440c8bcc4a4fae1b14972f2411622f41da33d993879e
5
5
  SHA512:
6
- metadata.gz: 120fb885a5a169d8e59a89543d1dda76696c0277a5b21e23ebb14e6e67acf8589940480850bc04f3c5121076b4c04044e40f19887046804e2d9be5c4370cf5d6
7
- data.tar.gz: 7743d5de7bb125a1120cde6e78a584fb7c588af5845cd482cba06faebf38f13793ea992ad61ed50164c3af77611e6857700225ee7ab4f11ba4edc30f8a7f2d78
6
+ metadata.gz: 5ea9a36433cba211706357dd1c9825ccf4e5293a22d3f7fbd2a61420326d83c87bf95b854576e41b0592b9835200f8fd58f05d6399f895fc9741588acf510289
7
+ data.tar.gz: 44806c5f26ae5654575e71416bc96bb92358942213f90aec0bcbb2c83a08e70a394b9bc1ab852100dab7e5515a629a7ae48ee512fd5201eea50876c3789c9c95
@@ -10,8 +10,9 @@ 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
13
14
  # @return [String] the generated prompt
14
- def self.generate_prompt(question, question_type, transcript)
15
+ def self.generate_prompt(question, question_type, transcript, suggested_answers = nil)
15
16
  raise ArgumentError, "question is required" if question.nil? || question.empty?
16
17
  raise ArgumentError, "question_type is required" if question_type.nil? || question_type.empty?
17
18
 
@@ -20,12 +21,12 @@ module Kerplunk
20
21
  <<~PROMPT
21
22
  Respond with a RAW JSON object only. Do not include any explanatory text outside the JSON.
22
23
 
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.
24
+ You are an expert recruiter. You are performing the interview of a candidate to effectively evaluate them for their #{question_type} skills.
25
+ #{generate_scoring_instructions(question_type, suggested_answers)}
25
26
 
26
27
  Please ensure the following:
27
28
  - 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
29
+ - The commentary is high-level bullet pointed comments about how the candidate did on the question
29
30
 
30
31
  An example output should be JSON and look like this:
31
32
  {
@@ -34,7 +35,8 @@ module Kerplunk
34
35
  "Comment 2",
35
36
  "Comment 3"
36
37
  ],
37
- "score": 4.5
38
+ "score": 4.5#{(question_type.downcase == "yes/no") ? ',
39
+ "answer": "Yes" or "No"' : ""}
38
40
  }
39
41
 
40
42
  Please remember that the question category is #{question_type} and the question is:
@@ -44,6 +46,22 @@ module Kerplunk
44
46
  #{transcript}
45
47
  PROMPT
46
48
  end
49
+
50
+ class << self
51
+ private
52
+
53
+ def generate_scoring_instructions(question_type, suggested_answers)
54
+ if question_type.downcase == "yes/no"
55
+ if suggested_answers
56
+ "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."
57
+ else
58
+ "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."
59
+ end
60
+ else
61
+ "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."
62
+ end
63
+ end
64
+ end
47
65
  end
48
66
  end
49
67
  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.25"
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.25
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-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A collection of AI prompt templates for use in Kerplunk
14
14
  email: