Skip to content

Commit 327ea7a

Browse files
x5asiddicky
authored andcommitted
fix truncation logic (anthropics#177)
1 parent b81a9eb commit 327ea7a

File tree

1 file changed

+3
-3
lines changed
  • computer-use-demo/computer_use_demo

1 file changed

+3
-3
lines changed

computer-use-demo/computer_use_demo/loop.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ async def sampling_loop(
113113
if enable_prompt_caching:
114114
betas.append(PROMPT_CACHING_BETA_FLAG)
115115
_inject_prompt_caching(messages)
116-
# Is it ever worth it to bust the cache with prompt caching?
117-
if image_truncation_threshold:
118-
image_truncation_threshold = 0
116+
# Because cached reads are 10% of the price, we don't think it's
117+
# ever sensible to break the cache by truncating images
118+
only_n_most_recent_images = 0
119119
system["cache_control"] = {"type": "ephemeral"}
120120

121121
if only_n_most_recent_images:

0 commit comments

Comments
 (0)