def type_hints(self):
        """Fetch the output hints from serialize and input hints from deserialize."""

        input_types = get_type_hints(self.deserialize)
        input_types.pop("return", None)
        try:
            output_types = get_type_hints(self.serialize)["return"]
        except KeyError:  # pragma: no cover
            raise RuntimeError("Did you forget to type annotate " "the `serialize` method?")
        return {"output_args": output_types, "input_args": input_types}
Fetch the output hints from serialize and input hints from deserialize.
src/flash/core/serve/types/base.py