cache
autogen.cache.AbstractCache
AbstractCache
This protocol defines the basic interface for cache operations. Implementing classes should provide concrete implementations for these methods to handle caching mechanisms.
Parameters:Name | Description |
---|---|
*args | |
**kwargs |
Instance Methods
close
Close the cache. Perform any necessary cleanup, such as closing network connections or releasing resources.
get
Retrieve an item from the cache.
Parameters:Name | Description |
---|---|
key | The key identifying the item in the cache. Type: str |
default | The default value to return if the key is not found. Defaults to None. Type: Any | None Default: None |
Type | Description |
---|---|
Any | None | The value associated with the key if found, else the default value. |
set
Set an item in the cache.
Parameters:Name | Description |
---|---|
key | The key under which the item is to be stored. Type: str |
value | The value to be stored in the cache. Type: Any |