Class GenerateContentResponse.Builder (3.33.0)

public static final class GenerateContentResponse.Builder extends GeneratedMessageV3.Builder<GenerateContentResponse.Builder> implements GenerateContentResponseOrBuilder

Response message for [PredictionService.GenerateContent].

Protobuf type google.cloud.aiplatform.v1.GenerateContentResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllCandidates(Iterable<? extends Candidate> values)

public GenerateContentResponse.Builder addAllCandidates(Iterable<? extends Candidate> values)

Output only. Generated candidates.

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

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1.Candidate>
Returns
TypeDescription
GenerateContentResponse.Builder

addCandidates(Candidate value)

public GenerateContentResponse.Builder addCandidates(Candidate value)

Output only. Generated candidates.

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

Parameter
NameDescription
valueCandidate
Returns
TypeDescription
GenerateContentResponse.Builder

addCandidates(Candidate.Builder builderForValue)

public GenerateContentResponse.Builder addCandidates(Candidate.Builder builderForValue)

Output only. Generated candidates.

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

Parameter
NameDescription
builderForValueCandidate.Builder
Returns
TypeDescription
GenerateContentResponse.Builder

addCandidates(int index, Candidate value)

public GenerateContentResponse.Builder addCandidates(int index, Candidate value)

Output only. Generated candidates.

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

Parameters
NameDescription
indexint
valueCandidate
Returns
TypeDescription
GenerateContentResponse.Builder

addCandidates(int index, Candidate.Builder builderForValue)

public GenerateContentResponse.Builder addCandidates(int index, Candidate.Builder builderForValue)

Output only. Generated candidates.

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

Parameters
NameDescription
indexint
builderForValueCandidate.Builder
Returns
TypeDescription
GenerateContentResponse.Builder

addCandidatesBuilder()

public Candidate.Builder addCandidatesBuilder()

Output only. Generated candidates.

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

Returns
TypeDescription
Candidate.Builder

addCandidatesBuilder(int index)

public Candidate.Builder addCandidatesBuilder(int index)

Output only. Generated candidates.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Candidate.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

build()

public GenerateContentResponse build()
Returns
TypeDescription
GenerateContentResponse

buildPartial()

public GenerateContentResponse buildPartial()
Returns
TypeDescription
GenerateContentResponse

clear()

public GenerateContentResponse.Builder clear()
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

clearCandidates()

public GenerateContentResponse.Builder clearCandidates()

Output only. Generated candidates.

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

Returns
TypeDescription
GenerateContentResponse.Builder

clearField(Descriptors.FieldDescriptor field)

public GenerateContentResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public GenerateContentResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

clearPromptFeedback()

public GenerateContentResponse.Builder clearPromptFeedback()

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
GenerateContentResponse.Builder

clearUsageMetadata()

public GenerateContentResponse.Builder clearUsageMetadata()

Usage metadata about the response(s).

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

Returns
TypeDescription
GenerateContentResponse.Builder

clone()

public GenerateContentResponse.Builder clone()
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

getCandidates(int index)

public Candidate getCandidates(int index)

Output only. Generated candidates.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Candidate

getCandidatesBuilder(int index)

public Candidate.Builder getCandidatesBuilder(int index)

Output only. Generated candidates.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Candidate.Builder

getCandidatesBuilderList()

public List<Candidate.Builder> getCandidatesBuilderList()

Output only. Generated candidates.

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

Returns
TypeDescription
List<Builder>

getCandidatesCount()

public int getCandidatesCount()

Output only. Generated candidates.

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

Returns
TypeDescription
int

getCandidatesList()

public List<Candidate> getCandidatesList()

Output only. Generated candidates.

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

Returns
TypeDescription
List<Candidate>

getCandidatesOrBuilder(int index)

public CandidateOrBuilder getCandidatesOrBuilder(int index)

Output only. Generated candidates.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
CandidateOrBuilder

getCandidatesOrBuilderList()

public List<? extends CandidateOrBuilder> getCandidatesOrBuilderList()

Output only. Generated candidates.

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

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1.CandidateOrBuilder>

getDefaultInstanceForType()

public GenerateContentResponse getDefaultInstanceForType()
Returns
TypeDescription
GenerateContentResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getPromptFeedback()

public GenerateContentResponse.PromptFeedback getPromptFeedback()

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
GenerateContentResponse.PromptFeedback

The promptFeedback.

getPromptFeedbackBuilder()

public GenerateContentResponse.PromptFeedback.Builder getPromptFeedbackBuilder()

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

getPromptFeedbackOrBuilder()

public GenerateContentResponse.PromptFeedbackOrBuilder getPromptFeedbackOrBuilder()

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
GenerateContentResponse.PromptFeedbackOrBuilder

getUsageMetadata()

public GenerateContentResponse.UsageMetadata getUsageMetadata()

Usage metadata about the response(s).

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

Returns
TypeDescription
GenerateContentResponse.UsageMetadata

The usageMetadata.

getUsageMetadataBuilder()

public GenerateContentResponse.UsageMetadata.Builder getUsageMetadataBuilder()

Usage metadata about the response(s).

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

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

getUsageMetadataOrBuilder()

public GenerateContentResponse.UsageMetadataOrBuilder getUsageMetadataOrBuilder()

Usage metadata about the response(s).

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

Returns
TypeDescription
GenerateContentResponse.UsageMetadataOrBuilder

hasPromptFeedback()

public boolean hasPromptFeedback()

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the promptFeedback field is set.

hasUsageMetadata()

public boolean hasUsageMetadata()

Usage metadata about the response(s).

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

Returns
TypeDescription
boolean

Whether the usageMetadata field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(GenerateContentResponse other)

public GenerateContentResponse.Builder mergeFrom(GenerateContentResponse other)
Parameter
NameDescription
otherGenerateContentResponse
Returns
TypeDescription
GenerateContentResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GenerateContentResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public GenerateContentResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

mergePromptFeedback(GenerateContentResponse.PromptFeedback value)

public GenerateContentResponse.Builder mergePromptFeedback(GenerateContentResponse.PromptFeedback value)

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueGenerateContentResponse.PromptFeedback
Returns
TypeDescription
GenerateContentResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

mergeUsageMetadata(GenerateContentResponse.UsageMetadata value)

public GenerateContentResponse.Builder mergeUsageMetadata(GenerateContentResponse.UsageMetadata value)

Usage metadata about the response(s).

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

Parameter
NameDescription
valueGenerateContentResponse.UsageMetadata
Returns
TypeDescription
GenerateContentResponse.Builder

removeCandidates(int index)

public GenerateContentResponse.Builder removeCandidates(int index)

Output only. Generated candidates.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
GenerateContentResponse.Builder

setCandidates(int index, Candidate value)

public GenerateContentResponse.Builder setCandidates(int index, Candidate value)

Output only. Generated candidates.

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

Parameters
NameDescription
indexint
valueCandidate
Returns
TypeDescription
GenerateContentResponse.Builder

setCandidates(int index, Candidate.Builder builderForValue)

public GenerateContentResponse.Builder setCandidates(int index, Candidate.Builder builderForValue)

Output only. Generated candidates.

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

Parameters
NameDescription
indexint
builderForValueCandidate.Builder
Returns
TypeDescription
GenerateContentResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

setPromptFeedback(GenerateContentResponse.PromptFeedback value)

public GenerateContentResponse.Builder setPromptFeedback(GenerateContentResponse.PromptFeedback value)

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueGenerateContentResponse.PromptFeedback
Returns
TypeDescription
GenerateContentResponse.Builder

setPromptFeedback(GenerateContentResponse.PromptFeedback.Builder builderForValue)

public GenerateContentResponse.Builder setPromptFeedback(GenerateContentResponse.PromptFeedback.Builder builderForValue)

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.aiplatform.v1.GenerateContentResponse.PromptFeedback prompt_feedback = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueGenerateContentResponse.PromptFeedback.Builder
Returns
TypeDescription
GenerateContentResponse.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public GenerateContentResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateContentResponse.Builder
Overrides

setUsageMetadata(GenerateContentResponse.UsageMetadata value)

public GenerateContentResponse.Builder setUsageMetadata(GenerateContentResponse.UsageMetadata value)

Usage metadata about the response(s).

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

Parameter
NameDescription
valueGenerateContentResponse.UsageMetadata
Returns
TypeDescription
GenerateContentResponse.Builder

setUsageMetadata(GenerateContentResponse.UsageMetadata.Builder builderForValue)

public GenerateContentResponse.Builder setUsageMetadata(GenerateContentResponse.UsageMetadata.Builder builderForValue)

Usage metadata about the response(s).

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

Parameter
NameDescription
builderForValueGenerateContentResponse.UsageMetadata.Builder
Returns
TypeDescription
GenerateContentResponse.Builder