Summarizer
Static Methods
static availability
static async availability(options) =>
AIModelAvailability
Get the availability of the on-device language model.
options optional
SummarizerCreateOptions
Returns the availability
static compatibility extension web
static async compatibility(options) =>
AIModelCoreCompatibility
Get the availability of the on-device language model.
options optional
SummarizerCreateOptions
Returns the compatibility
static create
static async create(options) =>
Summarizer
Creates a new embedding session
options optional
SummarizerCreateOptions
Returns a new Summarizer session that can be prompted with the pre-provided configuration
Properties
gpuEngine extension web
dtype extension web
flashAttention extension web
boolean
contextSize
number
inputQuota
number
repeatPenalty extension web
number
sharedContext
string
format
length
type
expectedInputLanguages
string[]
expectedContextLanguages
string[]
Methods
summarize
async (input, options) => string
summarizeStreaming
(input, options) => ReadableStream
This prompts the model to rewrite the given input and session options.
A string
containing the text to rewrite
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
A string
signal optional AbortSignal
Returns prompt usage based on the input
Last updated