Sécurité et communauté · basic

Détection du spam

Identifier les promotions non sollicitées dans un formulaire de contact.

choicenoul

Quand l’utiliser

  • Contact forms
  • Inbox triage
  • Community intake

Exemple de state

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

Questions de décision

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?

Sortie attendue

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?"
    ),
  },
});

Pourquoi ce modèle fonctionne

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

Limites

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

Source officielle

2026-09-21

Étape suivante: Jev PlaygroundModèles