包package
agentscope.classifieragentscope.classifier
module agentscope.classifier
agentscope.classifier 属于模型与向量化,大模型接入、凭证与嵌入。 该包共收录 15 个公开类型。
Typed probabilistic classifier models.
源码Source
agentscope/classifier/__init__.py:1类Classes
BinaryAnswer类class | 二元答案,与模型服务通信并返回生成或向量化结果。 The probability of a positive answer to a binary question. |
BinaryCriteria类class | 二元标准,与模型服务通信并返回生成或向量化结果。 Optional descriptions for the two outcomes of a binary question. |
BinaryQuestion类class | 二元问题,与模型服务通信并返回生成或向量化结果。 A question whose answer is a probability between zero and one. |
ChoiceAnswer类class | 选项答案,与模型服务通信并返回生成或向量化结果。 The selected alternative and its probability distribution. |
ChoiceQuestion类class | 选项问题,与模型服务通信并返回生成或向量化结果。 A question that selects one named alternative. |
ClassifierModelBase类class | 分类器模型基类,与模型服务通信并返回生成或向量化结果。 Base class for models that return typed probabilistic decisions. |
ClassifierResponse类class | 分类器模型的规范化响应。 The normalized response of a classifier model. |
ClassifierUsage类class | 分类器用量,与模型服务通信并返回生成或向量化结果。 The usage of a classifier model API invocation. |
JevClassifierModel类class | Jev 分类器模型,与模型服务通信并返回生成或向量化结果。 A classifier backed by TypeSafe's Jev System One API. |
OpenAIClassifierModel类class | OpenAI 分类器模型,与模型服务通信并返回生成或向量化结果。 A classifier backed by the OpenAI Decisions API. |
RefusalAnswer类class | 拒答答案,与模型服务通信并返回生成或向量化结果。 A refusal to answer one question, independent of other answers. |
ScoreAnswer类class | 分数答案,与模型服务通信并返回生成或向量化结果。 An expected score and its probability distribution. |
ScoreQuestion类class | 分数问题,与模型服务通信并返回生成或向量化结果。 A question that assigns an expected score using an ordered rubric. |
属性Attributes
ClassifierAnswer字段attribute | — |
ClassifierQuestion字段attribute | — |
属性详情Attribute Details
ClassifierAnswer
TypeAlias = BinaryAnswer | ChoiceAnswer | ScoreAnswer | RefusalAnswer分类器答案字段。声明为 TypeAlias。
The classifier answer field.
源码Source
agentscope/classifier/_response.py:83ClassifierQuestion
TypeAlias = Annotated[BinaryQuestion | ChoiceQuestion | ScoreQuestion, Field(discriminator='type')]分类器问题字段。声明为 TypeAlias。
The classifier question field.
源码Source
agentscope/classifier/_question.py:66