Candidate

public final class Candidate


A piece of a response from the model. Contains the FinishReason in addition to the response text String of the response.

Summary

Nested types

@IntDef(value = [0, 1, -100])
public annotation Candidate.FinishReason

The reason why this Candidate is returned.

Public methods

final Integer

the reason why this Candidate is finished generating.

final @NonNull String

the text string of the Candidate.

Public methods

getFinishReason

public final Integer getFinishReason()

the reason why this Candidate is finished generating. This will be null for intermediate responses during streaming, and non-null for the final response in streaming or non-streaming mode.

getText

public final @NonNull String getText()

the text string of the Candidate.