caikit.runtime.names ==================== .. py:module:: caikit.runtime.names .. autoapi-nested-parse:: ! NOTE ! This file should not import any extra dependencies. It is intended for use by client libraries that do not necessarily use a specific runtime server type. Attributes ---------- .. autoapisummary:: caikit.runtime.names.log caikit.runtime.names.LOCAL_MODEL_TYPE caikit.runtime.names.DEFAULT_LOADER_NAME caikit.runtime.names.DEFAULT_SIZER_NAME caikit.runtime.names.TRAINING_MANAGEMENT_SERVICE_NAME caikit.runtime.names.TRAINING_MANAGEMENT_SERVICE_PACKAGE caikit.runtime.names.TRAINING_MANAGEMENT_SERVICE_SPEC caikit.runtime.names.INFO_SERVICE_NAME caikit.runtime.names.INFO_SERVICE_PACKAGE caikit.runtime.names.INFO_SERVICE_SPEC caikit.runtime.names.MODEL_MANAGEMENT_SERVICE_NAME caikit.runtime.names.MODEL_MANAGEMENT_SERVICE_PACKAGE caikit.runtime.names.MODEL_MANAGEMENT_SERVICE_SPEC caikit.runtime.names.MODEL_MESH_MODEL_ID_KEY caikit.runtime.names.HEALTH_ENDPOINT caikit.runtime.names.INFO_ENDPOINT caikit.runtime.names.RUNTIME_INFO_ENDPOINT caikit.runtime.names.MODELS_INFO_ENDPOINT caikit.runtime.names.MANAGEMENT_ENDPOINT caikit.runtime.names.MODEL_MANAGEMENT_ENDPOINT caikit.runtime.names.TRAINING_MANAGEMENT_ENDPOINT caikit.runtime.names.REQUIRED_INPUTS_KEY caikit.runtime.names.OPTIONAL_INPUTS_KEY caikit.runtime.names.MODEL_ID caikit.runtime.names.EXTRA_OPENAPI_KEY caikit.runtime.names.ACK_HEADER_STRING caikit.runtime.names.STATUS_CODE_TO_HTTP caikit.runtime.names.HTTP_TO_STATUS_CODE caikit.runtime.names.CAIKIT_STATUS_CODE_TO_GRPC Classes ------- .. autoapisummary:: caikit.runtime.names.ServiceType caikit.runtime.names.StreamEventTypes Functions --------- .. autoapisummary:: caikit.runtime.names.get_ai_domain caikit.runtime.names.get_service_package_name caikit.runtime.names.get_service_name caikit.runtime.names.get_train_rpc_name caikit.runtime.names.get_task_predict_rpc_name caikit.runtime.names.get_task_predict_job_rpc_name caikit.runtime.names.get_task_predict_job_status_rpc_name caikit.runtime.names.get_task_predict_job_cancel_rpc_name caikit.runtime.names.get_task_predict_job_result_rpc_name caikit.runtime.names.get_train_request_name caikit.runtime.names.get_train_parameter_name caikit.runtime.names.get_task_predict_request_name caikit.runtime.names.get_http_route_name caikit.runtime.names.get_http_prediction_job_route_name caikit.runtime.names.get_http_prediction_job_result_route_name caikit.runtime.names.get_grpc_route_name Module Contents --------------- .. py:data:: log .. py:data:: LOCAL_MODEL_TYPE :value: 'standalone-model' .. py:data:: DEFAULT_LOADER_NAME :value: 'default' .. py:data:: DEFAULT_SIZER_NAME :value: 'default' .. py:class:: ServiceType(*args, **kwds) Bases: :py:obj:`enum.Enum` Common class for describing service types .. py:attribute:: INFERENCE :value: 1 .. py:attribute:: TRAINING :value: 2 .. py:attribute:: TRAINING_MANAGEMENT :value: 3 .. py:attribute:: INFO :value: 4 .. py:attribute:: MODEL_MANAGEMENT :value: 5 .. py:attribute:: JOB_INFERENCE :value: 6 .. py:function:: get_ai_domain() -> str Get the string name for the AI domain Returns: domain(str): The domain for this service .. py:function:: get_service_package_name(service_type: Optional[ServiceType] = None) -> str This helper will get the name of service package Args: service_type Optional[ServiceType]: The Service Type's package name to fetch defaults to runtime Returns: str: The name of the service package .. py:function:: get_service_name(service_type: ServiceType) -> str This helper will get the name of the service Args: service_type ServiceType: The Service Type whose name to fetch Returns: str: The name of the service .. py:function:: get_train_rpc_name(module_class: Type[caikit.core.modules.ModuleBase]) -> str Helper function to convert from the name of a module to the name of the request RPC function .. py:function:: get_task_predict_rpc_name(task_or_module_class: Type[Union[caikit.core.modules.ModuleBase, caikit.core.task.TaskBase]], input_streaming: bool = False, output_streaming: bool = False) -> str Helper function to get the name of a task's RPC .. py:function:: get_task_predict_job_rpc_name(task_or_module_class: Type[Union[caikit.core.modules.ModuleBase, caikit.core.task.TaskBase]]) -> str Helper function to get the name of a task's start job RPC .. py:function:: get_task_predict_job_status_rpc_name(task_or_module_class: Type[Union[caikit.core.modules.ModuleBase, caikit.core.task.TaskBase]]) -> str Helper function to get the name of a task's job status RPC .. py:function:: get_task_predict_job_cancel_rpc_name(task_or_module_class: Type[Union[caikit.core.modules.ModuleBase, caikit.core.task.TaskBase]]) -> str Helper function to get the name of a task's job cancel RPC .. py:function:: get_task_predict_job_result_rpc_name(task_or_module_class: Type[Union[caikit.core.modules.ModuleBase, caikit.core.task.TaskBase]]) -> str Helper function to get the name of a task's job resul RPC .. py:function:: get_train_request_name(module_class: Type[caikit.core.modules.ModuleBase]) -> str Helper function to get the request name of a Train Service .. py:function:: get_train_parameter_name(module_class: Type[caikit.core.modules.ModuleBase]) -> str Helper function to get the inner request parameter name of a Train Service .. py:function:: get_task_predict_request_name(task_or_module_class: Type[Union[caikit.core.modules.ModuleBase, caikit.core.task.TaskBase]], input_streaming: bool = False, output_streaming: bool = False) -> str Helper function to get the name of an RPC's request data type .. py:data:: TRAINING_MANAGEMENT_SERVICE_NAME :value: 'TrainingManagement' .. py:data:: TRAINING_MANAGEMENT_SERVICE_PACKAGE :value: 'caikit.runtime.training' .. py:data:: TRAINING_MANAGEMENT_SERVICE_SPEC .. py:data:: INFO_SERVICE_NAME :value: 'InfoService' .. py:data:: INFO_SERVICE_PACKAGE :value: 'caikit.runtime.info' .. py:data:: INFO_SERVICE_SPEC .. py:data:: MODEL_MANAGEMENT_SERVICE_NAME :value: 'ModelManagement' .. py:data:: MODEL_MANAGEMENT_SERVICE_PACKAGE :value: 'caikit.runtime.models' .. py:data:: MODEL_MANAGEMENT_SERVICE_SPEC .. py:data:: MODEL_MESH_MODEL_ID_KEY :value: 'mm-model-id' .. py:data:: HEALTH_ENDPOINT :value: '/health' .. py:data:: INFO_ENDPOINT :value: '/info' .. py:data:: RUNTIME_INFO_ENDPOINT :value: '/info/version' .. py:data:: MODELS_INFO_ENDPOINT :value: '/info/models' .. py:data:: MANAGEMENT_ENDPOINT :value: '/management' .. py:data:: MODEL_MANAGEMENT_ENDPOINT :value: '/management/models' .. py:data:: TRAINING_MANAGEMENT_ENDPOINT :value: '/management/trainings' .. py:data:: REQUIRED_INPUTS_KEY :value: 'inputs' .. py:data:: OPTIONAL_INPUTS_KEY :value: 'parameters' .. py:data:: MODEL_ID :value: 'model_id' .. py:data:: EXTRA_OPENAPI_KEY :value: 'extra_openapi' .. py:data:: ACK_HEADER_STRING :value: 'acknowledgement' .. py:class:: StreamEventTypes(*args, **kwds) Bases: :py:obj:`enum.Enum` Create a collection of name/value pairs. Example enumeration: >>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3 Access them by: - attribute access:: >>> Color.RED - value lookup: >>> Color(1) - name lookup: >>> Color['RED'] Enumerations can be iterated over, and know how many members they have: >>> len(Color) 3 >>> list(Color) [, , ] Methods can be added to enumerations, and members can have their own attributes -- see the documentation for details. .. py:attribute:: MESSAGE :value: 'message' .. py:attribute:: ERROR :value: 'error' .. py:function:: get_http_route_name(rpc_name: str) -> str Function to get the http route for a given rpc name Args: rpc_name (str): The name of the Caikit RPC Raises: NotImplementedError: If the RPC is not a Train or Predict RPC Returns: str: The name of the http route for RPC .. py:function:: get_http_prediction_job_route_name(rpc_name: str) -> str Function to get the http route for a prediction job given a rpc name Args: rpc_name (str): The name of the Caikit RPC Raises: NotImplementedError: If the RPC is not a Train or Predict RPC Returns: str: The name of the http route for RPC .. py:function:: get_http_prediction_job_result_route_name(rpc_name: str) -> str Function to get the http route for a prediction job result given a rpc name Args: rpc_name (str): The name of the Caikit RPC Raises: NotImplementedError: If the RPC is not a Train or Predict RPC Returns: str: The name of the http route for RPC .. py:function:: get_grpc_route_name(service_type: ServiceType, rpc_name: str) -> str Function to get GRPC name for a given service type and rpc name Args: rpc_name (str): The name of the Caikit RPC Returns: str: The name of the GRPC route for RPC .. py:data:: STATUS_CODE_TO_HTTP .. py:data:: HTTP_TO_STATUS_CODE .. py:data:: CAIKIT_STATUS_CODE_TO_GRPC