airflow.providers.common.ai.durable.caching_model¶
Caching model wrapper for durable execution.
Attributes¶
Classes¶
Wraps a model to cache responses in ObjectStorage for durable execution. |
Module Contents¶
- class airflow.providers.common.ai.durable.caching_model.CachingModel(wrapped, *, storage, counter)[source]¶
Bases:
pydantic_ai.models.wrapper.WrapperModelWraps a model to cache responses in ObjectStorage for durable execution.
On each
request()call, checks if a cached response exists for the current step index. If so, returns the cached response without calling the underlying model. Otherwise, calls the model and caches the response.