AS AgentScopeAPI 手册 / API Reference

CredentialBase

public abstract class CredentialBase
源码Source io/agentscope/core/credential/CredentialBase.java:35–66

用于模型提供者的凭证元数据。位于 io.agentscope.core.credential 包。核心成员包括 getId、getChatModelClass、listModels、CredentialBase。

Credential metadata for a model provider.

Each credential carries the connection material (API key, base URL, host, etc.) needed by a specific ChatModelBase subclass. Subclasses declare which model class consumes them via #getChatModelClass() and optionally enumerate the catalog of usable models via #listModels().

id is an auto-generated 32-char hex string identifying this credential instance; it is carried in JSON for round-tripping but not used for authentication itself.

构造器摘要Constructor Summary

构造器Constructor说明Description
protected CredentialBase(String id)
初始化 `CredentialBase` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public final String getId()
final
获取标识。
Returns the id.
public abstract Class<? extends ChatModelBase> getChatModelClass()
abstract
获取聊天模型类。
The `ChatModelBase` subclass that consumes this credential.
public Mono<List<ModelCard>> listModels()
列出模型。
Enumerate the candidate models available under this credential.

构造器详情Constructor Detail

CredentialBase

protected CredentialBase(String id)

初始化 CredentialBase 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
源码Source io/agentscope/core/credential/CredentialBase.java:39–41

方法详情Method Detail

getId

public final String getId()
final

获取标识。

Returns the id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/credential/CredentialBase.java:43–46

getChatModelClass

public abstract Class<? extends ChatModelBase> getChatModelClass()
abstract

获取聊天模型类。

The ChatModelBase subclass that consumes this credential.

返回Returns Class<? extends ChatModelBase>
返回类。Returns class.
源码Source io/agentscope/core/credential/CredentialBase.java:52

listModels

public Mono<List<ModelCard>> listModels()

列出模型。

Enumerate the candidate models available under this credential.

返回Returns Mono<List<ModelCard>>
返回Mono>。Returns mono.
源码Source io/agentscope/core/credential/CredentialBase.java:59–65
基于官方固定版本源码静态生成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.