LlmClassifier
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.
Types
Link copied to clipboard
class Builder
Fluent builder for LlmClassifier, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.
Properties
Functions
Link copied to clipboard
Asks the model every question in request in one structured-output call. Choice and Score probabilities are clamped at 0 and normalized to sum to 1; a Binary probability must lie in [0, 1].