Class CountTokensConfig

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.CountTokensConfig

public abstract class CountTokensConfig extends JsonSerializable
Config for the count_tokens method.
  • Constructor Details

    • CountTokensConfig

      public CountTokensConfig()
  • Method Details

    • httpOptions

      public abstract Optional<HttpOptions> httpOptions()
      Used to override HTTP request options.
    • systemInstruction

      public abstract Optional<Content> systemInstruction()
      Instructions for the model to steer it toward better performance.
    • tools

      public 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

      public abstract Optional<GenerationConfig> generationConfig()
      Configuration that the model uses to generate the response. Not supported by the Gemini Developer API.
    • builder

      public static CountTokensConfig.Builder builder()
      Instantiates a builder for CountTokensConfig.
    • toBuilder

      public abstract CountTokensConfig.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static CountTokensConfig fromJson(String jsonString)
      Deserializes a JSON string to a CountTokensConfig object.