airflow.providers.common.ai.durable.fingerprint

Request fingerprints for durable replay verification.

Durable caching keys steps positionally (model_step_{N} / tool_step_{N}). Position alone cannot tell whether a cached entry still corresponds to the current request: if the prompt, model, toolset, or message history changed between the failed attempt and the retry, replaying by position would feed the agent responses recorded for a different conversation.

Each cache entry therefore stores a fingerprint of the request that produced it. On a cache hit the stored fingerprint is compared against the current request; a mismatch is treated as a cache miss and the step re-runs live. A divergence invalidates downstream steps too: a fresh model response carries newly generated tool_call_id values, which are part of the tool fingerprint, so stale tool results recorded under the old conversation no longer match.

Fields that pydantic-ai regenerates on every attempt (message-level timestamp/run_id/conversation_id and part-level timestamp) are excluded from the fingerprint. Requests that cannot be serialized to JSON fingerprint as None, which degrades that step to unverified positional replay (the pre-fingerprint behavior) rather than disabling caching.

Attributes

log

Functions

fingerprint_model_request(model_identifier, messages, ...)

Fingerprint a model request: model identity, message history, settings, and request parameters.

fingerprint_tool_call(name, tool_args, tool_call_id)

Fingerprint a tool call: tool name, arguments, and the model-issued call id.

Module Contents

airflow.providers.common.ai.durable.fingerprint.log[source]
airflow.providers.common.ai.durable.fingerprint.fingerprint_model_request(model_identifier, messages, model_settings, model_request_parameters)[source]

Fingerprint a model request: model identity, message history, settings, and request parameters.

The full ModelRequestParameters object is hashed (tool definitions, output mode and schema, native tools, …) so any change to what is sent to the model invalidates the cached response.

Returns None when the request cannot be serialized; None compares equal to None, so requests that cannot be fingerprinted degrade to unverified positional replay rather than disabling caching.

airflow.providers.common.ai.durable.fingerprint.fingerprint_tool_call(name, tool_args, tool_call_id)[source]

Fingerprint a tool call: tool name, arguments, and the model-issued call id.

tool_call_id round-trips through the model-response cache, so it is stable under faithful replay but regenerated whenever a live model call replaces a cached response – chaining invalidation to downstream tool steps.

Was this entry helpful?