Class TokensInfo

  • All Implemented Interfaces:

    
    public abstract class TokensInfo
    extends JsonSerializable
                        

    Tokens info with a list of tokens and the corresponding list of token ids.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public abstract class TokensInfo.Builder

      Builder for TokensInfo.

    • Constructor Summary

      Constructors 
      Constructor Description
      TokensInfo()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Optional<String> role() Optional fields for the role from the corresponding Content.
      abstract Optional<List<Long>> tokenIds() A list of token ids from the input.
      abstract Optional<List<Array<byte>>> tokens() A list of tokens from the input.
      static TokensInfo.Builder builder() Instantiates a builder for TokensInfo.
      abstract TokensInfo.Builder toBuilder() Creates a builder with the same values as this instance.
      static TokensInfo fromJson(String jsonString) Deserializes a JSON string to a TokensInfo 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