Package com.google.genai.types
Class CountTokensParameters
-
- All Implemented Interfaces:
@InternalApi() public abstract class CountTokensParameters extends JsonSerializable
Parameters for counting tokens.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCountTokensParameters.BuilderBuilder for CountTokensParameters.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CountTokensParameters()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>model()ID of the model to use. abstract Optional<List<Content>>contents()Input content. abstract Optional<CountTokensConfig>config()Configuration for counting tokens. static CountTokensParameters.Builderbuilder()Instantiates a builder for CountTokensParameters. abstract CountTokensParameters.BuildertoBuilder()Creates a builder with the same values as this instance. static CountTokensParametersfromJson(String jsonString)Deserializes a JSON string to a CountTokensParameters 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
-
model
abstract Optional<String> model()
ID of the model to use. For a list of models, see `Google models `_.
-
config
abstract Optional<CountTokensConfig> config()
Configuration for counting tokens.
-
builder
static CountTokensParameters.Builder builder()
Instantiates a builder for CountTokensParameters.
-
toBuilder
abstract CountTokensParameters.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CountTokensParameters fromJson(String jsonString)
Deserializes a JSON string to a CountTokensParameters object.
-
-
-
-