LanguageDetector
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 LanguageDetector session that can be prompted with the pre-provided configuration
boolean
number
number
string[]
This prompts the language model to detect which language is being used in the input text
A string
signal optional AbortSignal
Returns an array of detection results 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
async (input, options) =>
[]