Rewriter
Last updated
Last updated
static async availability(options) =>
Get the availability of the on-device language model.
Returns the availability
static async compatibility(options) =>
Get the availability of the on-device language model.
Returns the compatibility
static async create(options) =>
Creates a new embedding session
Returns a new Rewriter session that can be prompted with the pre-provided configuration
boolean
number
number
number
string
string[]
string[]
async (input, options) => string
(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
async (input, options) =>
number
Measures the prompt usage of the input
A string
signal optional AbortSignal
Returns prompt usage based on the input
options optional
options optional
options optional
See