caikit.runtime.service_factory ============================== .. py:module:: caikit.runtime.service_factory .. autoapi-nested-parse:: This module is responsible for creating service objects for the runtime to consume Attributes ---------- .. autoapisummary:: caikit.runtime.service_factory.log caikit.runtime.service_factory.error Classes ------- .. autoapisummary:: caikit.runtime.service_factory.ServicePackage caikit.runtime.service_factory.ServicePackageFactory Functions --------- .. autoapisummary:: caikit.runtime.service_factory.get_inference_request caikit.runtime.service_factory.get_train_request caikit.runtime.service_factory.get_train_params Module Contents --------------- .. py:data:: log .. py:data:: error .. py:class:: ServicePackage Container with references to: - A service Class - A service Descriptor - A grpc servicer registration function - A client stub - A client messages module .. py:attribute:: service :type: Type[google.protobuf.service.Service] .. py:attribute:: descriptor :type: google.protobuf.descriptor.ServiceDescriptor .. py:attribute:: registration_function :type: Callable[[google.protobuf.service.Service, grpc.Server], None] .. py:attribute:: stub_class :type: Type .. py:attribute:: messages :type: types.ModuleType .. py:attribute:: caikit_rpcs :type: Dict[str, caikit.runtime.service_generation.rpcs.CaikitRPCBase] .. py:class:: ServicePackageFactory Factory responsible for yielding the correct concrete ServicePackage implementation .. py:attribute:: ServiceType .. py:method:: get_service_package(service_type: ServiceType, write_modules_file: bool = False) -> ServicePackage :classmethod: Public factory API. Returns a service package of the requested type, from the configured source. Args: service_type (ServicePackageFactory.ServiceType): The type of service to build, to match the servicer implementation that will handle it. e.g. the GlobalPredictServicer expects an "INFERENCE" service write_modules_file (bool): if set, write out a modules.json file to list the included modules in this service generation. See config to customize file name at runtime.service_generation.backwards_compatibility.current_modules_path Returns: ServicePackage: A container with properties referencing everything you need to bind a concrete Servicer implementation to a protobufs Service and grpc Server .. py:method:: _check_backwards_compatibility(caikit_config: aconfig.Config, clean_modules: Set[Type[caikit.core.ModuleBase]]) :staticmethod: .. py:method:: _get_and_filter_modules(caikit_config: aconfig.Config, lib: str, write_modules_file: bool) -> Set[Type[caikit.core.ModuleBase]] :staticmethod: .. py:function:: get_inference_request(task_or_module_class: Type[Union[caikit.core.ModuleBase, caikit.core.task.TaskBase]], input_streaming: bool = False, output_streaming: bool = False) -> Type[caikit.core.data_model.base.DataBase] Helper function to return the inference request DataModel for the Module or Task Class .. py:function:: get_train_request(module_class: Type[caikit.core.ModuleBase]) -> Type[caikit.core.data_model.base.DataBase] Helper function to return the train request DataModel for the Module Class .. py:function:: get_train_params(module_class: Type[caikit.core.ModuleBase]) -> Type[caikit.core.data_model.base.DataBase] Helper function to return the train parameters DataModel for the Module Class