|
| 1 | +// Copyright 2025 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.aiplatform.v1; |
| 18 | + |
| 19 | +import "google/api/field_behavior.proto"; |
| 20 | +import "google/cloud/aiplatform/v1/content.proto"; |
| 21 | + |
| 22 | +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; |
| 23 | +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; |
| 24 | +option java_multiple_files = true; |
| 25 | +option java_outer_classname = "UsageMetadataProto"; |
| 26 | +option java_package = "com.google.cloud.aiplatform.v1"; |
| 27 | +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; |
| 28 | +option ruby_package = "Google::Cloud::AIPlatform::V1"; |
| 29 | + |
| 30 | +// Usage metadata about the content generation request and response. |
| 31 | +// This message provides a detailed breakdown of token usage and other |
| 32 | +// relevant metrics. |
| 33 | +message UsageMetadata { |
| 34 | + // The type of traffic that this request was processed with, indicating which |
| 35 | + // quota gets consumed. |
| 36 | + enum TrafficType { |
| 37 | + // Unspecified request traffic type. |
| 38 | + TRAFFIC_TYPE_UNSPECIFIED = 0; |
| 39 | + |
| 40 | + // Type for Pay-As-You-Go traffic. |
| 41 | + ON_DEMAND = 1; |
| 42 | + |
| 43 | + // Type for Provisioned Throughput traffic. |
| 44 | + PROVISIONED_THROUGHPUT = 2; |
| 45 | + } |
| 46 | + |
| 47 | + // The total number of tokens in the prompt. This includes any text, images, |
| 48 | + // or other media provided in the request. When `cached_content` is set, |
| 49 | + // this also includes the number of tokens in the cached content. |
| 50 | + int32 prompt_token_count = 1; |
| 51 | + |
| 52 | + // The total number of tokens in the generated candidates. |
| 53 | + int32 candidates_token_count = 2; |
| 54 | + |
| 55 | + // The total number of tokens for the entire request. This is the sum of |
| 56 | + // `prompt_token_count`, `candidates_token_count`, |
| 57 | + // `tool_use_prompt_token_count`, and `thoughts_token_count`. |
| 58 | + int32 total_token_count = 3; |
| 59 | + |
| 60 | + // Output only. The number of tokens in the results from tool executions, |
| 61 | + // which are provided back to the model as input, if applicable. |
| 62 | + int32 tool_use_prompt_token_count = 13 |
| 63 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 64 | + |
| 65 | + // Output only. The number of tokens that were part of the model's generated |
| 66 | + // "thoughts" output, if applicable. |
| 67 | + int32 thoughts_token_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 68 | + |
| 69 | + // Output only. The number of tokens in the cached content that was used for |
| 70 | + // this request. |
| 71 | + int32 cached_content_token_count = 5 |
| 72 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 73 | + |
| 74 | + // Output only. A detailed breakdown of the token count for each modality in |
| 75 | + // the prompt. |
| 76 | + repeated ModalityTokenCount prompt_tokens_details = 9 |
| 77 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 78 | + |
| 79 | + // Output only. A detailed breakdown of the token count for each modality in |
| 80 | + // the cached content. |
| 81 | + repeated ModalityTokenCount cache_tokens_details = 10 |
| 82 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 83 | + |
| 84 | + // Output only. A detailed breakdown of the token count for each modality in |
| 85 | + // the generated candidates. |
| 86 | + repeated ModalityTokenCount candidates_tokens_details = 11 |
| 87 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 88 | + |
| 89 | + // Output only. A detailed breakdown by modality of the token counts from the |
| 90 | + // results of tool executions, which are provided back to the model as input. |
| 91 | + repeated ModalityTokenCount tool_use_prompt_tokens_details = 12 |
| 92 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 93 | + |
| 94 | + // Output only. The traffic type for this request. |
| 95 | + TrafficType traffic_type = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 96 | +} |
0 commit comments