@Override
  public boolean hasNext() {
    boolean hasNextResponse = serverStreamIterator.hasNext();
    consumed = !hasNextResponse;
    return hasNextResponse;
  }
Iterator of the ResponseStream that holds the response chunks.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/ResponseStreamIteratorWithHistory.java