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.
类型
Link copied to clipboard
class Builder
Fluent Builder for LlmClassifier该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。
属性(Properties)
函数
Link copied to clipboard
向模型提出所有问题。 请求 在一个结构化的输出请求中,选择概率(Choice Probability)和得分概率(Score Probability)被限制在 0 到 1 的范围内,并且会被归一化,使其总和为 1;二进制概率(Binary Probability)的值必须介于 0 和 1 之间。 [0, 1].