DecisionMakerOptions interface

Options to configure the MediaPipe Semantic Decision Maker Task. Note: On Web, baseOptions.delegate defaults to 'GPU' (WebGPU). .litertlm containers with external weights (such as EmbeddingGemma 2 and Gemma 4) require WebGPU on Web and do not support delegate: 'CPU'. Setting baseOptions.delegate to 'CPU' on Web is only supported for .task or inline .tflite models (such as Laya).

Signature:

export declare interface DecisionMakerOptions extends TaskRunnerOptions 

Properties

Property Modifiers Type Description
backendType number Backend type (0=AUTO, 1=ENCODER, 2=DIRECT_LOGIT, 3=EMBEDDING).
maxNumTokens number The maximum number of tokens in prompt context.
schema ClassifierSchema Optional session-bound ClassifierSchema for classify().
context string Optional session-level context prepended to question prompts.
expectedInputs ClassifierExpectedInput[] Optional expected input modalities and languages.
questions ClassifierQuestion[] Optional session-bound questions for classify().
modelAssetSize number Optional byte length of baseOptions.modelAssetBuffer when provided as a ReadableStreamDefaultReader, enabling single-pass zero-copy streaming allocation directly in the Wasm heap.
companionPleAssetPath string Optional URL or path to a companion per-layer embedder .tflite model (e.g. *_per_layer_embedder.tflite for Gemma 4 E2B).
companionPleAssetBuffer Uint8Array | ReadableStreamDefaultReader Optional buffer or stream reader for a companion per-layer embedder .tflite model.
companionPleAssetSize number Optional byte length of companionPleAssetBuffer when provided as a ReadableStreamDefaultReader.

DecisionMakerOptions.backendType

Backend type (0=AUTO, 1=ENCODER, 2=DIRECT_LOGIT, 3=EMBEDDING).

Signature:

backendType?: number;

DecisionMakerOptions.maxNumTokens

The maximum number of tokens in prompt context.

Signature:

maxNumTokens?: number;

DecisionMakerOptions.schema

Optional session-bound ClassifierSchema for classify().

Signature:

schema?: ClassifierSchema;

DecisionMakerOptions.context

Optional session-level context prepended to question prompts.

Signature:

context?: string;

DecisionMakerOptions.expectedInputs

Optional expected input modalities and languages.

Signature:

expectedInputs?: ClassifierExpectedInput[];

DecisionMakerOptions.questions

Optional session-bound questions for classify().

Signature:

questions?: ClassifierQuestion[];

DecisionMakerOptions.modelAssetSize

Optional byte length of baseOptions.modelAssetBuffer when provided as a ReadableStreamDefaultReader, enabling single-pass zero-copy streaming allocation directly in the Wasm heap.

Signature:

modelAssetSize?: number;

DecisionMakerOptions.companionPleAssetPath

Optional URL or path to a companion per-layer embedder .tflite model (e.g. *_per_layer_embedder.tflite for Gemma 4 E2B).

Signature:

companionPleAssetPath?: string;

DecisionMakerOptions.companionPleAssetBuffer

Optional buffer or stream reader for a companion per-layer embedder .tflite model.

Signature:

companionPleAssetBuffer?: Uint8Array | ReadableStreamDefaultReader;

DecisionMakerOptions.companionPleAssetSize

Optional byte length of companionPleAssetBuffer when provided as a ReadableStreamDefaultReader.

Signature:

companionPleAssetSize?: number;