caikit.core.registries ====================== .. py:module:: caikit.core.registries .. autoapi-nested-parse:: Single spot for all global shared state access This should not import anything else from caikit outside the toolkit error handler, many parts of caikit need to access this state so that would easily cause an import cycle. Attributes ---------- .. autoapisummary:: caikit.core.registries.log caikit.core.registries.error caikit.core.registries.MODULE_REGISTRY caikit.core.registries.MODULE_BACKEND_REGISTRY caikit.core.registries.MODULE_BACKEND_TYPES caikit.core.registries.MODULE_BACKEND_CLASSES Classes ------- .. autoapisummary:: caikit.core.registries._AttrAccessBackendDict Functions --------- .. autoapisummary:: caikit.core.registries.module_registry caikit.core.registries.module_backend_registry caikit.core.registries.module_backend_types caikit.core.registries.module_backend_classes Module Contents --------------- .. py:data:: log .. py:data:: error .. py:data:: MODULE_REGISTRY .. py:data:: MODULE_BACKEND_REGISTRY .. py:function:: module_registry() -> Dict[str, caikit.core.ModuleBase] 🌶️🌶️🌶️ This returns global state that should only be mutated if you know what you're doing! Returns the dictionary of decorated @modules that have been imported. Used to map module IDs to the concrete class implementations to load and run. Structure is Dict[ module_id, module_class ] Returns: Dict[str, caikit.core.ModuleBase]: The module registry .. py:function:: module_backend_registry() -> Dict[str, Dict[str, Tuple[caikit.core.ModuleBase, Dict]]] 🌶️🌶️🌶️ This returns global state that should only be mutated if you know what you're doing! Returns the module backend registry. This adds more nesting to the module registry, providing a dictionary of backend type name -> (backend module impl class, config dict) Structure is Dict[ module_id, Dict[ backend_type, Tuple[ backend_impl_class, backend_config_dict ] ] ] Returns: Dict[str, Dict[str, Tuple["caikit.core.ModuleBase", Dict]]]: The module backend registry .. py:class:: _AttrAccessBackendDict Bases: :py:obj:`dict` Simple extension on a dict that allows attribute access in addition to index lookup .. py:method:: __getattr__(name: str) -> Any Alias to index lookup .. py:data:: MODULE_BACKEND_TYPES .. py:function:: module_backend_types() -> Dict[str, str] 🌶️🌶️🌶️ This returns global state that should only be mutated if you know what you're doing! Returns the "enum" of module backend types. This is a dict where the keys and values are identical, and each are the string names of a backend type. Returns: Dict[str, str]: The module backend type enum .. py:data:: MODULE_BACKEND_CLASSES :type: Dict[str, Type[caikit.core.BackendBase]] .. py:function:: module_backend_classes() -> Dict[str, Type[caikit.core.BackendBase]] 🌶️🌶️🌶️ This returns global state that should only be mutated if you know what you're doing! Returns the mapping of backend type name to concrete backend class Returns: Dict[str, Type["caikit.core.BackendBase"]]: The module backend class registry