TypedCandidate

public final class TypedCandidate<T extends Object>


A piece of a response from the model. Contains the FinishReason in addition to the response object of the desired class type.

Summary

Nested types

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

The reason why this TypedCandidate is returned.

Public methods

final Integer

the reason why this TypedCandidate is finished generating.

final T

the response object of the desired class type.

Public methods

getFinishReason

public final Integer getFinishReason()

the reason why this TypedCandidate is finished generating.

getResponse

public final T getResponse()

the response object of the desired class type. This is null if the response cannot be parsed to the desired class.