取消
默认
@@ -68,8 +72,8 @@ const model = ref(formData.aiGreeting.model);
type="primary"
@click="
() => {
- formData.aiGreeting.model = model;
- formData.aiGreeting.word = val;
+ formData[data].model = model;
+ formData[data].word = val;
confSaving();
show = false;
}
diff --git a/src/pages/web/geek/job/config.vue b/src/pages/web/geek/job/config.vue
index b3eb59a..be28942 100644
--- a/src/pages/web/geek/job/config.vue
+++ b/src/pages/web/geek/job/config.vue
@@ -10,7 +10,7 @@ import formItem from "@/components/form/formItem.vue";
import formSelect from "@/components/form/formSelect.vue";
import deepmerge from "@/utils/deepmerge";
import { FormData } from "@/types/formData";
-import { useFormData } from "./hooks/useForm";
+import { useFormData, formInfoData } from "./hooks/useForm";
const {
formData,
deliverLock,
@@ -32,7 +32,7 @@ const {
:disabled="deliverLock"
>
;
export const JobDescriptionError = createCustomError("工作内容筛选");
export type JobDescriptionError = InstanceType;
+export const AIFilteringError = createCustomError("AI筛选");
+export type AIFilteringError = InstanceType;
export const ActivityError = createCustomError("活跃度过滤");
export type ActivityError = InstanceType;
export const UnknownError = createCustomError("未知错误", "danger");
diff --git a/src/pages/web/geek/job/hooks/useDeliver.ts b/src/pages/web/geek/job/hooks/useDeliver.ts
index 1563e2f..2bad284 100644
--- a/src/pages/web/geek/job/hooks/useDeliver.ts
+++ b/src/pages/web/geek/job/hooks/useDeliver.ts
@@ -14,6 +14,7 @@ import {
RepeatError,
ActivityError,
GreetError,
+ AIFilteringError,
} from "./types";
import { logData, useLog } from "./useLog";
const { formData, todayData, deliverStop } = useFormData();
@@ -302,7 +303,7 @@ export const useDeliver = () => {
});
}
// 工作内容筛选
- if (formData.jobContent.enable) {
+ if (formData.jobContent.enable || formData.aiFiltering.enable) {
handlesRes.push(async ({ card }) => {
try {
const content = card?.postDescription;
@@ -329,8 +330,57 @@ export const useDeliver = () => {
}
});
}
- // 活跃度过滤
+ // AI过滤
+ if (formData.aiFiltering.enable) {
+ const template =
+ miTem.compile(`我现在需要求职,让你根据我的需要对岗位进行评分,方便我筛选岗位。
+我的要求是:
+${formData.aiFiltering.word}
+>>>下面是岗位相关信息:
+岗位名:{{ card.jobName }}
+岗位描述:{{ card.postDescription }}
+薪酬:{{ card.salaryDesc }}
+经验要求:{{ card.experienceName }},学历要求:{{ card.degreeName }}
+相关标签:{{ card.jobLabels }}
+>>>>>>>>>>我需要你输出Json格式的字符串,符合以下的定义
+interface aiFiltering {
+ rating: number; // 分数,0-100分,低于60的我会筛选掉
+ negative: string[] | string; // 扣分项,可以是一句话为什么扣分,也可以是数组代表多个扣分项
+ positive: string[] | string; // 加分项,可以是一句话为什么加分,也可以是数组代表多个加分项
+}`);
+
+ const model = modelData.value.find(
+ (v) => v.key === formData.aiGreeting.model
+ );
+ handlesRes.push(async ({ card }, ctx) => {
+ try {
+ const msg = template({ card: card });
+ if (!model) {
+ ElMessage.warning("没有找到AI筛选的模型");
+ return;
+ }
+ const gptMsg = await requestGpt(model, msg);
+ if (!gptMsg) {
+ return;
+ }
+ const data: {
+ rating: number;
+ negative: string[] | string;
+ positive: string[] | string;
+ } = JSON.parse(gptMsg);
+ const mg = `分数${data.rating}\n消极:${data.negative}\n积极:${data.positive}`;
+ ctx.aiFiltering = mg;
+ if (data.rating < 60) {
+ throw new AIFilteringError(mg);
+ }
+ } catch (e: any) {
+ todayData.jobContent++;
+ throw new AIFilteringError(e.message);
+ }
+ });
+ }
if (formData.activityFilter) {
+ // 活跃度过滤
handlesRes.push(async ({ card }) => {
try {
const activeText = card?.activeTimeDesc;
diff --git a/src/pages/web/geek/job/hooks/useForm.ts b/src/pages/web/geek/job/hooks/useForm.ts
index 598b0fc..e3ac377 100644
--- a/src/pages/web/geek/job/hooks/useForm.ts
+++ b/src/pages/web/geek/job/hooks/useForm.ts
@@ -5,73 +5,104 @@ import { GM_getValue, GM_listValues, GM_setValue } from "$";
import { reactiveComputed, watchThrottled } from "@vueuse/core";
import deepmerge from "@/utils/deepmerge";
-import { FormData, Statistics } from "@/types/formData";
+import { FormData, FormInfoData, Statistics } from "@/types/formData";
import { getCurDay } from "@/utils";
export const formDataKey = "web-geek-job-FormData";
export const todayKey = "web-geek-job-Today";
export const statisticsKey = "web-geek-job-Statistics";
-
-export const defaultFormData: FormData = {
+export const formInfoData: FormInfoData = {
company: {
label: "公司名",
help: "投递工作的公司名一定包含或不包含在当前集合中,模糊匹配,可用于只投或不投某个公司/子公司。",
+ },
+ jobTitle: {
+ label: "工作名",
+ help: "投递工作的岗位名一定包含或不包含在当前集合中,模糊匹配,可用于只投或不投某个岗位名。",
+ },
+ jobContent: {
+ label: "工作内容",
+ help: "会自动检测上文(不是,不,无需等关键字),下文(系统,工具),例子:【外包,上门,销售,驾照】,如果写着是'不是外包''销售系统'那也不会被排除",
+ },
+ salaryRange: {
+ label: "薪资范围",
+ help: "投递工作的薪资范围一定在当前区间中,一定是区间,使用-连接范围。例如:【12-20】",
+ },
+ companySizeRange: {
+ label: "公司规模范围",
+ help: "投递工作的公司人员范围一定在当前区间中,一定是区间,使用-连接范围。例如:【500-20000000】",
+ },
+ customGreeting: {
+ label: "自定义招呼语",
+ help: "因为boss不支持将自定义的招呼语设置为默认招呼语。开启表示发送boss默认的招呼语后还会发送自定义招呼语, 使用<br>\\n 换行;例子:【你好\\n我...】",
+ },
+ greetingVariable: {
+ label: "招呼语变量",
+ help: "使用mitem模板引擎来对招呼语进行渲染;",
+ },
+ activityFilter: {
+ label: "活跃度过滤",
+ help: "打开后会自动过滤掉最近未活跃的Boss发布的工作。以免浪费每天的100次机会。",
+ },
+ notification: {
+ label: "发送通知",
+ help: "可以在网站管理中打开通知权限,当停止时会自动发送桌面端通知提醒。",
+ },
+ aiGreeting: {
+ label: "AI招呼语",
+ help: "即使前面招呼语开了也不会发送,只会发送AI生成的招呼语,让gpt来打招呼真是太棒了,毕竟开场白很重要。",
+ },
+ aiFiltering: {
+ label: "AI过滤",
+ help: "根据工作内容让gpt分析过滤,真是太稳健了,不放过任何一个垃圾",
+ },
+ aiReply: {
+ label: "AI回复",
+ help: "万一消息太多,回不过来了呢,也许能和AiHR聊到地球爆炸?魔法击败魔法",
+ },
+};
+
+export const defaultFormData: FormData = {
+ company: {
include: false,
value: [],
options: [],
enable: false,
},
jobTitle: {
- label: "工作名",
- help: "投递工作的岗位名一定包含或不包含在当前集合中,模糊匹配,可用于只投或不投某个岗位名。",
include: false,
value: [],
options: [],
enable: false,
},
jobContent: {
- label: "工作内容",
- help: "会自动检测上文(不是,不,无需等关键字),下文(系统,工具),例子:【外包,上门,销售,驾照】,如果写着是'不是外包''销售系统'那也不会被排除",
include: false,
value: [],
options: [],
enable: false,
},
salaryRange: {
- label: "薪资范围",
- help: "投递工作的薪资范围一定在当前区间中,一定是区间,使用-连接范围。例如:【12-20】",
value: "",
enable: false,
},
companySizeRange: {
- label: "公司规模范围",
- help: "投递工作的公司人员范围一定在当前区间中,一定是区间,使用-连接范围。例如:【500-20000000】",
value: "",
enable: false,
},
customGreeting: {
- label: "自定义招呼语",
- help: "因为boss不支持将自定义的招呼语设置为默认招呼语。开启表示发送boss默认的招呼语后还会发送自定义招呼语, 使用<br>\\n 换行;例子:【你好\\n我...】",
value: "",
enable: false,
},
greetingVariable: {
- label: "招呼语变量",
- help: "使用mitem模板引擎来对招呼语进行渲染;",
value: false,
},
activityFilter: {
- label: "活跃度过滤",
- help: "打开后会自动过滤掉最近未活跃的Boss发布的工作。以免浪费每天的100次机会。",
value: false,
},
notification: {
- label: "发送通知",
- help: "可以在网站管理中打开通知权限,当停止时会自动发送桌面端通知提醒。",
value: false,
},
aiGreeting: {
- label: "AI招呼语",
enable: false,
word: `我现在需要求职,所以请你来写求职招呼语来向boos或hr打招呼,你需要代入我的身份也就是一名求职者.
我的能力:\"我叫xxx,今年xx岁了,我会......\"
@@ -87,16 +118,14 @@ export const defaultFormData: FormData = {
相关标签:{{ card.jobLabels }}
`,
},
- // aiFiltering: {
- // label: "AI过滤",
- // enable: false,
- // word: "",
- // },
- // aiReply: {
- // label: "AI回复",
- // enable: false,
- // word: "",
- // },
+ aiFiltering: {
+ enable: false,
+ word: "我想要早九晚五和双休,公司同事们最好年轻一些要有良好的氛围。我不希望岗位有任何的销售性质,我也不会上门去服务。我想要的是加分项而不是扣分项,没早九晚五也没事,我是社畜~",
+ },
+ aiReply: {
+ enable: false,
+ word: "",
+ },
};
const todayData = reactiveComputed(() => {
diff --git a/src/pages/web/geek/job/hooks/useLog.ts b/src/pages/web/geek/job/hooks/useLog.ts
index 360c1a6..506467c 100644
--- a/src/pages/web/geek/job/hooks/useLog.ts
+++ b/src/pages/web/geek/job/hooks/useLog.ts
@@ -34,6 +34,7 @@ export type logData = {
card?: JobCard;
boosData?: BoosData;
message?: string;
+ aiFiltering?: string; //Ai筛选
};
type logState = "info" | "success" | "warning" | "danger";
diff --git a/src/types/formData.ts b/src/types/formData.ts
index 067b8d1..f7a5861 100644
--- a/src/types/formData.ts
+++ b/src/types/formData.ts
@@ -22,31 +22,31 @@ export interface FormData {
activityFilter: FormDataCheckbox;
notification: FormDataCheckbox;
aiGreeting: FormDataAi;
- // aiFiltering: FormDataAi;
- // aiReply: FormDataAi;
+ aiFiltering: FormDataAi;
+ aiReply: FormDataAi;
}
+export type FormInfoData = {
+ [key in keyof FormData]: {
+ label: string;
+ help?: string;
+ };
+};
+
export interface FormDataSelect {
- label: string;
- help?: string;
include: boolean;
value: string[];
options: string[];
enable: boolean;
}
export interface FormDataInput {
- label: string;
- help?: string;
value: string;
enable: boolean;
}
export interface FormDataCheckbox {
- label: string;
- help?: string;
value: boolean;
}
export interface FormDataAi {
- label: string;
model?: string;
word: string;
enable: boolean;