Package com.google.genkit.ai
Class Candidate
java.lang.Object
com.google.genkit.ai.Candidate
Candidate represents a single model response candidate.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetIndex()voidvoidsetFinishMessage(String finishMessage) voidsetFinishReason(FinishReason finishReason) voidsetIndex(int index) voidsetMessage(Message message) text()Extracts the text content from this candidate.
-
Constructor Details
-
Candidate
public Candidate()Default constructor. -
Candidate
Creates a Candidate with a message.- Parameters:
message- the candidate message
-
Candidate
Creates a Candidate with message and finish reason.- Parameters:
message- the candidate messagefinishReason- the finish reason
-
-
Method Details
-
getIndex
public int getIndex() -
setIndex
public void setIndex(int index) -
getMessage
-
setMessage
-
getFinishReason
-
setFinishReason
-
getFinishMessage
-
setFinishMessage
-
getCustom
-
setCustom
-
text
Extracts the text content from this candidate.- Returns:
- the concatenated text content
-