Skip to content

Commit

Permalink
Fix obsidian team considerations (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ACSancheZ authored Jun 17, 2024
1 parent f2c4aaf commit 733ba22
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 34 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) [year] [fullname]
Copyright (c) 2024 Antonio Sanchez dos Santos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 2 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export default class ProfMatchIaPlugin extends Plugin {
template_folder: string;

async onload() {
console.log("Loading Professional Experience Summary plugin");
await this.loadSettings();
this.orchestrator = new Orchestrator(this.app, this.settings);

this.addCommand({
id: "generate-summary",
name: "Generate Summary",
id: "generate-job-experiences",
name: "Generate job experiences",
callback: async () => {
this.orchestrator.summarize();
},
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "ia-cv-maker",
"name": "IA Curriculum Maker",
"id": "ai-cv-maker",
"name": "AI Curriculum Maker",
"version": "0.0.6",
"minAppVersion": "1.5.12",
"description": "Effortlessly match professional experiences notes to jobs description using AI.",
Expand Down
24 changes: 9 additions & 15 deletions src/plugin-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {

containerEl.empty();

containerEl.createEl("h2", {
text: "Professional Experience Summary Settings",
});

new Setting(containerEl)
.setName("Job Experience Folder")
.setName("Job experience folder")
.setDesc("Folder containing your job experiences markdown files (Each job experience should be a Note).")
.addText((text) =>
text
Expand All @@ -54,7 +50,7 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Curriculum Templates Folder")
.setName("Curriculum templates folder")
.setDesc("Folder containing your curriculums templates notes. IMPORTANT: please add to your curriculum tamplate the place holder: '{{{{Job-Experiences}}}}'. You can find a example at ")
.addText((text) =>
text
Expand All @@ -67,7 +63,7 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Job Opportunities Folder")
.setName("Job opportunities folder")
.setDesc("Folder containing the job description notes")
.addText((text) =>
text
Expand All @@ -80,7 +76,7 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Output Folder")
.setName("Output folder")
.setDesc("Folder to save the summarized curriculums in a note")
.addText((text) =>
text
Expand All @@ -93,12 +89,10 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);


containerEl.createEl("h2", {
text: "Open AI Configurations",
});
new Setting(containerEl).setName("Open AI configurations").setHeading();

new Setting(containerEl)
.setName("OpenAI API Key")
.setName("OpenAI API key")
.setDesc("Enter your OpenAI API key")
.addText((text) =>
text
Expand All @@ -111,7 +105,7 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Chat GPT Model")
.setName("Chat GPT model")
.setDesc("Enter the model that you want to use.")
.addText((text) =>
text
Expand All @@ -124,7 +118,7 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Prompt to identify the Job Description")
.setName("Prompt to identify the job description")
.setDesc(
"You can customize the prompt used to ChatGPT read the Job Description.\n\nIMPORTANT: please add the placeholder '{{job-description}}'"
)
Expand All @@ -139,7 +133,7 @@ export class ProfMatchIaSettingTab extends PluginSettingTab {
);

new Setting(containerEl)
.setName("Prompt to summiraze one Job Experience")
.setName("Prompt to summiraze one job experience")
.setDesc(
"You can customize the prompt used to summiraze each job experience that will be added in the curriculum.\n\nIMPORTANT: please add the placeholder '{{job-experience}}'"
)
Expand Down
15 changes: 2 additions & 13 deletions src/prof-match-ia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class ProfMatchIa {
async getExpiriencesNotesFromFolder(
experienceFiles: TFile[]
): Promise<ExperienceEntry[]> {
console.log("Getting Summaries.");
const summaries: ExperienceEntry[] = [];
for (const file of experienceFiles) {
const content = await this.app.vault.read(file);
Expand Down Expand Up @@ -59,8 +58,7 @@ export class ProfMatchIa {
jobDescription
);
await chatGpt.getCompletion(jobDescriptionPrompt);
setTimeout(() => {}, 20000); // 20 seconds
new Notice("Registered Job Description in the Chat GPT context");
new Notice("Registered job description in the chat GPT context");

// Add Each Job Experience file to a ChatGPT call. It allows 3 calls per minute, so I have to implement a throttle.
let summarized = "";
Expand All @@ -74,7 +72,7 @@ export class ProfMatchIa {
await chatGpt.getCompletion(jobExperiencePrompt).then((result) => {
summarized += result + "\n";
});
new Notice(`Get Job Experience: '${summary.fileName}' summarized.`);
new Notice(`Get job experience: '${summary.fileName}' summarized.`);
}

return summarized;
Expand Down Expand Up @@ -102,15 +100,6 @@ export class ProfMatchIa {
const outputFileName = `Resume-${dateString}.md`;
const outputPath = `${outputFolder}/${outputFileName}`;

// const summaryContent = summaries
// .map(
// (entry) =>
// `## ${entry.jobtitle} | ${entry.fileName} | ${
// entry.started
// } - ${entry.ended || "Present"}\n\n${entry.summary}`
// )
// .join("\n\n");

await this.app.vault.create(outputPath, summaryContent);
new Notice(`Created new file: ${outputPath}`);
}
Expand Down

0 comments on commit 733ba22

Please sign in to comment.