Compare a reply with its parent discussion. Separate substantive questions, corrections and useful references from unrelated promotion, preserving mixed intent or insufficient context for review.
Review one reply in contextLive API
The decision
Why the parent post belongs in the input.
A reply about timeouts can be useful beneath an API troubleshooting post and irrelevant beneath a cooking discussion. This example sends both the parent and the reply to Jev. The rule asks for conversational relevance and a visible promotional purpose; it does not ask the model to guess whether an account is a bot.
The three choices serve different review needs. Relevant discussion includes substantive questions, corrections and disagreement. Unsolicited promotion covers clearly unrelated sales pitches or engagement solicitation. Needs review keeps missing context and mixed advice-plus-promotion out of an automatic removal queue.
X describes spam behavior that can include repetitive or unsolicited replies. This text-only demonstration cannot establish repetition across an account. The source post inspired the workflow; the six examples here were independently written to examine its decision boundaries. No source speed or implementation claim is presented as our measurement.
AI-generated concept illustration of reply review; not an X interface or actual user conversation.
How it works
Review replies in four steps.
Preserve context and separate classification from moderation.
01
Include the parent
Pair the reply with the post it answers. Remove unrelated personal information and keep the original record ID.
02
Define the review rule
State what counts as meaningful discussion, unsolicited promotion and an uncertain case.
03
Compare contrasting replies
Try the genuine question, disagreement, unrelated pitch and missing-context samples before adapting the policy.
04
Review any account action
Keep the classification as evidence for review. This demo does not hide posts, block accounts or report users.
Our API test
Six replies, including disagreement and uncertainty.
Six replies, including disagreement and uncertainty.
Original reply
Observed label
Leading probability
Useful question
Relevant discussion
100%
Unrelated pitch
Unsolicited promotion
100%
Relevant disagreement
Relevant discussion
100%
Follow solicitation
Unsolicited promotion
100%
Advice plus promotion
Needs review
88%
Missing parent
Needs review
95%
Six live Jev requests on September 27, 2026. Original synthetic functional checks, not a spam-detection benchmark. Future distributions may differ.Verified
Understand the results
Disagreement still contributes to the same topic
The disagreement sample challenges a proposed debugging approach, but it still contributes to the same technical conversation.
Read the example notes
Changing the tone from polite to blunt should not make it spam under this policy. Test that distinction by editing the reply while keeping the technical argument intact.
The mixed sample contains both relevant advice and a sales pitch
The mixed sample contains both relevant advice and a sales pitch.
Read the example notes
It belongs in a review queue under this example rule. Another community could adopt a different disclosed policy, but the criteria and test cases should change together. When the parent is missing, restore it before using a label to support any moderation decision.
Using the result in your application
Download observed-replies.json and run-choice-sample.mjs into a private Node.js project.
Read the example notes
Tested setup: Node.js 24.18.0 and @typesafe-ai/sdk 0.6.0. Run npm init -y, then npm install @typesafe-ai/sdk@0.6.0. Set TYPESAFE_API_KEY in your private shell and run node run-choice-sample.mjs observed-replies.json disagree. The runner makes one fresh request without retries.
Six samples with complete recorded requests
The fixture contains six samples, each with an ID, full context, policy, choices and recorded response.
Read the example notes
Fresh output includes the selected sample, elapsed time and provider result. Compare its distribution with the recorded result rather than expecting byte-for-byte equality. The page reports this small functional exercise, not detection accuracy across real accounts.
import { readFile } from 'node:fs/promises';
import { choice, TypeSafeClient } from '@typesafe-ai/sdk';
// Run one selected sample. There are no retries or automatic batch requests.
const [file, sampleId] = process.argv.slice(2);
if (!file || !sampleId || !process.env.TYPESAFE_API_KEY) {
throw new Error('Set TYPESAFE_API_KEY, then run: node run-choice-sample.mjs FIXTURE.json SAMPLE_ID');
}
const raw = await readFile(file, 'utf8');
if (Buffer.byteLength(raw) > 1_000_000) throw new Error('Fixture is too large');
/** @type {{samples: Array<{id: string, request: {context: string, question: string, choices: string[]}}>}} */
const fixture = JSON.parse(raw);
const matches = fixture.samples.filter(sample => sample.id === sampleId);
if (matches.length !== 1) throw new Error('Select exactly one existing sample ID');
const { context, question, choices } = matches[0].request;
if (typeof context !== 'string' || typeof question !== 'string' || context.length > 12000
|| question.length > 500 || !Array.isArray(choices) || choices.length < 2 || choices.length > 12
|| choices.some(label => typeof label !== 'string' || !label || label.length > 120)
|| new Set(choices).size !== choices.length) throw new Error('Invalid sample request');
const client = new TypeSafeClient({ logLevel: 'off' });
const start = performance.now();
try {
const result = await client.systemOne({ model: 'jev-latest', state: { context, question, choices },
questions: { decision: choice(question, Object.fromEntries(choices.map(label => [label, null]))) } },
{ timeout: 10000, retry: { maxRetries: 0 } });
console.log(JSON.stringify({ sampleId, elapsedMs: Math.round(performance.now() - start), result }, null, 2));
} catch {
console.error('The API request failed. No retry was sent; check your account and network privately.');
process.exitCode = 1;
}
Scope of this demo
What this example helps you test.
Supplied choices
What you can test
Testing reply relevance with parent-post context
Keeping substantive criticism out of spam queues
Reviewing mixed promotion and incomplete context
Application responsibilities
What this demo does not do
Proving that an account is a bot or coordinated actor
Inferring unseen posting history or opening links
Automatically hiding replies or blocking users
Example FAQ
Questions before you use the result.
Understand the choices, the source and what a live result means.
Is disagreement spam?
Not under this example policy. A substantive correction or disagreement about the parent topic is Relevant discussion.
Why does advice with a promotion need review?
The reply mixes a useful contribution with a sales pitch. This example leaves that boundary to a human rather than silently treating all promotion as irrelevant.
Can this detect coordinated spam accounts?
No. One parent-and-reply pair does not establish account history, repeated behavior or coordination. Those need separate evidence.
Will running the demo remove a reply?
No. It returns a typed classification and probabilities. It has no account moderation connection.
Can I change the policy?
Yes. Edit the criteria and test all contrasting samples again. Keep a review option for incomplete or conflicting evidence.
Test your own decision
Try another input here or build a different Choice question in the Playground.