AS AgentScopeAPI 手册 / API Reference
类class agentscope.classifier

ClassifierModelBase

class ClassifierModelBase(ABC)
源码Source agentscope/classifier/_base.py:13–59

分类器模型基类,与模型服务通信并返回生成或向量化结果。位于 agentscope.classifier 包,继承自 ABC。

Base class for models that return typed probabilistic decisions. Declared in agentscope.classifier. Extends ABC.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Parameters类class
参数,与模型服务通信并返回生成或向量化结果。
Provider-specific classifier parameters.

构造器摘要Constructor Summary

构造器Constructor说明Description
def __init__(credential: CredentialBase, model: str, parameters: BaseModel | None = None) -> None
初始化 `ClassifierModelBase` 实例。
Initialize a classifier model.

方法摘要Method Summary

方法Method说明Description
async def __call__(state: str | dict, questions: Mapping[str, ClassifierQuestion], **kwargs: Any) -> ClassifierResponseasyncabstractabstractmethod
以可调用对象方式执行。
Evaluate the named questions against the shared input state.

构造器详情Constructor Detail

ClassifierModelBase

def __init__(credential: CredentialBase, model: str, parameters: BaseModel | None = None) -> None

初始化 ClassifierModelBase 实例。

Initialize a classifier model.

参数Parameters
名称Name类型Type说明Description
credentialCredentialBase凭证对象(类型 `CredentialBase`)。The credential used to authenticate with the provider.
modelstr模型实例(类型 `str`)。The classifier model name or alias.
parameters默认default NoneBaseModel | None参数(类型 `BaseModel | None`)。Provider-specific model parameters.
源码Source agentscope/classifier/_base.py:19–37

方法详情Method Detail

__call__

async def __call__(state: str | dict, questions: Mapping[str, ClassifierQuestion], **kwargs: Any) -> ClassifierResponse
asyncabstractabstractmethod

以可调用对象方式执行。

Evaluate the named questions against the shared input state.

参数Parameters
名称Name类型Type说明Description
statestr | dict状态对象(类型 `str | dict`)。The text or JSON content shared by all questions.
questionsMapping[str, ClassifierQuestion]questions(类型 `Mapping[str, ClassifierQuestion]`)。The typed questions keyed by name.
kwargsAny关键字参数(类型 `Any`)。The kwargs.
返回Returns ClassifierResponse
返回ClassifierResponse。`ClassifierResponse`:
源码Source agentscope/classifier/_base.py:40–59

嵌套类详情Nested Class Detail

Parameters

class Parameters

参数,与模型服务通信并返回生成或向量化结果。位于 agentscope.classifier 包。

Provider-specific classifier parameters. Declared in agentscope.classifier.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.