应用产品
基于Jev和TypeSafe AI决策模型的开源Gmail邮件分类工具,通过Vercel AI Gateway本地运行,能快速将收件箱分为需回复、更新、促销、销售和垃圾邮件。
Open-source AI email triage for Gmail. Sorts your inbox into Needs reply, Updates, Promos, Sales and Spam with Jev, TypeSafe AI's decision model, via Vercel AI Gateway. Read-only, runs locally, 1,000 emails in about a minute for 3 cents.
import { experimental_evaluate as evaluate } from "ai";链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
category选项Which lane does this email belong in? Judge from the sender, subject, headers, and body together.
needs_reply — A real person expects a reply from the recipient: a colleague, customer, friend, or existing contact asking something or continuing a conversation.updates — Transactional or informational mail about the recipient's own accounts and activity: bank and card transaction alerts, OTPs and security notices, order, delivery, and booking status, receipts and invoices, bill reminders, service alarms, calendar or system notifications. Automated, addressed to the recipient, not trying to sell anything.promotional — Marketing: newsletters, campaigns, discounts, product announcements, event invitations, and content digests sent to a list. Usually has an unsubscribe link and is not about a specific transaction of the recipient.sales — Unsolicited cold outreach from a vendor, agency, or recruiter trying to start a conversation or book a call with the recipient.spam — Scams, phishing, fake invoices, or junk with no legitimate purpose.urgency打分How urgently does this email need a reply from the recipient? Pick the level that best matches.
0 — No reply needed, or no time pressure at all1 — A reply within a week is fine2 — A reply within a few days is expected3 — A reply today is expected4 — A person is blocked, or a deadline falls within 24 hoursisPersonal是/否Was this email written by a human specifically to this recipient, rather than sent to a list or generated by a system?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
category: { type: 'choice', instructions: 'Which lane does this email belong in? Judge from the sender, subject, headers, and body together.',
criteria: { needs_reply: 'A real person expects a reply from the recipient: a colleague, customer, friend, or existing contact asking something or continuing a conversation.', updates: 'Transactional or informational mail about the recipient\'s own accounts and activity: bank and card transaction alerts, OTPs and security notices, order, delivery, and booking status, receipts and invoices, bill reminders, service alarms, calendar or system notifications. Automated, addressed to the recipient, not trying to sell anything.', promotional: 'Marketing: newsletters, campaigns, discounts, product announcements, event invitations, and content digests sent to a list. Usually has an unsubscribe link and is not about a specific transaction of the recipient.', sales: 'Unsolicited cold outreach from a vendor, agency, or recruiter trying to start a conversation or book a call with the recipient.', spam: 'Scams, phishing, fake invoices, or junk with no legitimate purpose.' } },
urgency: { type: 'score', instructions: 'How urgently does this email need a reply from the recipient? Pick the level that best matches.',
criteria: ['No reply needed, or no time pressure at all', 'A reply within a week is fine', 'A reply within a few days is expected', 'A reply today is expected', 'A person is blocked, or a deadline falls within 24 hours'] },
isPersonal: { type: 'boolean', instructions: 'Was this email written by a human specifically to this recipient, rather than sent to a list or generated by a system?' },
},
});