class_docstr: RequestBuilder for TF Serving RPC requests.
  
  There are three kinds of request the builder can make:
  -   ClassificationRequest
  -   RegressionRequest
  -   PredictRequest
  
  Types of request to build is determined by inspecting SavedModel and getting
  SignatureDef from it. What user can configure is the signature names to use.
  
  To build a ClassificationRequest or a RegressionRequest, logical format of
  the record should be TF_EXAMPLE.
  
  To build a PredictRequest, its corresponding SignatureDef should have a single
  input argument that accepts serialized record inputs. Its logical format does
  not matter as long as user have a correct parsing logic.
class_docstr_tok: ["RequestBuilder","for","TF","Serving","RPC","requests",".","There","are","three","kinds","of","request","the","builder","can","make",":","-","ClassificationRequest","-","RegressionRequest","-","PredictRequest","Types","of","request","to","build","is","determined","by","inspecting","SavedModel","and","getting","SignatureDef","from","it",".","What","user","can","configure","is","the","signature","names","to","use",".","To","build","a","ClassificationRequest","or","a","RegressionRequest",",","logical","format","of","the","record","should","be","TF_EXAMPLE",".","To","build","a","PredictRequest",",","its","corresponding","SignatureDef","should","have","a","single","input","argument","that","accepts","serialized","record","inputs",".","Its","logical","format","does","not","matter","as","long","as","user","have","a","correct","parsing","logic","."]
docstr: Gets key for SignatureDef input that consumes serialized record.
  
  To build a PredictRequest, SignatureDef inputs should have a single input
  argument that accepts serialized record inputs. The input TensorSpec should
  have dtype=DT_STRING and shape=TensorShape([None]).
  
  Args:
    signature_def: A SignatureDef proto message.
  
  Returns:
    An input key for the serialized input.
docstr_tok: ["Gets","key","for","SignatureDef","input","that","consumes","serialized","record",".","To","build","a","PredictRequest",",","SignatureDef","inputs","should","have","a","single","input","argument","that","accepts","serialized","record","inputs",".","The","input","TensorSpec","should","have","dtype=DT_STRING","and","shape=TensorShape","(","[","None","]",")",".","Args",":","signature_def",":","A","SignatureDef","proto","message",".","Returns",":","An","input","key","for","the","serialized","input","."]
code: def _GetSerializedInputKey(self, signature_def: _SignatureDef):
      """Gets key for SignatureDef input that consumes serialized record.
  
      To build a PredictRequest, SignatureDef inputs should have a single input
      argument that accepts serialized record inputs. The input TensorSpec should
      have dtype=DT_STRING and shape=TensorShape([None]).
  
      Args:
        signature_def: A SignatureDef proto message.
  
      Returns:
        An input key for the serialized input.
      """
      signature_input_keys = list(signature_def.inputs.keys())
      if len(signature_input_keys) == 1:
          input_key = signature_input_keys[0]
          input_spec = signature_def.inputs[input_key]
          if (
              input_spec.dtype == tf.dtypes.string.as_datatype_enum
              and input_spec.tensor_shape
              == tf.TensorShape([None]).as_proto()
          ):
              return input_key
      # TODO(b/151697719): General Predict method signature support.
      raise ValueError(
          "Unable to find valid input key from SignatureDef. In order to make "
          "PredictRequest, model should define signature that accepts serialized "
          "record inputs, i.e. signature with single input whose dtype=DT_STRING "
          "and shape=TensorShape([None])."
      )
  
imports: import abc
  import os
  from typing import Any, Iterable, List, Mapping, Optional
  from absl import logging
  import tensorflow
  from tfx import types
  from tfx.components.infra_validator import types
  from tfx.components.util import examples_utils
  from tfx.components.util import tfxio_utils
  from tfx.dsl.io import fileio
  from tfx.proto import example_gen_pb2
  from tfx.proto import infra_validator_pb2
  from tfx.types import artifact_utils
  from tfx.utils import path_utils
  from tfx_bsl.tfxio import dataset_options
  from tensorflow.python.saved_model import loader_impl
  from tensorflow_serving.apis import classification_pb2
  from tensorflow_serving.apis import predict_pb2
  from tensorflow_serving.apis import regression_pb2
label_desc: Use image node_id 4 for calling the _TFServingRpcRequestBuilder obj's underlying member method code with example usage: obj._GetSerializedInputKey(signature_def) and returns: input_key