@java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < topCandidates_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, topCandidates_.get(i));
    }
    for (int i = 0; i < chosenCandidates_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, chosenCandidates_.get(i));
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }
<pre>
Length = total number of decoding steps.
The chosen candidates may or may not be in top_candidates.
</pre>

<code>repeated .google.cloud.vertexai.v1.LogprobsResult.Candidate chosen_candidates = 2;</code>
java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/LogprobsResult.java