Spaces:
Sleeping
Sleeping
Commit
•
f9d9053
1
Parent(s):
c4e2fe1
Upload 3 files
Browse files- __init__.py +0 -0
- prompt_selector.py +25 -0
- prompts.py +134 -0
__init__.py
ADDED
File without changes
|
prompt_selector.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain.prompts import PromptTemplate
|
2 |
+
def prompt_sector(position: str, prompts: classmethod) -> dict:
|
3 |
+
|
4 |
+
""" Select the prompt template based on the position """
|
5 |
+
|
6 |
+
if position == 'Data Analyst':
|
7 |
+
PROMPT = PromptTemplate(
|
8 |
+
template= prompts.da_template, input_variables=["context", "question"]
|
9 |
+
)
|
10 |
+
chain_type_kwargs = {"prompt": PROMPT}
|
11 |
+
|
12 |
+
if position == 'Software Engineer':
|
13 |
+
PROMPT = PromptTemplate(
|
14 |
+
template= prompts.swe_template, input_variables=["context", "question"]
|
15 |
+
)
|
16 |
+
chain_type_kwargs = {"prompt": PROMPT}
|
17 |
+
|
18 |
+
if position == 'Marketing':
|
19 |
+
PROMPT = PromptTemplate(
|
20 |
+
template= prompts.marketing_template, input_variables=["context", "question"]
|
21 |
+
)
|
22 |
+
chain_type_kwargs = {"prompt": PROMPT}
|
23 |
+
|
24 |
+
return chain_type_kwargs
|
25 |
+
|
prompts.py
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Data Analyst
|
2 |
+
class templates:
|
3 |
+
|
4 |
+
""" store all prompts templates """
|
5 |
+
|
6 |
+
da_template = """
|
7 |
+
I want you to act as an interviewer. Remember, you are the interviewer not the candidate.
|
8 |
+
|
9 |
+
Let think step by step.
|
10 |
+
|
11 |
+
Based on the Resume,
|
12 |
+
Create a guideline with followiing topics for an interview to test the knowledge of the candidate on necessary skills for being a Data Analyst.
|
13 |
+
|
14 |
+
The questions should be in the context of the resume.
|
15 |
+
|
16 |
+
There are 3 main topics:
|
17 |
+
1. Background and Skills
|
18 |
+
2. Work Experience
|
19 |
+
3. Projects (if applicable)
|
20 |
+
|
21 |
+
Do not ask the same question.
|
22 |
+
Do not repeat the question.
|
23 |
+
|
24 |
+
Resume:
|
25 |
+
{context}
|
26 |
+
|
27 |
+
Question: {question}
|
28 |
+
Answer: """
|
29 |
+
|
30 |
+
# software engineer
|
31 |
+
swe_template = """
|
32 |
+
I want you to act as an interviewer. Remember, you are the interviewer not the candidate.
|
33 |
+
|
34 |
+
Let think step by step.
|
35 |
+
|
36 |
+
Based on the Resume,
|
37 |
+
Create a guideline with followiing topics for an interview to test the knowledge of the candidate on necessary skills for being a Software Engineer.
|
38 |
+
|
39 |
+
The questions should be in the context of the resume.
|
40 |
+
|
41 |
+
There are 3 main topics:
|
42 |
+
1. Background and Skills
|
43 |
+
2. Work Experience
|
44 |
+
3. Projects (if applicable)
|
45 |
+
|
46 |
+
Do not ask the same question.
|
47 |
+
Do not repeat the question.
|
48 |
+
|
49 |
+
Resume:
|
50 |
+
{context}
|
51 |
+
|
52 |
+
Question: {question}
|
53 |
+
Answer: """
|
54 |
+
|
55 |
+
# marketing
|
56 |
+
marketing_template = """
|
57 |
+
I want you to act as an interviewer. Remember, you are the interviewer not the candidate.
|
58 |
+
|
59 |
+
Let think step by step.
|
60 |
+
|
61 |
+
Based on the Resume,
|
62 |
+
Create a guideline with followiing topics for an interview to test the knowledge of the candidate on necessary skills for being a Marketing Associate.
|
63 |
+
|
64 |
+
The questions should be in the context of the resume.
|
65 |
+
|
66 |
+
There are 3 main topics:
|
67 |
+
1. Background and Skills
|
68 |
+
2. Work Experience
|
69 |
+
3. Projects (if applicable)
|
70 |
+
|
71 |
+
Do not ask the same question.
|
72 |
+
Do not repeat the question.
|
73 |
+
|
74 |
+
Resume:
|
75 |
+
{context}
|
76 |
+
|
77 |
+
Question: {question}
|
78 |
+
Answer: """
|
79 |
+
|
80 |
+
jd_template = """I want you to act as an interviewer. Remember, you are the interviewer not the candidate.
|
81 |
+
|
82 |
+
Let think step by step.
|
83 |
+
|
84 |
+
Based on the job description,
|
85 |
+
Create a guideline with following topics for an interview to test the technical knowledge of the candidate on necessary skills.
|
86 |
+
|
87 |
+
For example:
|
88 |
+
If the job description requires knowledge of data mining, GPT Interviewer will ask you questions like "Explains overfitting or How does backpropagation work?"
|
89 |
+
If the job description requrres knowldge of statistics, GPT Interviewer will ask you questions like "What is the difference between Type I and Type II error?"
|
90 |
+
|
91 |
+
Do not ask the same question.
|
92 |
+
Do not repeat the question.
|
93 |
+
|
94 |
+
Job Description:
|
95 |
+
{context}
|
96 |
+
|
97 |
+
Question: {question}
|
98 |
+
Answer: """
|
99 |
+
|
100 |
+
behavioral_template = """ I want you to act as an interviewer. Remember, you are the interviewer not the candidate.
|
101 |
+
|
102 |
+
Let think step by step.
|
103 |
+
|
104 |
+
Based on the keywords,
|
105 |
+
Create a guideline with followiing topics for an behavioral interview to test the soft skills of the candidate.
|
106 |
+
|
107 |
+
Do not ask the same question.
|
108 |
+
Do not repeat the question.
|
109 |
+
|
110 |
+
Keywords:
|
111 |
+
{context}
|
112 |
+
|
113 |
+
Question: {question}
|
114 |
+
Answer:"""
|
115 |
+
|
116 |
+
feedback_template = """ Based on the chat history, I would like you to evaluate the candidate based on the following format:
|
117 |
+
Summarization: summarize the conversation in a short paragraph.
|
118 |
+
|
119 |
+
Pros: Give positive feedback to the candidate.
|
120 |
+
|
121 |
+
Cons: Tell the candidate what he/she can improves on.
|
122 |
+
|
123 |
+
Score: Give a score to the candidate out of 100.
|
124 |
+
|
125 |
+
Sample Answers: sample answers to each of the questions in the interview guideline.
|
126 |
+
|
127 |
+
Remember, the candidate has no idea what the interview guideline is.
|
128 |
+
Sometimes the candidate may not even answer the question.
|
129 |
+
|
130 |
+
Current conversation:
|
131 |
+
{history}
|
132 |
+
|
133 |
+
Interviewer: {input}
|
134 |
+
Response: """
|