Skip to main content

Class: TemporalModel

googleAdkAgentsWorkflow.TemporalModel

A BaseLlm whose inference is durable under Temporal.

Swap a user's model: 'gemini-2.5-flash' for model: new TemporalModel('gemini-2.5-flash') — every model call inside the Workflow becomes a retryable, observable Activity, while the surrounding ADK agent loop replays deterministically.

Hierarchy

  • BaseLlm

    TemporalModel

Constructors

constructor

new TemporalModel(model, options?): TemporalModel

Parameters

NameTypeDescription
modelstringA model name registered in the ADK LLMRegistry (or resolvable by a custom modelProvider on the plugin).
options?TemporalModelOptionsPer-model Activity configuration.

Returns

TemporalModel

Overrides

BaseLlm.constructor

Properties

[BASE_MODEL_SYMBOL]

Readonly [BASE_MODEL_SYMBOL]: true

A unique symbol to identify BaseLlm classes.

Inherited from

BaseLlm.[BASE_MODEL_SYMBOL]


model

Readonly model: string

Inherited from

BaseLlm.model


supportedModels

Static Readonly supportedModels: (string | RegExp)[]

List of supported models in regex for LlmRegistry.

Inherited from

BaseLlm.supportedModels

Methods

connect

connect(llmRequest): Promise<BaseLlmConnection>

Live bidirectional (BIDI) connections are not supported inside a Workflow — a long-lived two-way stream does not map onto the request/response Activity boundary. Outside a Workflow this delegates to the real model.

Parameters

NameType
llmRequestLlmRequest

Returns

Promise<BaseLlmConnection>

Overrides

BaseLlm.connect


generateContentAsync

generateContentAsync(llmRequest, stream?, abortSignal?): AsyncGenerator<LlmResponse, void, unknown>

Generates content for llmRequest. Inside a Workflow this proxies the model Activity; outside a Workflow it delegates to the real registered model so the same object is usable in non-Temporal contexts.

Parameters

NameType
llmRequestLlmRequest
stream?boolean
abortSignal?AbortSignal

Returns

AsyncGenerator<LlmResponse, void, unknown>

Overrides

BaseLlm.generateContentAsync


maybeAppendUserContent

maybeAppendUserContent(llmRequest): void

Appends a user content, so that model can continue to output.

Parameters

NameTypeDescription
llmRequestLlmRequestLlmRequest, the request to send to the LLM.

Returns

void

Inherited from

BaseLlm.maybeAppendUserContent