Google Cloud Ai Platform V1 Client - Class GenerateContentResponse (0.31.0)

Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class GenerateContentResponse.

Response message for [PredictionService.GenerateContent].

Generated from protobuf message google.cloud.aiplatform.v1.GenerateContentResponse

Namespace

Google \ Cloud \ AIPlatform \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ candidates array<Google\Cloud\AIPlatform\V1\Candidate>

Output only. Generated candidates.

↳ prompt_feedback Google\Cloud\AIPlatform\V1\GenerateContentResponse\PromptFeedback

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.

↳ usage_metadata Google\Cloud\AIPlatform\V1\GenerateContentResponse\UsageMetadata

Usage metadata about the response(s).

getCandidates

Output only. Generated candidates.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setCandidates

Output only. Generated candidates.

Parameter
NameDescription
var array<Google\Cloud\AIPlatform\V1\Candidate>
Returns
TypeDescription
$this

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.

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\GenerateContentResponse\PromptFeedback|null

hasPromptFeedback

clearPromptFeedback

setPromptFeedback

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.

Parameter
NameDescription
var Google\Cloud\AIPlatform\V1\GenerateContentResponse\PromptFeedback
Returns
TypeDescription
$this

getUsageMetadata

Usage metadata about the response(s).

Returns
TypeDescription
Google\Cloud\AIPlatform\V1\GenerateContentResponse\UsageMetadata|null

hasUsageMetadata

clearUsageMetadata

setUsageMetadata

Usage metadata about the response(s).

Parameter
NameDescription
var Google\Cloud\AIPlatform\V1\GenerateContentResponse\UsageMetadata
Returns
TypeDescription
$this