Package com.google.genai.types
Class CountTokensConfig
-
- All Implemented Interfaces:
public abstract class CountTokensConfig extends JsonSerializable
Config for the count_tokens method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCountTokensConfig.BuilderBuilder for CountTokensConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CountTokensConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<HttpOptions>httpOptions()Used to override HTTP request options. abstract Optional<Content>systemInstruction()Instructions for the model to steer it toward better performance. abstract Optional<List<Tool>>tools()Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model. abstract Optional<GenerationConfig>generationConfig()Configuration that the model uses to generate the response. static CountTokensConfig.Builderbuilder()Instantiates a builder for CountTokensConfig. abstract CountTokensConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static CountTokensConfigfromJson(String jsonString)Deserializes a JSON string to a CountTokensConfig 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
-
httpOptions
abstract Optional<HttpOptions> httpOptions()
Used to override HTTP request options.
-
systemInstruction
abstract Optional<Content> systemInstruction()
Instructions for the model to steer it toward better performance.
-
tools
abstract Optional<List<Tool>> tools()
Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.
-
generationConfig
abstract Optional<GenerationConfig> generationConfig()
Configuration that the model uses to generate the response. Not supported by the Gemini Developer API.
-
builder
static CountTokensConfig.Builder builder()
Instantiates a builder for CountTokensConfig.
-
toBuilder
abstract CountTokensConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CountTokensConfig fromJson(String jsonString)
Deserializes a JSON string to a CountTokensConfig object.
-
-
-
-