husseinelsaadi commited on
Commit
aea35a7
·
1 Parent(s): b822cf0
Files changed (1) hide show
  1. backend/services/interview_engine.py +23 -16
backend/services/interview_engine.py CHANGED
@@ -132,20 +132,23 @@ def generate_first_question(profile, job):
132
 
133
  try:
134
  prompt = f"""
135
- You are conducting an interview for a {job.role} position at {job.company}.
136
- The candidate's profile shows:
137
  - Skills: {profile.get('skills', [])}
138
  - Experience: {profile.get('experience', [])}
139
  - Education: {profile.get('education', [])}
140
-
141
- Use the following context to generate a relevant opening question:
142
- {context_data}
143
-
144
- Generate an appropriate opening interview question that is professional and relevant.
145
- Keep it concise and clear. Respond with ONLY the question text, no additional formatting.
146
- If the interview is for a technical role, focus on technical skills. Make the question related
147
- to the job role and the candidate's background and the previous question.
 
 
148
  """
 
149
 
150
  response = groq_llm.invoke(prompt)
151
 
@@ -185,8 +188,8 @@ def generate_next_question(profile, job, conversation_history, last_answer):
185
 
186
  try:
187
  prompt = f"""
188
- You are continuing an interview for a {job.role} position at {job.company}.
189
- Candidate's profile:
190
  - Skills: {profile.get('skills', [])}
191
  - Experience: {profile.get('experience', [])}
192
  - Education: {profile.get('education', [])}
@@ -197,12 +200,16 @@ def generate_next_question(profile, job, conversation_history, last_answer):
197
  Candidate's last answer:
198
  {last_answer}
199
 
200
- Use the following context to generate the next question:
201
- {context_data}
 
 
 
 
202
 
203
- Generate an appropriate follow-up interview question that is professional and relevant.
204
- Keep it concise and clear. If the interview is for a technical role, focus on technical skills.
205
  """
 
206
 
207
  response = groq_llm.invoke(prompt)
208
 
 
132
 
133
  try:
134
  prompt = f"""
135
+ You are LUNA, an AI recruiter conducting an interview for a {job.role} position at {job.company}.
136
+ Candidate profile:
137
  - Skills: {profile.get('skills', [])}
138
  - Experience: {profile.get('experience', [])}
139
  - Education: {profile.get('education', [])}
140
+
141
+ Interview style:
142
+ - Start the interview in a friendly but professional way.
143
+ - Always begin with: "Hi, how are you? I'm LUNA, your AI recruiter."
144
+ - If the candidate has previous experience, reference their most recent role or company:
145
+ Example: "I see you previously worked at {profile.get('experience', [''])[0]}.
146
+ Can you tell me more about your time there, along with your education and overall background?"
147
+ - If no experience is available, simply ask them to tell you about their background, education, and experience.
148
+
149
+ Respond ONLY with the question text, no formatting or extra notes.
150
  """
151
+
152
 
153
  response = groq_llm.invoke(prompt)
154
 
 
188
 
189
  try:
190
  prompt = f"""
191
+ You are LUNA, an AI recruiter continuing an interview for a {job.role} position at {job.company}.
192
+ Candidate profile:
193
  - Skills: {profile.get('skills', [])}
194
  - Experience: {profile.get('experience', [])}
195
  - Education: {profile.get('education', [])}
 
200
  Candidate's last answer:
201
  {last_answer}
202
 
203
+ Interview style:
204
+ - Acknowledge the candidate's last answer naturally (e.g., "That's a great point", "I see what you mean").
205
+ - Then ask a related follow-up question that connects to what they just said.
206
+ - Keep the tone professional, concise, and relevant to the role.
207
+ - If technical, dig deeper into skills or tools they mentioned.
208
+ - If behavioral, expand on situations or experiences they described.
209
 
210
+ Respond ONLY with the next question text (no formatting, no commentary).
 
211
  """
212
+
213
 
214
  response = groq_llm.invoke(prompt)
215