# Summarizer API

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

{% hint style="success" %}
This API is compatible with the [Writing assistance API proposal](https://github.com/WICG/writing-assistance-apis) shipping with Google Chrome
{% endhint %}

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.

```javascript
import AI from '@aibrow/web'

const summarizer = await AI.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](https://demo.aibrow.ai/demos/summarizer-email-subject-generator/)

[Support ticket autofill](https://demo.aibrow.ai/demos/summarizer-support-ticket-autofill/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aibrow.ai/examples/summarizer-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
