安全とコミュニティ · basic

スパム検出

問い合わせフォームの広告や無関係な宣伝を識別します。

choicenoul

使用する場面

  • Contact forms
  • Inbox triage
  • Community intake

State の例

{
  "message": "We guarantee page-one rankings. Buy 10,000 backlinks today. Reply for our price list.",
  "source": "contact_form"
}

判断の質問

choicemessage_type

Choose the best route for this inbound message.

  • sales — A potential customer evaluating our product
  • partnership — A concrete collaboration proposal
  • support — An existing customer seeking help
  • spam — Unsolicited generic promotion
  • unclear — Purpose is unclear
noulunsolicited_promotion

Is this message primarily unsolicited generic promotion rather than a relevant request?

期待される出力

A route plus a spam probability that can be thresholded conservatively.

TypeScript

import { choice, noul, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient();

const result = await client.systemOne({
  state: {
    message:
      "We guarantee page-one rankings. Buy 10,000 backlinks today. Reply for our price list.",
    source: "contact_form",
  },
  questions: {
    message_type: choice("Choose the best route for this inbound message.", {
      sales: "A potential customer evaluating our product",
      partnership: "A concrete collaboration proposal",
      support: "An existing customer seeking help",
      spam: "Unsolicited generic promotion",
      unclear: "Purpose is unclear",
    }),
    unsolicited_promotion: noul(
      "Is this message primarily unsolicited generic promotion rather than a relevant request?"
    ),
  },
});

この設計の理由

  • An unclear route avoids forcing ambiguous messages into spam.
  • A separate probability lets the application choose a conservative threshold.

注意点

  • Do not automatically delete low-confidence messages.
  • This is a semantic triage pattern, not a full anti-abuse system.

公式ソース

2026-09-21

次のステップ: Jev Playgroundテンプレート