Interface GenerateContentResponseOrBuilder (0.6.0)

publicinterface GenerateContentResponseOrBuilderextendsMessageOrBuilder

Implements

MessageOrBuilder

Methods

getCandidates(int index)

publicabstractCandidategetCandidates(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()

publicabstractintgetCandidatesCount()

Output only. Generated candidates.

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

Returns
Type Description
int

getCandidatesList()

publicabstractList<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)

publicabstractCandidateOrBuildergetCandidatesOrBuilder(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()

publicabstractList<?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>

getPromptFeedback()

publicabstractGenerateContentResponse.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()

publicabstractGenerateContentResponse.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

getUsageMetadata()

publicabstractGenerateContentResponse.UsageMetadatagetUsageMetadata()

Usage metadata about the response(s).

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

Returns
Type Description
GenerateContentResponse.UsageMetadata

The usageMetadata.

getUsageMetadataOrBuilder()

publicabstractGenerateContentResponse.UsageMetadataOrBuildergetUsageMetadataOrBuilder()

Usage metadata about the response(s).

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

Returns
Type Description
GenerateContentResponse.UsageMetadataOrBuilder

hasPromptFeedback()

publicabstractbooleanhasPromptFeedback()

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()

publicabstractbooleanhasUsageMetadata()

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.

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.