Skip to content

Update the cache settings in Py SDK #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion workflowai/core/client/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion workflowai/core/domain/cache_usage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from typing import Literal

CacheUsage = Literal["only", "never", "when_available"]
CacheUsage = Literal["always", "never", "auto"]
Loading