Class ClassifierNode.Builder
java.lang.Object
com.google.adk.classifiers.ClassifierNode.Builder
- Enclosing class:
ClassifierNode
Builder for
ClassifierNode. The name, classifier and question are required.-
Method Summary
Modifier and TypeMethodDescriptionSets the state key under which the node stores the answer; null stores nothing.build()Builds the node.classifier(Classifier classifier) config(NodeConfig config) Sets the node's retry policy and execution timeout.description(String description) inputSchema(@Nullable com.google.genai.types.Schema inputSchema) outputSchema(@Nullable com.google.genai.types.Schema outputSchema) Sets theQuestion.ChoiceorQuestion.Binaryquestion whose answer picks the route.threshold(double threshold) Sets the probability in [0, 1] at or above which aQuestion.Binaryquestion routestrue, 0.5 if unset.
-
Method Details
-
name
-
classifier
-
question
Sets theQuestion.ChoiceorQuestion.Binaryquestion whose answer picks the route. -
threshold
Sets the probability in [0, 1] at or above which aQuestion.Binaryquestion routestrue, 0.5 if unset. AQuestion.Choicequestion takes no threshold. -
answerKey
Sets the state key under which the node stores the answer; null stores nothing. -
description
-
config
Sets the node's retry policy and execution timeout. -
inputSchema
@CanIgnoreReturnValue public ClassifierNode.Builder inputSchema(@Nullable com.google.genai.types.Schema inputSchema) -
outputSchema
@CanIgnoreReturnValue public ClassifierNode.Builder outputSchema(@Nullable com.google.genai.types.Schema outputSchema) -
build
Builds the node.- Throws:
IllegalStateException- if the name, classifier or question is not setIllegalArgumentException- if the name is empty or contains/,@, or.WorkflowConfigurationException- if the question is aQuestion.Scoreor has the labelRoute.DEFAULT_ROUTE_SENTINEL, or if a threshold is set for aQuestion.Choiceor lies outside [0, 1]
-