AbstractProtected ReadonlynamespacePrefixes this class's error messages, like edgeAi.
AbstractgetEncode an image for model, returning an ImageEmbeddingRef
to reuse across prompts. The ref is only valid for model.
OptionalabortSignal: AbortSignalAbstractloadLoad a model (starts/keeps it resident). Rejects if it fails.
AbstractrunRun a one-shot prompt against a loaded model and return the full response.
The sampling settings are the ones on model.
image is raw bytes or an ImageEmbeddingRef from ViviAiInterface.getImageEmbedding,
and only goes with a text prompt: generation from token ids is text-only.
Optionalimage: string | ImageBytesOptionalabortSignal: AbortSignalAbstractrunTranscribe complete audio with a loaded speech model and return the whole transcript.
AbstractstreamRun a prompt and stream the generated tokens as they arrive.
Consume with for await; call cancel() to stop early.
image follows the same rules as in ViviAiInterface.runPrompt.
Optionalimage: string | ImageBytesOptionalabortSignal: AbortSignalAbstractstreamTranscribe audio with a loaded speech model, streaming results as they
are decoded. Consume with for await; call cancel() to stop early.
AbstracttokenizeTokenise prompt with model's tokenizer.
OptionalabortSignal: AbortSignal
The AI namespaces on an applet. Obtained via
applet.edgeAiorapplet.cloudAi.