diff --git a/.app.pid b/.app.pid index 0287cc5..be149ac 100644 --- a/.app.pid +++ b/.app.pid @@ -1 +1 @@ -98556 +99319 diff --git a/.data.json b/.data.json new file mode 100644 index 0000000..5bcd4cd --- /dev/null +++ b/.data.json @@ -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" + ] + } + } + } +} \ No newline at end of file diff --git a/server.ts b/server.ts index 8a74fb3..7cb99ed 100644 --- a/server.ts +++ b/server.ts @@ -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] : []) })); }