airflow.providers.common.ai.durable.storage¶
ObjectStorage-backed durable storage for pydantic-ai agent step caching.
Attributes¶
Classes¶
Stores step-level caches in a single JSON file on ObjectStorage. |
Module Contents¶
- class airflow.providers.common.ai.durable.storage.DurableStorage(*, dag_id, task_id, run_id, map_index=-1)[source]¶
Stores step-level caches in a single JSON file on ObjectStorage.
All step caches (model responses and tool results) are stored as entries in a single JSON blob, written to a file named after the task execution:
{base_path}/{dag_id}_{task_id}_{run_id}[_{map_index}].json.The file survives Airflow task retries since it lives outside the XCom system. It is deleted on successful task completion.
- Parameters:
- save_tool_result(key, result)[source]¶
Store a tool call result in the cache.
Non-serializable results (e.g. BinaryContent from MCP tools) are skipped with a warning – the tool call still succeeds, but won’t be replayed on retry.