Class: Google::Apis::AiplatformV1beta1::GenaiVertexV1beta1InteractionUsage

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

Overview

Statistics on the interaction request's token usage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GenaiVertexV1beta1InteractionUsage

Returns a new instance of GenaiVertexV1beta1InteractionUsage.



3404
3405
3406
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3404

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

Instance Attribute Details

#cached_tokens_by_modalityArray<Google::Apis::AiplatformV1beta1::GenaiVertexV1beta1InteractionUsageModalityTokens>

A breakdown of cached token usage by modality. Corresponds to the JSON property cached_tokens_by_modality



3351
3352
3353
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3351

def cached_tokens_by_modality
  @cached_tokens_by_modality
end

#grounding_tool_countArray<Google::Apis::AiplatformV1beta1::GenaiVertexV1beta1InteractionUsageGroundingToolCount>

Grounding tool count. Corresponds to the JSON property grounding_tool_count



3356
3357
3358
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3356

def grounding_tool_count
  @grounding_tool_count
end

#input_tokens_by_modalityArray<Google::Apis::AiplatformV1beta1::GenaiVertexV1beta1InteractionUsageModalityTokens>

A breakdown of input token usage by modality. Corresponds to the JSON property input_tokens_by_modality



3361
3362
3363
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3361

def input_tokens_by_modality
  @input_tokens_by_modality
end

#output_tokens_by_modalityArray<Google::Apis::AiplatformV1beta1::GenaiVertexV1beta1InteractionUsageModalityTokens>

A breakdown of output token usage by modality. Corresponds to the JSON property output_tokens_by_modality



3366
3367
3368
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3366

def output_tokens_by_modality
  @output_tokens_by_modality
end

#tool_use_tokens_by_modalityArray<Google::Apis::AiplatformV1beta1::GenaiVertexV1beta1InteractionUsageModalityTokens>

A breakdown of tool-use token usage by modality. Corresponds to the JSON property tool_use_tokens_by_modality



3371
3372
3373
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3371

def tool_use_tokens_by_modality
  @tool_use_tokens_by_modality
end

#total_cached_tokensFixnum

Number of tokens in the cached part of the prompt (the cached content). Corresponds to the JSON property total_cached_tokens

Returns:

  • (Fixnum)


3376
3377
3378
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3376

def total_cached_tokens
  @total_cached_tokens
end

#total_input_tokensFixnum

Number of tokens in the prompt (context). Corresponds to the JSON property total_input_tokens

Returns:

  • (Fixnum)


3381
3382
3383
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3381

def total_input_tokens
  @total_input_tokens
end

#total_output_tokensFixnum

Total number of tokens across all the generated responses. Corresponds to the JSON property total_output_tokens

Returns:

  • (Fixnum)


3386
3387
3388
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3386

def total_output_tokens
  @total_output_tokens
end

#total_thought_tokensFixnum

Number of tokens of thoughts for thinking models. Corresponds to the JSON property total_thought_tokens

Returns:

  • (Fixnum)


3391
3392
3393
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3391

def total_thought_tokens
  @total_thought_tokens
end

#total_tokensFixnum

Total token count for the interaction request (prompt + responses + other internal tokens). Corresponds to the JSON property total_tokens

Returns:

  • (Fixnum)


3397
3398
3399
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3397

def total_tokens
  @total_tokens
end

#total_tool_use_tokensFixnum

Number of tokens present in tool-use prompt(s). Corresponds to the JSON property total_tool_use_tokens

Returns:

  • (Fixnum)


3402
3403
3404
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3402

def total_tool_use_tokens
  @total_tool_use_tokens
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 3409

def update!(**args)
  @cached_tokens_by_modality = args[:cached_tokens_by_modality] if args.key?(:cached_tokens_by_modality)
  @grounding_tool_count = args[:grounding_tool_count] if args.key?(:grounding_tool_count)
  @input_tokens_by_modality = args[:input_tokens_by_modality] if args.key?(:input_tokens_by_modality)
  @output_tokens_by_modality = args[:output_tokens_by_modality] if args.key?(:output_tokens_by_modality)
  @tool_use_tokens_by_modality = args[:tool_use_tokens_by_modality] if args.key?(:tool_use_tokens_by_modality)
  @total_cached_tokens = args[:total_cached_tokens] if args.key?(:total_cached_tokens)
  @total_input_tokens = args[:total_input_tokens] if args.key?(:total_input_tokens)
  @total_output_tokens = args[:total_output_tokens] if args.key?(:total_output_tokens)
  @total_thought_tokens = args[:total_thought_tokens] if args.key?(:total_thought_tokens)
  @total_tokens = args[:total_tokens] if args.key?(:total_tokens)
  @total_tool_use_tokens = args[:total_tool_use_tokens] if args.key?(:total_tool_use_tokens)
end