Class LlmClassifier.Builder

java.lang.Object
com.google.adk.classifiers.LlmClassifier.Builder
Enclosing class:
LlmClassifier

public static final class LlmClassifier.Builder extends Object
Builder for LlmClassifier. Only the model is required.
  • Method Details

    • model

      @CanIgnoreReturnValue public LlmClassifier.Builder model(BaseLlm model)
      Sets the model that answers the questions, replacing any model name set before.
    • model

      @CanIgnoreReturnValue public LlmClassifier.Builder model(String modelName)
      Sets the name of the model that answers the questions, which LlmRegistry resolves on each call, replacing any model set before.
    • generateContentConfig

      @CanIgnoreReturnValue public LlmClassifier.Builder generateContentConfig(@Nullable com.google.genai.types.GenerateContentConfig generateContentConfig)
      Sets generation settings such as the temperature. They must not set the system instruction or a response schema, which the classifier builds from the questions, and the response MIME type is replaced with JSON.
    • build

      public LlmClassifier build()
      Builds the classifier.
      Throws:
      IllegalStateException - if no model is set
      IllegalArgumentException - if the generation settings set a system instruction or a response schema