Package com.google.genai.types
Class CachedContentUsageMetadata
-
- All Implemented Interfaces:
public abstract class CachedContentUsageMetadata extends JsonSerializable
Metadata on the usage of the cached content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCachedContentUsageMetadata.BuilderBuilder for CachedContentUsageMetadata.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CachedContentUsageMetadata()
-
Method Summary
Modifier and Type Method Description abstract Optional<Integer>audioDurationSeconds()Duration of audio in seconds. abstract Optional<Integer>imageCount()Number of images. abstract Optional<Integer>textCount()Number of text characters. abstract Optional<Integer>totalTokenCount()Total number of tokens that the cached content consumes. abstract Optional<Integer>videoDurationSeconds()Duration of video in seconds. static CachedContentUsageMetadata.Builderbuilder()Instantiates a builder for CachedContentUsageMetadata. abstract CachedContentUsageMetadata.BuildertoBuilder()Creates a builder with the same values as this instance. static CachedContentUsageMetadatafromJson(String jsonString)Deserializes a JSON string to a CachedContentUsageMetadata 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
-
audioDurationSeconds
abstract Optional<Integer> audioDurationSeconds()
Duration of audio in seconds. This field is not supported in Gemini API.
-
imageCount
abstract Optional<Integer> imageCount()
Number of images. This field is not supported in Gemini API.
-
textCount
abstract Optional<Integer> textCount()
Number of text characters. This field is not supported in Gemini API.
-
totalTokenCount
abstract Optional<Integer> totalTokenCount()
Total number of tokens that the cached content consumes.
-
videoDurationSeconds
abstract Optional<Integer> videoDurationSeconds()
Duration of video in seconds. This field is not supported in Gemini API.
-
builder
static CachedContentUsageMetadata.Builder builder()
Instantiates a builder for CachedContentUsageMetadata.
-
toBuilder
abstract CachedContentUsageMetadata.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CachedContentUsageMetadata fromJson(String jsonString)
Deserializes a JSON string to a CachedContentUsageMetadata object.
-
-
-
-