public ResponseStream<GenerateContentResponse> sendMessageStream(Content content)
      throws IOException {
    checkLastResponseAndEditHistory();
    history.add(content);

    ResponseStream<GenerateContentResponse> respStream;
    try {
      respStream = model.generateContentStream(history);
    } catch (IOException e) {
      // If the API call fails, revert the history before throwing.
      revertHistory();
      throw e;
    }
    setCurrentResponseStream(Optional.of(respStream));

    // TODO(jayceeli) enable AFC in sendMessageStream
    return respStream;
  }
Sends a message to the model and returns a stream of responses.

@param content the content to be sent.
@return an iterable in which each element is a GenerateContentResponse. Can be converted to
    stream by stream() method.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/ChatSession.java