Class GenerateContentResponse (1.11.0)

publicfinalclass GenerateContentResponseextendsGeneratedMessageV3implementsGenerateContentResponseOrBuilder

Response message for [PredictionService.GenerateContent].

Protobuf type google.cloud.vertexai.v1.GenerateContentResponse

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

CANDIDATES_FIELD_NUMBER

publicstaticfinalintCANDIDATES_FIELD_NUMBER
Field Value
Type Description
int

PROMPT_FEEDBACK_FIELD_NUMBER

publicstaticfinalintPROMPT_FEEDBACK_FIELD_NUMBER
Field Value
Type Description
int

USAGE_METADATA_FIELD_NUMBER

publicstaticfinalintUSAGE_METADATA_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticGenerateContentResponsegetDefaultInstance()
Returns
Type Description
GenerateContentResponse

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticGenerateContentResponse.BuildernewBuilder()
Returns
Type Description
GenerateContentResponse.Builder

newBuilder(GenerateContentResponse prototype)

publicstaticGenerateContentResponse.BuildernewBuilder(GenerateContentResponseprototype)
Parameter
Name Description
prototype GenerateContentResponse
Returns
Type Description
GenerateContentResponse.Builder

parseDelimitedFrom(InputStream input)

publicstaticGenerateContentResponseparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticGenerateContentResponseparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticGenerateContentResponseparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticGenerateContentResponseparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticGenerateContentResponseparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticGenerateContentResponseparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticGenerateContentResponseparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticGenerateContentResponseparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticGenerateContentResponseparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticGenerateContentResponseparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticGenerateContentResponseparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticGenerateContentResponseparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<GenerateContentResponse>parser()
Returns
Type Description
Parser<GenerateContentResponse>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCandidates(int index)

publicCandidategetCandidates(intindex)

Output only. Generated candidates.

repeated .google.cloud.vertexai.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
Candidate

getCandidatesCount()

publicintgetCandidatesCount()

Output only. Generated candidates.

repeated .google.cloud.vertexai.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getCandidatesList()

publicList<Candidate>getCandidatesList()

Output only. Generated candidates.

repeated .google.cloud.vertexai.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Candidate>

getCandidatesOrBuilder(int index)

publicCandidateOrBuildergetCandidatesOrBuilder(intindex)

Output only. Generated candidates.

repeated .google.cloud.vertexai.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
CandidateOrBuilder

getCandidatesOrBuilderList()

publicList<?extendsCandidateOrBuilder>getCandidatesOrBuilderList()

Output only. Generated candidates.

repeated .google.cloud.vertexai.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.vertexai.api.CandidateOrBuilder>

getDefaultInstanceForType()

publicGenerateContentResponsegetDefaultInstanceForType()
Returns
Type Description
GenerateContentResponse

getParserForType()

publicParser<GenerateContentResponse>getParserForType()
Returns
Type Description
Parser<GenerateContentResponse>
Overrides

getPromptFeedback()

publicGenerateContentResponse.PromptFeedbackgetPromptFeedback()

Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

.google.cloud.vertexai.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
GenerateContentResponse.PromptFeedback

The promptFeedback.

getPromptFeedbackOrBuilder()

publicGenerateContentResponse.PromptFeedbackOrBuildergetPromptFeedbackOrBuilder()

Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

.google.cloud.vertexai.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
GenerateContentResponse.PromptFeedbackOrBuilder

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getUsageMetadata()

publicGenerateContentResponse.UsageMetadatagetUsageMetadata()

Usage metadata about the response(s).

.google.cloud.vertexai.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;

Returns
Type Description
GenerateContentResponse.UsageMetadata

The usageMetadata.

getUsageMetadataOrBuilder()

publicGenerateContentResponse.UsageMetadataOrBuildergetUsageMetadataOrBuilder()

Usage metadata about the response(s).

.google.cloud.vertexai.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;

Returns
Type Description
GenerateContentResponse.UsageMetadataOrBuilder

hasPromptFeedback()

publicbooleanhasPromptFeedback()

Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.

.google.cloud.vertexai.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the promptFeedback field is set.

hasUsageMetadata()

publicbooleanhasUsageMetadata()

Usage metadata about the response(s).

.google.cloud.vertexai.v1.GenerateContentResponse.UsageMetadata usage_metadata = 4;

Returns
Type Description
boolean

Whether the usageMetadata field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicGenerateContentResponse.BuildernewBuilderForType()
Returns
Type Description
GenerateContentResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedGenerateContentResponse.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
GenerateContentResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicGenerateContentResponse.BuildertoBuilder()
Returns
Type Description
GenerateContentResponse.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.