GenerateContentResponse

class GenerateContentResponse


Represents a response from the model.

Summary

Public constructors

GenerateContentResponse(
    candidates: List<Candidate>,
    promptFeedback: PromptFeedback?,
    usageMetadata: UsageMetadata?
)

Public properties

List<Candidate>

a list of possible responses generated from the model

List<FunctionCallPart>

Convenience field to get all the function call parts in the request, if they exist

FunctionResponsePart?

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

PromptFeedback?

optional feedback for the given prompt.

String?

Convenience field representing all the text parts in the response, if they exists.

UsageMetadata?

Public constructors

GenerateContentResponse

GenerateContentResponse(
    candidates: List<Candidate>,
    promptFeedback: PromptFeedback?,
    usageMetadata: UsageMetadata?
)

Public properties

candidates

val candidatesList<Candidate>

a list of possible responses generated from the model

functionCalls

val functionCallsList<FunctionCallPart>

Convenience field to get all the function call parts in the request, if they exist

functionResponse

val functionResponseFunctionResponsePart?

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

promptFeedback

val promptFeedbackPromptFeedback?

optional feedback for the given prompt. When streaming, it's only populated in the first response.

text

val textString?

Convenience field representing all the text parts in the response, if they exists.

usageMetadata

val usageMetadataUsageMetadata?