public sealed class ModalityTokenCount : IMessage<ModalityTokenCount>, IEquatable<ModalityTokenCount>, IDeepCloneable<ModalityTokenCount>, IBufferMessage, IMessage
Reference documentation and code samples for the Vertex AI v1beta1 API class ModalityTokenCount.
Represents token counting info for a single modality.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eModalityTokenCount\u003c/code\u003e class in the Vertex AI v1beta1 API represents token counting information for a single modality.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits from the base \u003ccode\u003eobject\u003c/code\u003e class, and has methods such as \u003ccode\u003eGetHashCode()\u003c/code\u003e, \u003ccode\u003eGetType()\u003c/code\u003e, and \u003ccode\u003eToString()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers two constructors, one default and one that takes another \u003ccode\u003eModalityTokenCount\u003c/code\u003e object as a parameter, the latter for creating a copy.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eModalityTokenCount\u003c/code\u003e has two properties: \u003ccode\u003eModality\u003c/code\u003e, which specifies the modality type, and \u003ccode\u003eTokenCount\u003c/code\u003e, an integer representing the number of tokens.\u003c/p\u003e\n"]]],[],null,["# Vertex AI v1beta1 API - Class ModalityTokenCount (1.0.0-beta47)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta47 (latest)](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount)\n- [1.0.0-beta46](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/1.0.0-beta46/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount) \n\n public sealed class ModalityTokenCount : IMessage\u003cModalityTokenCount\u003e, IEquatable\u003cModalityTokenCount\u003e, IDeepCloneable\u003cModalityTokenCount\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Vertex AI v1beta1 API class ModalityTokenCount.\n\nRepresents token counting info for a single modality. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ModalityTokenCount \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ModalityTokenCount](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ModalityTokenCount](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ModalityTokenCount](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.AIPlatform.V1Beta1](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.AIPlatform.V1Beta1.dll\n\nConstructors\n------------\n\n### ModalityTokenCount()\n\n public ModalityTokenCount()\n\n### ModalityTokenCount(ModalityTokenCount)\n\n public ModalityTokenCount(ModalityTokenCount other)\n\nProperties\n----------\n\n### Modality\n\n public Modality Modality { get; set; }\n\nThe modality associated with this token count.\n\n### TokenCount\n\n public int TokenCount { get; set; }\n\nNumber of tokens."]]