Improve resume parser field mapping and markdown JSON extraction

This commit is contained in:
2026-07-22 17:22:22 -04:00
parent fb45cb52d7
commit 437e811293
3 changed files with 45 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
98556
99319
+34
View File
@@ -0,0 +1,34 @@
{
"ai_job_portal_profile": {
"profile": {
"fullName": "Not Provided",
"email": "dkifer19@gmail.com",
"phone": "",
"location": "",
"linkedinUrl": "",
"githubUrl": "",
"portfolioUrl": "",
"summary": "",
"experience": [],
"skills": [],
"education": [],
"autoApplyCriteria": {
"enabled": false,
"targetRoles": [],
"minMatchScore": 80,
"maxDailyApplications": 10,
"preferredLocations": [],
"minSalary": 100000,
"excludedCompanies": [],
"preferredPlatforms": [
"LinkedIn",
"Greenhouse",
"Lever",
"Workday",
"Indeed",
"Direct"
]
}
}
}
}
+10 -4
View File
@@ -309,18 +309,24 @@ Extract the following fields accurately:
}
}
}
},
required: ["fullName", "skills", "experience"]
}
};
const { text, providerUsed } = await generateTextWithLLMFallback(prompt, schema, llmConfig);
const parsedProfile = JSON.parse(text || "{}");
// Extract JSON cleanly in case markdown wrapping was returned
const cleanJsonText = text.replace(/```json/gi, '').replace(/```/g, '').trim();
const parsedProfile = JSON.parse(cleanJsonText || "{}");
// Ensure IDs on experience items
if (Array.isArray(parsedProfile.experience)) {
parsedProfile.experience = parsedProfile.experience.map((exp: any, index: number) => ({
...exp,
id: exp.id || `exp_parsed_${Date.now()}_${index}`
id: exp.id || `exp_parsed_${Date.now()}_${index}`,
title: exp.title || exp.role || exp.position || "Position",
company: exp.company || exp.organization || "Company",
period: exp.period || exp.dates || exp.duration || "",
bullets: Array.isArray(exp.bullets) ? exp.bullets : (exp.description ? [exp.description] : [])
}));
}