choiceemail_typeHow should this email be classified?
normalspamphishing
在大量邮件进入更重的检测器或人工分析前,用 Laya 做第一层分流。
Your Microsoft 365 password expires today. Confirm your account immediately and enter your password to avoid suspension.
choiceemail_typeHow should this email be classified?
noulcredential_theftIs this email trying to obtain account credentials?
from laya import Router
router = Router(preload=True)
state = {"email": "Your Microsoft 365 password expires today. Confirm your account and enter your password."}
questions = {
"email_type": {"type": "choice", "instructions": "How should this email be classified?", "criteria": {"normal": "legitimate", "spam": "bulk promotion", "phishing": "credential theft"}},
"credential_theft": {"type": "noul", "instructions": "Is this email trying to obtain account credentials?"}
}
print(router.predict(state, questions))import { Laya } from "@receptron/laya";
const laya = await Laya.load();
const result = await laya.systemOne(
{ email: "Your Microsoft 365 password expires today. Confirm your account." },
{
email_type: { type: "choice", instructions: "How should this email be classified?", criteria: { normal: "legitimate", spam: "bulk promotion", phishing: "credential theft" } },
credential_theft: { type: "noul", instructions: "Is this trying to obtain credentials?" },
},
);
console.log(result.answers);
await laya.close();