Google Cloud Ai Platform V1 Client - Class UsageMetadata (1.2.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