Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class Binary @JvmOverloads constructor(val instructions: ClassifierContent? = null, val criteria: ClassifierContent? = null) : Question

Asks a Classifier for the probability that a statement is true.

Link copied to clipboard
data class BinaryAnswer @JvmOverloads constructor(val probability: Double, val confidence: Double? = null) : Answer

The answer to a Binary question.

Link copied to clipboard
data class Choice @JvmOverloads constructor(val instructions: ClassifierContent? = null, val criteria: Map<String, ClassifierContent?>) : Question

Asks a Classifier to pick one of two or more named labels.

Link copied to clipboard
data class ChoiceAnswer @JvmOverloads constructor(val choice: String, val probabilities: Map<String, Double>, val confidence: Double? = null) : Answer

The answer to a Choice question.

Link copied to clipboard

A decision model that answers typed questions with probability distributions.

Link copied to clipboard

Text or structured data that a Classifier reads, as the input or as a question's instructions or criteria: plain Text, or a JsonObject or JsonArray. It mirrors Python ADK's JSONContent.

Link copied to clipboard

The input a Classifier answers questions about: ClassifierContent (text, or a JSON object or array) or multimodal Content parts.

Link copied to clipboard
class ClassifierNode @JvmOverloads constructor(name: String, val classifier: Classifier, val question: Question, threshold: Double? = null, val answerKey: String? = null, description: String = "", rerunOnResume: Boolean = false, waitForOutput: Boolean = false, config: NodeConfig = NodeConfig(), inputSchema: Schema? = null, outputSchema: Schema? = null, stateSchema: Schema? = null) : BaseNode

Routes a workflow by asking a classifier one question about the node's input and emitting the answer as the route: the chosen label of a Choice, or true or false for a Binary, decided by threshold. The output is the unchanged input, or the underlying value unwrapped from a ClassifierInput, so the routed-to node receives what the classifier saw.

Link copied to clipboard

A request to a Classifier to answer one or more typed questions about input.

Link copied to clipboard
data class ClassifierResponse @JvmOverloads constructor(val answers: Map<String, Answer>, val modelVersion: String? = null)

The answers produced by a single Classifier.classify call.

Link copied to clipboard
class LlmClassifier @JvmOverloads constructor(val model: Model, val generateContentConfig: GenerateContentConfig? = null) : Classifier

Answers typed questions with any Model through structured output: the model is asked for a probability for every option and constrained to a JSON schema built from the questions, so it can only answer with the given labels. The probabilities are the model's stated values rather than token log-probabilities, so check their calibration with evals before relying on a threshold.

Link copied to clipboard

A typed question answered by a Classifier: Choice, Binary, or Score. Its instructions and criteria are ClassifierContent: text, or a JSON object or array.

Link copied to clipboard

Indicates that a provider declined to produce an answer for a question.

Link copied to clipboard
data class Score @JvmOverloads constructor(val instructions: ClassifierContent? = null, val criteria: List<ClassifierContent>) : Question

Asks a Classifier to place an input on an ordered rubric starting at level 0.

Link copied to clipboard
data class ScoreAnswer @JvmOverloads constructor(val score: Double, val probabilities: Map<Int, Double>, val confidence: Double? = null) : Answer

The answer to a Score question.