Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1ModalityTokenCount
- Inherits:
-
Object
- Object
- Google::Apis::AiplatformV1::GoogleCloudAiplatformV1ModalityTokenCount
- 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
Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
Instance Attribute Summary collapse
-
#modality ⇒ String
The modality that this token count applies to.
-
#token_count ⇒ Fixnum
The number of tokens counted for this modality.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudAiplatformV1ModalityTokenCount
constructor
A new instance of GoogleCloudAiplatformV1ModalityTokenCount.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudAiplatformV1ModalityTokenCount
Returns a new instance of GoogleCloudAiplatformV1ModalityTokenCount.
21533 21534 21535 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21533 def initialize(**args) update!(**args) end |
Instance Attribute Details
#modality ⇒ String
The modality that this token count applies to.
Corresponds to the JSON property modality
21526 21527 21528 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21526 def modality @modality end |
#token_count ⇒ Fixnum
The number of tokens counted for this modality.
Corresponds to the JSON property tokenCount
21531 21532 21533 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21531 def token_count @token_count end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
21538 21539 21540 21541 |
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21538 def update!(**args) @modality = args[:modality] if args.key?(:modality) @token_count = args[:token_count] if args.key?(:token_count) end |