Utils#

utils.cache_func#

utils.dependency_control#

gptcache.utils.dependency_control.prompt_install(package: str, warn: bool = False)[source]#

Function used to prompt user to install a package.

utils.error#

exception gptcache.utils.error.CacheError[source]#

GPTCache base error

exception gptcache.utils.error.NotFoundError(store_type, current_type_name)[source]#

Raise when getting an unsupported store.

exception gptcache.utils.error.NotInitError[source]#

Raise when the cache has been used before it’s inited

exception gptcache.utils.error.ParamError[source]#

Raise when receiving an invalid param.

exception gptcache.utils.error.PipInstallError(package)[source]#

Raise when failed to install package.

utils.importlib#

A pure Python implementation of import.

gptcache.utils.importlib.import_module(name, package=None)#

Import a module.

The ‘package’ argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import.

gptcache.utils.importlib.invalidate_caches()#

Call the invalidate_caches() method on all meta path finders stored in sys.meta_path (where implemented).

gptcache.utils.importlib.reload(module)#

Reload the module and return it.

The module must have been successfully imported before.

utils.lazy_import#

class gptcache.utils.lazy_import.LazyImport(local_name, parent_module_globals, name)[source]#

Lazily import a module.

utils.log#

utils.response#

utils.time#