Google Cloud Ai Platform V1 Client - Class UsageMetadata (0.32.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
NameDescription
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
TypeDescription
int

setPromptTokenCount

Number of tokens in the request.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getCandidatesTokenCount

Number of tokens in the response(s).

Returns
TypeDescription
int

setCandidatesTokenCount

Number of tokens in the response(s).

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getTotalTokenCount

Generated from protobuf field int32 total_token_count = 3;

Returns
TypeDescription
int

setTotalTokenCount

Generated from protobuf field int32 total_token_count = 3;

Parameter
NameDescription
var int
Returns
TypeDescription
$this