Bezpieczeństwo i społeczność · basic

Wykrywanie spamu

Rozpoznaj niezamówione reklamy w formularzu kontaktowym.

choicenoul

Kiedy używać

  • Contact forms
  • Inbox triage
  • Community intake

Przykładowy state

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

Pytania decyzyjne

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?

Oczekiwane wyjście

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

Dlaczego to działa

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

Ograniczenia

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

Oficjalne źródło

2026-09-21

Następny krok: Jev PlaygroundWzorce