mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 00:47:15 +08:00
add logic to check if resume content rich enough
This commit is contained in:
+28
@@ -1,3 +1,27 @@
|
|||||||
|
export interface ResumeContent {
|
||||||
|
name: string
|
||||||
|
workYearDesc: string
|
||||||
|
expectJob: string
|
||||||
|
userDescription: string
|
||||||
|
geekWorkExpList: Array<{
|
||||||
|
company: string
|
||||||
|
positionName: string
|
||||||
|
startYearMon: string | null
|
||||||
|
endYearMon: string | null
|
||||||
|
performance: string
|
||||||
|
workDescription: string
|
||||||
|
}>
|
||||||
|
geekProjExpList: Array<{
|
||||||
|
name: string
|
||||||
|
startYearMon: string
|
||||||
|
endYearMon: string
|
||||||
|
roleName: string
|
||||||
|
projectDescription: string
|
||||||
|
performance: string
|
||||||
|
}>
|
||||||
|
expectSalary: [string, string]
|
||||||
|
}
|
||||||
|
|
||||||
export function formatResumeJsonToMarkdown(resume) {
|
export function formatResumeJsonToMarkdown(resume) {
|
||||||
const basicInfoText = [
|
const basicInfoText = [
|
||||||
['# 姓名', resume.content.name],
|
['# 姓名', resume.content.name],
|
||||||
@@ -53,3 +77,7 @@ export function formatResumeJsonToMarkdown(resume) {
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function resumeContentEnoughDetect(resumeItem: { content: ResumeContent }) {
|
||||||
|
return formatResumeJsonToMarkdown(resumeItem)?.length > 800
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ import {
|
|||||||
autoReminderPromptTemplateFileName,
|
autoReminderPromptTemplateFileName,
|
||||||
writeDefaultAutoRemindPrompt
|
writeDefaultAutoRemindPrompt
|
||||||
} from '../../READ_NO_REPLY_AUTO_REMINDER/boss-operation'
|
} from '../../READ_NO_REPLY_AUTO_REMINDER/boss-operation'
|
||||||
|
import { resumeContentEnoughDetect } from '../../../../common/utils/resume'
|
||||||
|
|
||||||
export default function initIpc() {
|
export default function initIpc() {
|
||||||
ipcMain.handle('fetch-config-file-content', async () => {
|
ipcMain.handle('fetch-config-file-content', async () => {
|
||||||
@@ -502,6 +503,10 @@ export default function initIpc() {
|
|||||||
ipcMain.handle('check-if-auto-remind-prompt-valid', async () => {
|
ipcMain.handle('check-if-auto-remind-prompt-valid', async () => {
|
||||||
await getValidTemplate()
|
await getValidTemplate()
|
||||||
})
|
})
|
||||||
|
ipcMain.handle('resume-content-enough-detect', async () => {
|
||||||
|
const res = (await readConfigFile('resumes.json'))?.[0]
|
||||||
|
return resumeContentEnoughDetect(res)
|
||||||
|
})
|
||||||
ipcMain.handle('overwrite-auto-remind-prompt-with-default', async () => {
|
ipcMain.handle('overwrite-auto-remind-prompt-with-default', async () => {
|
||||||
await writeDefaultAutoRemindPrompt()
|
await writeDefaultAutoRemindPrompt()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
readStorageFile,
|
readStorageFile,
|
||||||
writeStorageFile
|
writeStorageFile
|
||||||
} from '@geekgeekrun/geek-auto-start-chat-with-boss/runtime-file-utils.mjs'
|
} from '@geekgeekrun/geek-auto-start-chat-with-boss/runtime-file-utils.mjs'
|
||||||
import { formatResumeJsonToMarkdown } from '../../../common/utils/format-resume-json-to-markdown'
|
import { formatResumeJsonToMarkdown } from '../../../common/utils/resume'
|
||||||
import { SINGLE_ITEM_DEFAULT_SERVE_WEIGHT } from '../../../common/constant'
|
import { SINGLE_ITEM_DEFAULT_SERVE_WEIGHT } from '../../../common/constant'
|
||||||
|
|
||||||
export const sendLookForwardReplyEmotion = async (page: Page) => {
|
export const sendLookForwardReplyEmotion = async (page: Page) => {
|
||||||
|
|||||||
@@ -268,6 +268,21 @@ const handleSubmit = async () => {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!(await electron.ipcRenderer.invoke('resume-content-enough-detect'))) {
|
||||||
|
gtagRenderer('resume_content_not_enough_dialog_show')
|
||||||
|
try {
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
`简历内容可能不够充足(各个部分内容长度相加 <800 字)<br />后续大模型根据简历生成的内容将可能不够随机<br /><br />要继续运行吗?`,
|
||||||
|
{
|
||||||
|
cancelButtonText: '不,我再看看',
|
||||||
|
confirmButtonText: '是的,继续运行',
|
||||||
|
dangerouslyUseHTMLString: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
gtagRenderer('reminder_launched')
|
gtagRenderer('reminder_launched')
|
||||||
router.replace({
|
router.replace({
|
||||||
path: '/geekAutoStartChatWithBoss/prepareRun',
|
path: '/geekAutoStartChatWithBoss/prepareRun',
|
||||||
|
|||||||
@@ -310,34 +310,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ElForm, ElButton, ElAlert } from 'element-plus'
|
import { ElForm, ElButton, ElAlert, ElMessageBox } from 'element-plus'
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { ArrowUp, ArrowDown, Delete, Plus } from '@element-plus/icons-vue'
|
import { ArrowUp, ArrowDown, Delete, Plus } from '@element-plus/icons-vue'
|
||||||
import { gtagRenderer } from '@renderer/utils/gtag'
|
import { gtagRenderer } from '@renderer/utils/gtag'
|
||||||
|
import { type ResumeContent, resumeContentEnoughDetect } from '../../../../common/utils/resume'
|
||||||
interface ResumeContent {
|
|
||||||
name: string
|
|
||||||
workYearDesc: string
|
|
||||||
expectJob: string
|
|
||||||
userDescription: string
|
|
||||||
geekWorkExpList: Array<{
|
|
||||||
company: string
|
|
||||||
positionName: string
|
|
||||||
startYearMon: string | null
|
|
||||||
endYearMon: string | null
|
|
||||||
performance: string
|
|
||||||
workDescription: string
|
|
||||||
}>
|
|
||||||
geekProjExpList: Array<{
|
|
||||||
name: string
|
|
||||||
startYearMon: string
|
|
||||||
endYearMon: string
|
|
||||||
roleName: string
|
|
||||||
projectDescription: string
|
|
||||||
performance: string
|
|
||||||
}>
|
|
||||||
expectSalary: [string, string]
|
|
||||||
}
|
|
||||||
|
|
||||||
const formRef = ref<InstanceType<typeof ElForm>>()
|
const formRef = ref<InstanceType<typeof ElForm>>()
|
||||||
|
|
||||||
@@ -367,6 +344,25 @@ const handleCancel = () => {
|
|||||||
}
|
}
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
gtagRenderer('submit_clicked')
|
gtagRenderer('submit_clicked')
|
||||||
|
if (
|
||||||
|
!resumeContentEnoughDetect({
|
||||||
|
content: formContent.value
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
gtagRenderer('resume_content_not_enough_dialog_show')
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
`简历内容可能不够充足(各个部分内容长度相加 <800 字)<br />后续大模型根据简历生成的内容将可能不够随机<br /><br />要继续保存吗?`,
|
||||||
|
{
|
||||||
|
cancelButtonText: '不,我再改改',
|
||||||
|
confirmButtonText: '是的,继续保存',
|
||||||
|
dangerouslyUseHTMLString: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
electron.ipcRenderer.invoke('save-resume-content', JSON.parse(JSON.stringify(formContent.value)))
|
electron.ipcRenderer.invoke('save-resume-content', JSON.parse(JSON.stringify(formContent.value)))
|
||||||
gtagRenderer('submit_done')
|
gtagRenderer('submit_done')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user