GenerateContentResponse


public final class GenerateContentResponse


Represents a response from the model.

Summary

Public constructors

Public methods

final @NonNull List<@NonNull Candidate>

a list of possible responses generated from the model

final String

Convenience field representing the first text part in the response, if it exists.

Public constructors

GenerateContentResponse

@VisibleForTesting(otherwise = 3)
public GenerateContentResponse(@NonNull List<@NonNull Candidate> candidates)

Public methods

getCandidates

public final @NonNull List<@NonNull CandidategetCandidates()

a list of possible responses generated from the model

getText

public final String getText()

Convenience field representing the first text part in the response, if it exists.