class_docstr: :obj:`Text` defines API specification for the inputs/outputs of a Service. :obj:`Text`
  represents strings for all incoming requests/outcoming responses as specified in
  your API function signature.
  
  A sample GPT2 service implementation:
  
  .. code-block:: python
     :caption: `service.py`
  
     from __future__ import annotations
  
     import bentoml
     from bentoml.io import Text
  
     runner = bentoml.tensorflow.get('gpt2:latest').to_runner()
  
     svc = bentoml.Service("gpt2-generation", runners=[runner])
  
     @svc.api(input=Text(), output=Text())
     def predict(text: str) -> str:
         res = runner.run(text)
         return res['generated_text']
  
  Users then can then serve this service with :code:`bentoml serve`:
  
  .. code-block:: bash
  
     % bentoml serve ./service.py:svc --reload
  
  Users can then send requests to the newly started services with any client:
  
  .. tab-set::
  
      .. tab-item:: Bash
  
         .. code-block:: bash
  
            % curl -X POST -H "Content-Type: text/plain" \
                    --data 'Not for nothing did Orin say that people outdoors.' \
                    http://0.0.0.0:3000/predict
  
      .. tab-item:: Python
  
         .. code-block:: python
            :caption: `request.py`
  
            import requests
            requests.post(
                "http://0.0.0.0:3000/predict",
                headers = {"content-type":"text/plain"},
                data = 'Not for nothing did Orin say that people outdoors.'
            ).text
  
  .. note::
  
      :obj:`Text` is not designed to take any ``args`` or ``kwargs`` during initialization.
  
  Returns:
      :obj:`Text`: IO Descriptor that represents strings type.
code: def __init__(
      self,
      content_type: t.Literal[
          "text/plain", "text/event-stream"
      ] = "text/plain",
  ):
      self._mime_type = content_type
  
imports: from __future__ import annotations
  import typing
  from starlette.requests import Request
  from starlette.responses import StreamingResponse
  from ..service.openapi import SUCCESS_DESCRIPTION
  from ..service.openapi.specification import MediaType
  from ..service.openapi.specification import Schema
  from ..utils.http import set_cookies
  from ..utils.lazy_loader import LazyLoader
  from .base import IODescriptor
label_desc: Use image node_id 1 to create a new Text object from inherited base classes: IODescriptor with example: obj = Text(content_type)