ADK for TypeScript: API Reference
    Preparing search index...

    Interface ChromeBuiltInLlmParams

    Constructor options for ChromeBuiltInLlm.

    interface ChromeBuiltInLlmParams {
        expectedInputs?: ChromeExpectedModality[];
        expectedOutputs?: ChromeExpectedModality[];
        languageModel?: ChromeLanguageModelFactory;
        model?: string;
        normalizeSystemPrompt?: (systemPrompt: string) => string;
        onDiagnostic?: (diagnostic: ChromeBuiltInDiagnostic) => void;
        onDownloadProgress?: (loaded: number) => void;
        temperature?: number;
        topK?: number;
    }

    Properties

    expectedInputs?: ChromeExpectedModality[]

    Modalities to declare at session creation.

    expectedOutputs?: ChromeExpectedModality[]

    Injects an alternative implementation of the LanguageModel global, for tests and for embedding a stand-in. Defaults to globalThis.LanguageModel.

    model?: string

    Model id used for registry matching. Defaults to chrome-on-device.

    normalizeSystemPrompt?: (systemPrompt: string) => string

    Rewrites the system prompt before a session is created.

    This exists because of a specific and costly interaction with ADK. Every request is prefixed by ADK's identity processor with:

    You are an agent. Your internal name is "<agent name>".
    

    Under a ParallelAgent fan-out each child has a different name, so every child produces a different system prompt, so the warm base session never hits and each child pays a full create() — the most expensive call available — precisely when the most calls are in flight.

    Pass stripAdkIdentityPreamble to drop it. That is safe whenever agent transfer is disabled, because the identity line exists to support transfer. Leave it unset for multi-agent setups that route by name.

    onDiagnostic?: (diagnostic: ChromeBuiltInDiagnostic) => void

    Receives timing and context diagnostics.

    onDownloadProgress?: (loaded: number) => void

    Receives bytes-loaded progress while the model downloads on first use.

    temperature?: number

    Sampling temperature. Accepted only in extension contexts; on a plain web page create() rejects it and the adapter retries without it.

    topK?: number

    Sampling top-K. Subject to the same restriction as temperature.