# Summarizer

## Static Methods

### <mark style="background-color:red;">static</mark> availability

`static async availability(options) =>`  [`AIModelAvailability`](/api-reference/types/aimodelavailability.md)&#x20;

Get the availability of the on-device language model.

| Options (optional)                                                                                  |
| --------------------------------------------------------------------------------------------------- |
| **options** `optional` [`SummarizerCreateOptions`](/api-reference/types/summarizercreateoptions.md) |

Returns the availability

### <mark style="background-color:red;">static</mark> compatibility <mark style="background-color:green;">extension</mark> <mark style="background-color:purple;">web</mark>

`static async compatibility(options) =>`  [`AIModelCoreCompatibility`](/api-reference/types/aimodelcorecompatibility.md)&#x20;

Get the availability of the on-device language model.

| Options (optional)                                                                                  |
| --------------------------------------------------------------------------------------------------- |
| **options** `optional` [`SummarizerCreateOptions`](/api-reference/types/summarizercreateoptions.md) |

Returns the compatibility

### <mark style="background-color:red;">static</mark> create

`static async create(options) =>` [`Summarizer`](/api-reference/aibrow/summarizer.md)

Creates a new embedding session

| Options (optional)                                                                                  |
| --------------------------------------------------------------------------------------------------- |
| **options** `optional` [`SummarizerCreateOptions`](/api-reference/types/summarizercreateoptions.md) |

Returns a new Summarizer session that can be prompted with the pre-provided configuration

***

## Properties

### gpuEngine <mark style="background-color:green;">extension</mark> <mark style="background-color:purple;">web</mark>

[`AIModelGpuEngine`](/api-reference/types/aimodelgpuengine.md)&#x20;

### dtype <mark style="background-color:green;">extension</mark> <mark style="background-color:purple;">web</mark>

[`AIModelDtype`](/api-reference/types/aimodeldtype.md)&#x20;

### flashAttention <mark style="background-color:green;">extension</mark> <mark style="background-color:purple;">web</mark>

`boolean`

### contextSize

`number`&#x20;

### inputQuota

`number`&#x20;

### repeatPenalty <mark style="background-color:green;">extension</mark> <mark style="background-color:purple;">web</mark>

`number`&#x20;

### sharedContext

`string`&#x20;

### format

&#x20;[`SummarizerFormat`](/api-reference/types/summarizerformat.md)

### length

&#x20;[`SummarizerLength`](/api-reference/types/summarizerlength.md)&#x20;

### type

&#x20;[`SummarizerType`](/api-reference/types/summarizertype.md)&#x20;

### expectedInputLanguages

`string[]`&#x20;

### expectedContextLanguages

`string[]`&#x20;

***

## Methods

### summarize

`async (input, options) => string`

See [summarizeStreaming](#summarizestreaming)

### summarizeStreaming

`(input, options) => ReadableStream`

This prompts the model to rewrite the given input and session options.

| Input                                    |
| ---------------------------------------- |
| A `string`containing the text to rewrite |

| Options (optional)                |
| --------------------------------- |
| **signal** `optional AbortSignal` |
| **context** `optional string`     |

Returns a readable stream that updates each time new tokens are available from the language model

### measureInputUsage

`async (input, options) =>` `number`

Measures the prompt usage of the input

| Input      |
| ---------- |
| A `string` |

| Options (optional)                |
| --------------------------------- |
| **signal** `optional AbortSignal` |

Returns prompt usage based on the input


---

# 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/api-reference/aibrow/summarizer.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.
