Update process_interview.py
Browse files- process_interview.py +3 -2
process_interview.py
CHANGED
|
@@ -508,15 +508,16 @@ def process_interview(audio_path: str, user_id: str = "candidate-123") -> Dict:
|
|
| 508 |
gemini_report_text = generate_gemini_report_text(analysis_data)
|
| 509 |
analysis_data['gemini_report_text'] = gemini_report_text
|
| 510 |
|
| 511 |
-
base_name = f"{user_id}_{uuid.uuid4().hex}"
|
| 512 |
pdf_path = os.path.join(PDF_DIR, f"{base_name}_report.pdf")
|
| 513 |
create_pdf_report(analysis_data, pdf_path)
|
| 514 |
|
| 515 |
json_path = os.path.join(JSON_DIR, f"{base_name}_analysis.json")
|
|
|
|
| 516 |
if os.path.exists(json_path):
|
| 517 |
logger.warning(f"JSON file {json_path} already exists, overwriting.")
|
| 518 |
with open(json_path, 'w') as f:
|
| 519 |
-
logger.debug(f"
|
| 520 |
serializable_data = convert_to_serializable(analysis_data)
|
| 521 |
json.dump(serializable_data, f, indent=2)
|
| 522 |
|
|
|
|
| 508 |
gemini_report_text = generate_gemini_report_text(analysis_data)
|
| 509 |
analysis_data['gemini_report_text'] = gemini_report_text
|
| 510 |
|
| 511 |
+
base_name = f"{user_id}_{uuid.uuid4().hex}"
|
| 512 |
pdf_path = os.path.join(PDF_DIR, f"{base_name}_report.pdf")
|
| 513 |
create_pdf_report(analysis_data, pdf_path)
|
| 514 |
|
| 515 |
json_path = os.path.join(JSON_DIR, f"{base_name}_analysis.json")
|
| 516 |
+
logger.debug(f"JSON path before write: {json_path}")
|
| 517 |
if os.path.exists(json_path):
|
| 518 |
logger.warning(f"JSON file {json_path} already exists, overwriting.")
|
| 519 |
with open(json_path, 'w') as f:
|
| 520 |
+
logger.debug(f"Writing to JSON file: {json_path}")
|
| 521 |
serializable_data = convert_to_serializable(analysis_data)
|
| 522 |
json.dump(serializable_data, f, indent=2)
|
| 523 |
|