Update process_interview.py
Browse files- process_interview.py +12 -4
process_interview.py
CHANGED
|
@@ -354,17 +354,25 @@ def generate_gemini_report_text(analysis_data: Dict) -> str:
|
|
| 354 |
interviewee_text = "\n".join([f"- {u['text']}" for u in analysis_data['transcript_with_roles'] if u.get('role') == 'Interviewee'])
|
| 355 |
acceptance_prob = analysis_data.get('acceptance_probability', 50.0)
|
| 356 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
prompt = f"""
|
| 358 |
You are EvalBot, a highly experienced senior HR analyst generating a comprehensive interview evaluation report.
|
| 359 |
Analyze deeply based on actual responses provided below. Avoid generic analysis.
|
| 360 |
Maintain professional, HR-standard language with clear structure and bullet points.
|
| 361 |
-
**Suitability Score: {acceptance_prob
|
| 362 |
### Interviewee Full Responses:
|
| 363 |
{interviewee_text if interviewee_text else "No responses recorded."}
|
| 364 |
### Key Metrics:
|
| 365 |
-
- Confidence Score: {
|
| 366 |
-
- Anxiety Score: {
|
| 367 |
-
- Speaking Rate: {
|
| 368 |
### Report Sections to Generate (Follow this structure exactly):
|
| 369 |
**1. Executive Summary:**
|
| 370 |
- 3 bullets summarizing performance, key strengths, and hiring recommendation.
|
|
|
|
| 354 |
interviewee_text = "\n".join([f"- {u['text']}" for u in analysis_data['transcript_with_roles'] if u.get('role') == 'Interviewee'])
|
| 355 |
acceptance_prob = analysis_data.get('acceptance_probability', 50.0)
|
| 356 |
|
| 357 |
+
# Format numbers only if they are not 'N/A' or strings
|
| 358 |
+
def format_value(val):
|
| 359 |
+
return f"{val:.2f}" if isinstance(val, (int, float)) else val
|
| 360 |
+
|
| 361 |
+
confidence = voice.get('composite_scores', {}).get('confidence', 'N/A')
|
| 362 |
+
anxiety = voice.get('composite_scores', {}).get('anxiety', 'N/A')
|
| 363 |
+
speaking_rate = voice.get('speaking_rate', 'N/A')
|
| 364 |
+
|
| 365 |
prompt = f"""
|
| 366 |
You are EvalBot, a highly experienced senior HR analyst generating a comprehensive interview evaluation report.
|
| 367 |
Analyze deeply based on actual responses provided below. Avoid generic analysis.
|
| 368 |
Maintain professional, HR-standard language with clear structure and bullet points.
|
| 369 |
+
**Suitability Score: {format_value(acceptance_prob)}%**
|
| 370 |
### Interviewee Full Responses:
|
| 371 |
{interviewee_text if interviewee_text else "No responses recorded."}
|
| 372 |
### Key Metrics:
|
| 373 |
+
- Confidence Score: {format_value(confidence)}
|
| 374 |
+
- Anxiety Score: {format_value(anxiety)}
|
| 375 |
+
- Speaking Rate: {format_value(speaking_rate)} words/sec
|
| 376 |
### Report Sections to Generate (Follow this structure exactly):
|
| 377 |
**1. Executive Summary:**
|
| 378 |
- 3 bullets summarizing performance, key strengths, and hiring recommendation.
|