demo · v131

shared context and per-call context

Summarizer accepts sharedContext at create time (applies to every call) and a context on each individual summarize() call. Pick a preset that imitates a real product flow — meeting notes, support tickets, product reviews — and see how context shifts the output.

flags Same prereqs as the base demo: Chrome 131+, chrome://flags/#summarization-api-for-gemini-nano, model downloaded. On unsupported builds the page still runs and renders a stub.

pick a product preset

Each preset wires sharedContext, type, format, and length together. Edit the editor below to tune for your own flow.

sharedContext (creation-time)
input
type / length / format
per-call context (optional)

side-by-side

without sharedContext

with sharedContext + per-call

the api

// sharedContext is applied to every summarize() call.
const s = await Summarizer.create({
  type: "key-points",
  length: "medium",
  format: "markdown",
  sharedContext: "You are summarising a 1:1 between an EM and IC. Skip pleasantries, output action items.",
});

// per-call context layers a more specific instruction on top.
const summary = await s.summarize(transcript, { context: "Focus only on what the IC committed to." });

see also