Spaces:
Runtime error
Runtime error
Update api/routes.py
Browse files- api/routes.py +1 -22
api/routes.py
CHANGED
|
@@ -25,18 +25,6 @@ async def analyze_resume(
|
|
| 25 |
job_role: str = Form(...),
|
| 26 |
store_in_db: bool = Form(True)
|
| 27 |
):
|
| 28 |
-
"""
|
| 29 |
-
Analyze a resume and extract relevant information based on the job role.
|
| 30 |
-
Optionally store the results in a database.
|
| 31 |
-
|
| 32 |
-
Parameters:
|
| 33 |
-
- resume_file: PDF or DOCX resume file
|
| 34 |
-
- job_role: Target job role for relevance analysis
|
| 35 |
-
- store_in_db: Whether to store results in database (default: True)
|
| 36 |
-
|
| 37 |
-
Returns:
|
| 38 |
-
- Resume analysis with extraction status
|
| 39 |
-
"""
|
| 40 |
|
| 41 |
filename = urllib.parse.unquote(resume_file.filename)
|
| 42 |
_, file_extension = os.path.splitext(filename)
|
|
@@ -65,19 +53,10 @@ async def analyze_resume(
|
|
| 65 |
|
| 66 |
@router.get("/candidate/{candidate_id}", response_model=ExtendedResumeAnalysisResponse)
|
| 67 |
async def get_candidate(candidate_id: str):
|
| 68 |
-
|
| 69 |
-
Retrieve a previously analyzed candidate by ID.
|
| 70 |
-
|
| 71 |
-
Parameters:
|
| 72 |
-
- candidate_id: Database ID of the candidate
|
| 73 |
-
|
| 74 |
-
Returns:
|
| 75 |
-
- Complete candidate record
|
| 76 |
-
"""
|
| 77 |
try:
|
| 78 |
from services.db_service import get_supabase_client
|
| 79 |
|
| 80 |
-
# Clean the candidate_id by removing any quotes and decoding URL
|
| 81 |
clean_id = urllib.parse.unquote(candidate_id).strip('"')
|
| 82 |
|
| 83 |
supabase = get_supabase_client()
|
|
|
|
| 25 |
job_role: str = Form(...),
|
| 26 |
store_in_db: bool = Form(True)
|
| 27 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
filename = urllib.parse.unquote(resume_file.filename)
|
| 30 |
_, file_extension = os.path.splitext(filename)
|
|
|
|
| 53 |
|
| 54 |
@router.get("/candidate/{candidate_id}", response_model=ExtendedResumeAnalysisResponse)
|
| 55 |
async def get_candidate(candidate_id: str):
|
| 56 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
try:
|
| 58 |
from services.db_service import get_supabase_client
|
| 59 |
|
|
|
|
| 60 |
clean_id = urllib.parse.unquote(candidate_id).strip('"')
|
| 61 |
|
| 62 |
supabase = get_supabase_client()
|