Package com.google.genai.types
Class ModalityTokenCount
-
- All Implemented Interfaces:
public abstract class ModalityTokenCount extends JsonSerializable
Represents token counting info for a single modality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classModalityTokenCount.BuilderBuilder for ModalityTokenCount.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ModalityTokenCount()
-
Method Summary
Modifier and Type Method Description abstract Optional<MediaModality>modality()The modality associated with this token count. abstract Optional<Integer>tokenCount()The number of tokens counted for this modality. static ModalityTokenCount.Builderbuilder()Instantiates a builder for ModalityTokenCount. abstract ModalityTokenCount.BuildertoBuilder()Creates a builder with the same values as this instance. static ModalityTokenCountfromJson(String jsonString)Deserializes a JSON string to a ModalityTokenCount object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
modality
abstract Optional<MediaModality> modality()
The modality associated with this token count.
-
tokenCount
abstract Optional<Integer> tokenCount()
The number of tokens counted for this modality.
-
builder
static ModalityTokenCount.Builder builder()
Instantiates a builder for ModalityTokenCount.
-
toBuilder
abstract ModalityTokenCount.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static ModalityTokenCount fromJson(String jsonString)
Deserializes a JSON string to a ModalityTokenCount object.
-
-
-
-