Summarizer API

The summarizer API allows you to summarize some text using the language model.

This API is compatible with the Writing assistance API proposal shipping with Google Chrome

Use the summarizer API to summarize meeting transcripts, give a sentence or paragraph-sized summary of product reviews, summarize long articles or generate article titles.

const summarizer = await window.aibrow.summarizer.create({
  type: "tl;dr",
  length: "short"
})

// Prompt the model and wait for the whole result to come back.
const result = await summarizer.summarize("An article comparing Vim vs Emacs as the best text editor")

// Prompt the model and stream the result:
const stream = await summarizer.summarizeStreaming("An article comparing Vim vs Emacs as the best text editor")
for await (const chunk of stream) {
  console.log(chunk)
}

Demos

Email subject generator

Support ticket autofill

Last updated