code: def is_new_session(handler_input):
      # type: (HandlerInput) -> bool
      
      session = handler_input.request_envelope.session
  
      if session is not None:
          return session.new
  
      raise TypeError("The provided request doesn't have a session")
docs: Return if the session is new for the input request.
  
      The method retrieves the ``new`` value from the input request's
      session, which indicates if it's a new session or not. The
      :py:class:`ask_sdk_model.session.Session` is only included on all
      standard requests except ``AudioPlayer``, ``VideoApp`` and
      ``PlaybackController`` requests. More information can be found here :
      https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#session-object
  
      A :py:class:`TypeError` is raised if the input request doesn't have
      the ``session`` information.
  
      :param handler_input: The handler input instance that is generally
          passed in the sdk's request and exception components
      :type handler_input: ask_sdk_core.handler_input.HandlerInput
      :return: Boolean if the session is new for the input request
      :rtype: bool
      :raises: TypeError if the input request doesn't have a session