def expose(inputs: Dict[str, BaseType], outputs: Dict[str, BaseType]):
    """Expose a function/method via a web API for serving model inference.

    The ``@expose`` decorator has two arguments, inputs and outputs, which
    describe how the inputs to predict are decoded from the request and how
    the outputs of predict are encoded to a response.

    Must decorate one (and only one) method when used within a subclass
    of ``ModelComponent``.

    Parameters
    ----------
    inputs
        accepts a dictionary mapping keys to decorated method parameter
        names (must be one to one mapping) with values corresponding to
        an instantiated specification of a Flash Serve Data Type (ie.
        ``Number()``, ``Image()``, ``Text()``, etc...)
    outputs
        accepts a dictionary mapping outputs of the decorated method to
        keys and data type (similar to inputs). However, unlike ``inputs``
        the output keys are less strict in their names. IF the method
        returns a dictionary, the keys must match one-to-one. However, if
        the method returns a sorted sequence (list / tuple) the keys can be
        arbitrary, so long as no reserved names are used (primarily python
        keywords). For result sequences, the order in which keys are defined
        maps to the appropriate element index in the result (ie.
        ``key 0 -> sequence[0]``, ``key 1 -> sequence[1]``, etc.)

    TODO
    ----
    *  Examples in the docstring.

    """
    _validate_expose_inputs_outputs_args(inputs)
    _validate_expose_inputs_outputs_args(outputs)

    def wrapper(fn):
        @wraps(fn)
        def wrapped(func):
            func.flashserve_meta = UnboundMeta(exposed=func, inputs=inputs, outputs=outputs)
            return func

        return wrapped(fn)

    return wrapper
Expose a function/method via a web API for serving model inference.

    The ``@expose`` decorator has two arguments, inputs and outputs, which
    describe how the inputs to predict are decoded from the request and how
    the outputs of predict are encoded to a response.

    Must decorate one (and only one) method when used within a subclass
    of ``ModelComponent``.

    Parameters
    ----------
    inputs
        accepts a dictionary mapping keys to decorated method parameter
        names (must be one to one mapping) with values corresponding to
        an instantiated specification of a Flash Serve Data Type (ie.
        ``Number()``, ``Image()``, ``Text()``, etc...)
    outputs
        accepts a dictionary mapping outputs of the decorated method to
        keys and data type (similar to inputs). However, unlike ``inputs``
        the output keys are less strict in their names. IF the method
        returns a dictionary, the keys must match one-to-one. However, if
        the method returns a sorted sequence (list / tuple) the keys can be
        arbitrary, so long as no reserved names are used (primarily python
        keywords). For result sequences, the order in which keys are defined
        maps to the appropriate element index in the result (ie.
        ``key 0 -> sequence[0]``, ``key 1 -> sequence[1]``, etc.)

    TODO
    ----
    *  Examples in the docstring.

    
src/flash/core/serve/decorators.py