Skip to content

Commit

Permalink
cache defaults to None
Browse files Browse the repository at this point in the history
  • Loading branch information
WaelKarkoub committed Oct 21, 2024
1 parent 76a4bd0 commit eb902de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autogen/agentchat/contrib/capabilities/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def __init__(
text_compressor: Optional[TextCompressor] = None,
min_tokens: Optional[int] = None,
compression_params: Dict = dict(),
cache: Optional[AbstractCache] = Cache.disk(),
cache: Optional[AbstractCache] = None,
filter_dict: Optional[Dict] = None,
exclude_filter: bool = True,
):
Expand Down Expand Up @@ -391,6 +391,7 @@ def apply_transform(self, messages: List[Dict]) -> List[Dict]:

cache_key = transforms_util.cache_key(message["content"], self._min_tokens)
cached_content = transforms_util.cache_content_get(self._cache, cache_key)

if cached_content is not None:
message["content"], savings = cached_content
else:
Expand Down

0 comments on commit eb902de

Please sign in to comment.