Skip to content

Commit 4dfb379

Browse files
marklyszeyiranwu0
andauthored
Moved TextMessageCompressor's cache parameter initialisation to within __init__ (#68)
Co-authored-by: Yiran Wu <[email protected]>
1 parent 6b7913c commit 4dfb379

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

autogen/agentchat/contrib/capabilities/transforms.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def __init__(
325325
text_compressor: Optional[TextCompressor] = None,
326326
min_tokens: Optional[int] = None,
327327
compression_params: Dict = dict(),
328-
cache: Optional[AbstractCache] = Cache.disk(),
328+
cache: Optional[AbstractCache] = None,
329329
filter_dict: Optional[Dict] = None,
330330
exclude_filter: bool = True,
331331
):
@@ -355,7 +355,11 @@ def __init__(
355355
self._compression_args = compression_params
356356
self._filter_dict = filter_dict
357357
self._exclude_filter = exclude_filter
358-
self._cache = cache
358+
359+
if cache is None:
360+
self._cache = Cache.disk()
361+
else:
362+
self._cache = cache
359363

360364
# Optimizing savings calculations to optimize log generation
361365
self._recent_tokens_savings = 0

0 commit comments

Comments
 (0)