demo · v137 · origin trial

Kindness Pass

Straight out of the explainer use-case list: “be more constructive if a message is found to use toxic language”. A comment-box reviewer that runs your draft through the on-device Rewriter with a constructive-rewording sharedContext before you hit Send. Use any of the example drafts to feel the difference.

Heads up · origin trial / flagEnable chrome://flags/#rewriter-api-for-gemini-nano and download the Optimisation Guide on-device model from chrome://components. Without it, the demo will fall back to a label-only preview.
probing…

original

constructive rewrite

word-level diff

the code

const rewriter = await Rewriter.create({
  tone: "as-is",
  length: "as-is",
  sharedContext:
    "Make the user's message more constructive and respectful. " +
    "Preserve the factual content and the requested action; " +
    "remove inflammatory or dismissive language."
});

const result = await rewriter.rewrite(draft, {
  context: "This message will be posted in a code review."
});

see also