airflow.providers.common.ai.durable.base

Shared interface for durable execution storage backends.

Attributes

TOOL_RESULT_SENTINEL

DURABLE_KEY_PREFIX

Classes

DurableStorageProtocol

Persistence contract shared by the durable execution storage backends.

Functions

build_model_step_key(step)

Build the durable cache key for the model response produced at step.

build_tool_step_key(step)

Build the durable cache key for the tool result produced at step.

Module Contents

airflow.providers.common.ai.durable.base.TOOL_RESULT_SENTINEL = '__durable_cached__'[source]
airflow.providers.common.ai.durable.base.DURABLE_KEY_PREFIX = '__commonai_durable__'[source]
airflow.providers.common.ai.durable.base.build_model_step_key(step)[source]

Build the durable cache key for the model response produced at step.

airflow.providers.common.ai.durable.base.build_tool_step_key(step)[source]

Build the durable cache key for the tool result produced at step.

class airflow.providers.common.ai.durable.base.DurableStorageProtocol[source]

Bases: Protocol

Persistence contract shared by the durable execution storage backends.

Implemented by both DurableStorage (ObjectStorage, Airflow < 3.3) and TaskStateStoreDurableStorage (AIP-103 task state store, Airflow >= 3.3). CachingModel and CachingToolset depend on this interface, not a concrete backend.

Both save_* methods return whether the entry was written. A backend may skip a write (a tool result that is not JSON-serializable, a store write that fails) without failing the step; the step then re-runs live on retry, and the caller counts it as skipped rather than cached.

save_model_response(key, response, *, fingerprint)[source]
load_model_response(key)[source]
save_tool_result(key, result, *, fingerprint)[source]
load_tool_result(key)[source]
cleanup()[source]

Was this entry helpful?