docs: def streaming_callback(self, body_part):
      """Handles a streaming chunk of the response.
  
      The streaming_response callback gives no indication about whether the
      received chunk is the last in the stream. The "last_response" instance
      variable allows us to keep track of the last received chunk of the
      response. Each time this is called, the previous chunk is emitted. The
      done() method is expected to be called after the response completes to
      ensure that the last piece of data is sent.
  
      Args:
        body_part: A chunk of the streaming response.
      """
      b64_body_string = base64.b64encode(body_part).decode('utf-8')
  
      response = {
          'message_id': self._message_id,
          'data': b64_body_string,
      }
      if self._last_response is None:
        # This represents the first chunk of data to be streamed to the caller.
        # Attach status and header information to this item.
        response.update(self._generate_metadata_body())
      else:
        self._last_response['done'] = False
        self._write_message_func(self._last_response)
  
      self._last_response = response