AbstractCache
autogen.cache.AbstractCache #
Bases: Protocol
This protocol defines the basic interface for cache operations. Implementing classes should provide concrete implementations for these methods to handle caching mechanisms.
get #
Retrieve an item from the cache.
PARAMETER | DESCRIPTION |
---|---|
key | The key identifying the item in the cache. TYPE: |
default | The default value to return if the key is not found. Defaults to None. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[Any] | The value associated with the key if found, else the default value. |
Source code in autogen/cache/abstract_cache_base.py
set #
close #
Close the cache. Perform any necessary cleanup, such as closing network connections or releasing resources.