Core#
Index
core.ExactMatchEvaluation#
core.cache_all#
core.first#
core.get_data_manager#
- Generate SSDataManager (with cache_base, vector_base, max_size, clean_size and eviction params),
or MAPDataManager (with data_path, max_size and get_data_container params) to manager the data.
- param cache_base
a CacheBase object, or the name of the cache storage, it is support âsqliteâ, âpostgresqlâ, âmysqlâ, âmariadbâ, âsqlserverâ and âoracleâ now.
- type cache_base
CacheBase
or str- param vector_base
a VectorBase object, or the name of the vector storage, it is support âmilvusâ, âfaissâ and âchromadbâ now.
- type vector_base
VectorBase
or str- param object_base
a object storage, supports local path and s3.
- type object_base
ObjectBase
or str- param max_size
the max size for the cache, defaults to 1000.
- type max_size
int
- param clean_size
the size to clean up, defaults to max_size * 0.2.
- type clean_size
int
- param eviction
the eviction policy, it is support âLRUâ and âFIFOâ now, and defaults to âLRUâ.
- type eviction
str
- param data_path
the path to save the map data, defaults to âdata_map.txtâ.
- type data_path
str
- param get_data_container
a Callable to get the data container, defaults to None.
- type get_data_container
Callable
- return
SSDataManager or MapDataManager.
Example
from gptcache.manager import get_data_manager, CacheBase, VectorBase
data_manager = get_data_manager(CacheBase('sqlite'), VectorBase('faiss', dimension=128))