Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1UsageMetadata

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1/classes.rb,
lib/google/apis/aiplatform_v1/representations.rb,
lib/google/apis/aiplatform_v1/representations.rb

Overview

Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1UsageMetadata

Returns a new instance of GoogleCloudAiplatformV1UsageMetadata.



48551
48552
48553
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48551

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cache_tokens_detailsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1ModalityTokenCount>

Output only. A detailed breakdown of the token count for each modality in the cached content. Corresponds to the JSON property cacheTokensDetails



48489
48490
48491
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48489

def cache_tokens_details
  @cache_tokens_details
end

#cached_content_token_countFixnum

Output only. The number of tokens in the cached content that was used for this request. Corresponds to the JSON property cachedContentTokenCount

Returns:

  • (Fixnum)


48495
48496
48497
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48495

def cached_content_token_count
  @cached_content_token_count
end

#candidates_token_countFixnum

The total number of tokens in the generated candidates. Corresponds to the JSON property candidatesTokenCount

Returns:

  • (Fixnum)


48500
48501
48502
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48500

def candidates_token_count
  @candidates_token_count
end

#candidates_tokens_detailsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1ModalityTokenCount>

Output only. A detailed breakdown of the token count for each modality in the generated candidates. Corresponds to the JSON property candidatesTokensDetails



48506
48507
48508
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48506

def candidates_tokens_details
  @candidates_tokens_details
end

#prompt_token_countFixnum

The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When cached_content is set, this also includes the number of tokens in the cached content. Corresponds to the JSON property promptTokenCount

Returns:

  • (Fixnum)


48513
48514
48515
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48513

def prompt_token_count
  @prompt_token_count
end

#prompt_tokens_detailsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1ModalityTokenCount>

Output only. A detailed breakdown of the token count for each modality in the prompt. Corresponds to the JSON property promptTokensDetails



48519
48520
48521
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48519

def prompt_tokens_details
  @prompt_tokens_details
end

#thoughts_token_countFixnum

Output only. The number of tokens that were part of the model's generated " thoughts" output, if applicable. Corresponds to the JSON property thoughtsTokenCount

Returns:

  • (Fixnum)


48525
48526
48527
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48525

def thoughts_token_count
  @thoughts_token_count
end

#tool_use_prompt_token_countFixnum

Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable. Corresponds to the JSON property toolUsePromptTokenCount

Returns:

  • (Fixnum)


48531
48532
48533
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48531

def tool_use_prompt_token_count
  @tool_use_prompt_token_count
end

#tool_use_prompt_tokens_detailsArray<Google::Apis::AiplatformV1::GoogleCloudAiplatformV1ModalityTokenCount>

Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input. Corresponds to the JSON property toolUsePromptTokensDetails



48537
48538
48539
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48537

def tool_use_prompt_tokens_details
  @tool_use_prompt_tokens_details
end

#total_token_countFixnum

The total number of tokens for the entire request. This is the sum of prompt_token_count, candidates_token_count, tool_use_prompt_token_count, and thoughts_token_count. Corresponds to the JSON property totalTokenCount

Returns:

  • (Fixnum)


48544
48545
48546
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48544

def total_token_count
  @total_token_count
end

#traffic_typeString

Output only. The traffic type for this request. Corresponds to the JSON property trafficType

Returns:

  • (String)


48549
48550
48551
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48549

def traffic_type
  @traffic_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



48556
48557
48558
48559
48560
48561
48562
48563
48564
48565
48566
48567
48568
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 48556

def update!(**args)
  @cache_tokens_details = args[:cache_tokens_details] if args.key?(:cache_tokens_details)
  @cached_content_token_count = args[:cached_content_token_count] if args.key?(:cached_content_token_count)
  @candidates_token_count = args[:candidates_token_count] if args.key?(:candidates_token_count)
  @candidates_tokens_details = args[:candidates_tokens_details] if args.key?(:candidates_tokens_details)
  @prompt_token_count = args[:prompt_token_count] if args.key?(:prompt_token_count)
  @prompt_tokens_details = args[:prompt_tokens_details] if args.key?(:prompt_tokens_details)
  @thoughts_token_count = args[:thoughts_token_count] if args.key?(:thoughts_token_count)
  @tool_use_prompt_token_count = args[:tool_use_prompt_token_count] if args.key?(:tool_use_prompt_token_count)
  @tool_use_prompt_tokens_details = args[:tool_use_prompt_tokens_details] if args.key?(:tool_use_prompt_tokens_details)
  @total_token_count = args[:total_token_count] if args.key?(:total_token_count)
  @traffic_type = args[:traffic_type] if args.key?(:traffic_type)
end