diff --git a/workflowai/core/client/_types.py b/workflowai/core/client/_types.py index 29322b5..43db6d7 100644 --- a/workflowai/core/client/_types.py +++ b/workflowai/core/client/_types.py @@ -176,7 +176,12 @@ async def run( defined in the task is used. Defaults to None. stream (bool, optional): whether to stream the output. If True, the function returns an async iterator of partial output objects. Defaults to False. - use_cache (CacheUsage, optional): how to use the cache. Defaults to "when_available". + use_cache (CacheUsage, optional): how to use the cache. Defaults to "auto". + "auto" (default): if a previous run exists with the same version and input, and if + the temperature is 0, the cached output is returned + "always": the cached output is returned when available, regardless + of the temperature value + "never": the cache is never used labels (Optional[set[str]], optional): a set of labels to attach to the run. Labels are indexed and searchable. Defaults to None. metadata (Optional[dict[str, Any]], optional): a dictionary of metadata to attach to the run. diff --git a/workflowai/core/domain/cache_usage.py b/workflowai/core/domain/cache_usage.py index 3542837..01f4a25 100644 --- a/workflowai/core/domain/cache_usage.py +++ b/workflowai/core/domain/cache_usage.py @@ -1,3 +1,3 @@ from typing import Literal -CacheUsage = Literal["only", "never", "when_available"] +CacheUsage = Literal["always", "never", "auto"]