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

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

Usage metadata about response(s).

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

Namespace

Google \ Cloud \ AIPlatform \ V1 \ GenerateContentResponse

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ prompt_token_count int

Number of tokens in the request.

↳ candidates_token_count int

Number of tokens in the response(s).

↳ total_token_count int

getPromptTokenCount

Number of tokens in the request.

Returns
Type Description
int

setPromptTokenCount

Number of tokens in the request.

Parameter
Name Description
var int
Returns
Type Description
$this

getCandidatesTokenCount

Number of tokens in the response(s).

Returns
Type Description
int

setCandidatesTokenCount

Number of tokens in the response(s).

Parameter
Name Description
var int
Returns
Type Description
$this

getTotalTokenCount

Generated from protobuf field int32 total_token_count = 3;

Returns
Type Description
int

setTotalTokenCount

Generated from protobuf field int32 total_token_count = 3;

Parameter
Name Description
var int
Returns
Type Description
$this

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月08日 UTC.