Llm分类器(Classifier)

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.

构造函数(Constructors)

Link copied to clipboard
constructor(model: Model, generateContentConfig: GenerateContentConfig? = null)

类型

Link copied to clipboard
class Builder

Fluent Builder for LlmClassifier该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。

Link copied to clipboard
object Companion

属性(Properties)

Link copied to clipboard

生成相关的设置(如温度参数);这些设置不得影响系统的指令或响应格式;此外,系统的响应内容格式(MIME类型)会被替换为 JSON 格式。

Link copied to clipboard

这个模型能够响应所有的请求。

Link copied to clipboard
open override val name: String

提供商的模型名称,例如: "jev-latest" 或者 "gemini-3.8-flash".

函数

Link copied to clipboard
open suspend override fun classify(request: ClassifierRequest): ClassifierResponse

向模型提出所有问题。 请求 在一个结构化的输出请求中,选择概率(Choice Probability)和得分概率(Score Probability)被限制在 0 到 1 的范围内,并且会被归一化,使其总和为 1;二进制概率(Binary Probability)的值必须介于 0 和 1 之间。 [0, 1].